.NET Instrumentation - Function call to Helper Assembly Fails - Azure Web apps RRS feed

  • Question

  • I have deployed my .NET instrumentation profiler into Azure webapps through Visual studio 2012. My profiler does byte code instrumentation which looks like below,

       --> Injected C# function Call 
       functionA's body
       -->Injected C# function Call

    The injected function call resides on a separate assembly dll. In a physical box the assembly will be added in GAC. But in Azure it will be present in a folder in web app location which will be probed in web.config file.

    Using DefineAssemblyRef of IMetaDataAssemblyEmit, i define the assembly and it's function in each modules that loads into the process. The issue is the injected function call works only for the functions of the web application modules..! All other modules like System.Web.dll or System.Data.dll is failing to call the function, which makes the Azure web app failed to load with 502 error.

    Shortly, injecting into modules other than the web application is getting failed. I guess it to be security issue in loading the custom assembly and I tried setting [assembly: System.Security.AllowPartiallyTrustedCallers] and PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")] and some other security attributes too.. none helped.. How to make this helper assembly to load by the .Net modules.? Is there any other specific security attributes i need to set for the assembly in-order to get loaded..?

    Wednesday, July 11, 2018 4:41 AM

All replies

  • Hi Selva VS,

    Thank you for posting here.

    According to your description is related to web, you could post a new thread in Azure and ASP.NET forum fro suitable support.


    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, July 13, 2018 5:45 AM
  • I have posted in this forum since it is related to .Net instrumentation only. 

    The .Net instrumentation fails when deployed in Azure web apps. That is the issue here. 

    Monday, July 23, 2018 5:05 AM