5

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

FunctionA()
{
   --> 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..! 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..?

4

0 回答 0