locked
Loading Silverlight profiler not working, entirely, under standard user account

    General discussion

  • Greetings, 

     I have run into an issue with Silverlight profiling. If a standard user account (under Vista) launches IE (both 8 & 9), with the correct CORECLR_** environment variables for Silverlight profiling, the profiler is not instantiated when the Silverlight application loads. if I then 'right-click' the Silverlight application and select the Silverlight menu option, the profiler gets loaded. Inspecting the IE processes shows that they all have the required environment variables set. 

     If I run IE as an administrator, everything works as I would expect - the profiler gets loaded when the Silverlight application loads. 

     Is this a limitation with Silverlight profiling - that IE must run with administrative privileges?

    Thanks!

    Saturday, April 09, 2011 9:07 PM

All replies

  • Hi S.Skove,

     

    Welcome to the MSDN forum!

    I suggest you can post thread in Visual Studio & Silverlight Development Tools. There are experts in that forum.

     

    Thank you for your posting and understanding.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Paul Zhou Thursday, April 14, 2011 3:28 AM
    Tuesday, April 12, 2011 11:01 AM
  • Hello Paul, 

     Thank you for your reply.

    My question is not really about creating a Silverlight application, but more about having difficulties getting the Silverlight CLR to load a profiler when the Silverlight host is not running with administrative privileges - it is about the Silverlight Profiling API. 

    I did look around to find a more appropriate forum, but this seems to be the best place as it is the only one that deals with building development tools for .NET - none of the forums on silverlight.net seem appropriate as they are more focused with the art of Silverlight application building. 

    If you know of a better place to post this, I would be more than happy to comply. 

    Regards,

    Tuesday, April 12, 2011 12:26 PM
  •  

    Hi again,

     

    There could be number of IE processes while your application is running. Yet Visual Studio attaches Profiler to only first of them, and doesn’t reattach it automatically to other spawned processes. Thus, you have 2 options here – either to eliminate creation of child processes by IE through the registry (modifying TabProcGrowth value), or attach profiler to additional IE process (one or many) before you start running your scenario. Simultaneous profiling of several processes is supported, and you will actually profile all IE processes that you attach the profiler to. Those processes that run your application will generate a valuable profiling data, while rest could be later ignored.

     

    Much information, please refer to:

    VS2010: Silverlight 4 profiling from Visual Studio UI

    VS2010: Silverlight 4 profiling

     

    If you want to build a silverlight profiler tool by yourself, you can use CLR profiling APIs:

    Writing a Profiler for Silverlight 4

     

    I still suggest you post thread in Silverlight Forum because there are experts in that forum.

    And this forum is used to discuss the APIs and techniques used to build tools for .NET, such as debuggers, profilers, health monitors, compilers, disassemblers, obfuscators etc. Your issue is not a building tool issue but about how to use the tool

     

    Thank you for your posting and understanding.

     


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 14, 2011 5:09 AM
  • Hello Paul, 

     You misunderstand me. I am not talking about generic profiling of a Silverlight application nor building a Silverlight application, I am talking about a profiler that I have made which I can not get to execute properly in IE, unless I launch IE with administrative privileges.

    My question is whether this is the intended behavior of the Silverlight profiling API. So Yes my issue is about an API which is used to build a profiler and should be on-topic for this forum. 

    Where do you get the Visual Studio profiler stuff from? I clearly state that the question is about the Silverlight Profilling API. 

     

     

     

     

    Thursday, April 14, 2011 6:21 AM
  • Hi, there.  You are correct, this is the appropriate forum.  Sorry for the confusion.  I will make sure this gets assigned appropriately.  I can tell you that when I try to run profilers against IE/Silverlight, I usually turn off protected mode for IE.  But I don't run IE as an administrator, and I don't believe that should be necessary.

    Thanks,

    Dave

    Thursday, April 14, 2011 11:36 PM
  • Hello Dave,

     

     Thanks.

     I tried with protected mode off and then things work as they should. Still can't get it to load with protected mode on, except as stated in my original post. 

    Friday, April 15, 2011 12:19 AM
  • Hi S. Skov,

    I tried loading a silverilght profiler under IE9+Win7 as a standard user with protected mode turned on, and in both cases (as an unelevated admin, and a standard user), I can get my profiler to load successfully. Could you please give us more details so that we could identify the problem? Some things I can think of:

    1. What's the exact value for CORECLR_* you are using

    2. Have you verified that the CORECLR_* environment variables are indeed propagated to Iexplorer.exe process?

    3. How did you register your

    3. Have you verified that the iexplorer.exe process responsible for the TAB where the sliverlight app is running, is indeed the process you are looking at? Since there could be multiple iexplorer.exe process in the system, you might want to use ProcExp.exe (in sysinternals utilities) to find out which process is the one you really want (that has loaded coreclr.dll).

    4. Did your profiler do anything that is not allowed as a standard user? Have you tried removing callback code (especially ICorProfilerCallback::Initialize) in your profiler just to see if your profiler can be really loaded?

    5. Can you try using ProcMon.exe (also in sysinternals utilities) to capture the registry/disk activities of IExplorer.exe and see if there is any suspicious failure when accessing registry or loading your profiler DLL?

    6. Have you tried attach WinDbg/Visual Studio to iexplorer.exe procss and see whether your profiler callback ICorProfilerCallback::Initialize has been called?

     

    Regards,

    Yi

    Wednesday, June 29, 2011 12:55 AM
  • Hello Yi, 

     Thank you for your reply. 

    Regarding 1,2,3 and 3(?):

    I put the settings into the environment variable for the system, so all new processes would have them. The only difference from when it works or not was changing the protected mode, as David suggested. 

    4) No, it actually doesn't do anything. As stated in 6, the profiler dll never gets loaded.

    5) I can't unfortunately at the moment. But given the opportunity I will capture what I can - might take some time. 

    6) Yes, and the profiler dll has not been loaded.

     

    What I think is worth noting is the fact that when I accessed the context menu of the Silverlight applet and clicked the 'Silverlight' menu option the profiler loaded. From what I could gather then the resulting agp.exe process, from the context click, loaded the profiler. This sort of led me to believe that things were set up correctly, but something somewhere stopped the profiler from loading in the actual IE Silverlight hosted process. 

     

    Regards,

    Wednesday, June 29, 2011 11:04 AM
  • Hi S. Skov,

    Thanks for getting back to me. Since you are not getting your profiler to load at all in protected mode, and things are working for you in non-protected mode and in admin, and that I can get my profiler to load in protected mode IE 9, I believe there must be something environment-specific in your case that is preventing your profiler to be loaded in protected mode. In this case, ProcMon is probably our best bet. Please send out outputs of ProcMon once you get a chance.

    Regards,

    Yi

    Thursday, June 30, 2011 6:46 PM