none
CLR Profiling API problem: IL rewriting issue "System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances" RRS feed

  • Question

  • Failure details: System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
       at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
       at com.altaworks.da.DsaPortRequestor.getPortUsingSocket(String hostName, Int32 httpPort)

    This problem seems to match another blog posting on the Microsoft Forums and in that case a profiler was in the picture as well. The suggestion there was to turn off legacy code access security. Turning off legacy code access security ("LegacyCASModel=false") will fix the issue but that is not an acceptable solution.

    The application profiled is a SharePoint 2013 application. Through IL rewriting the profiler is adding an assembly reference to an external helper assembly that is associated with the unmanaged profiler. That assembly is being loaded into the shared app domain apparently with Full Trust and in a Security Transparent manner. The problem was reproduced on Windows 7 but was first reported on W2k12-R1 and W2K12-R2. 

    The helper assembly is attempting to send profiling data collected to another process.

    Security Rule Set: Level1
    Is Fully Trusted: True
    Zone Evidence: MyComputer
    Security Critical: False
    Security SafeCritical: False
    Security Transparent: True
    Operating System: Windows 7 (Microsoft Windows NT 6.2.9200.0)
    OS Version: 6.2.9200.0
    .NET Version: 4.0.30319.18046
    CLR running in: 64 bit mode

    Wednesday, March 26, 2014 4:37 PM

Answers

  • Hello,

    Please check the kb 2282372 to see whether it would be helpful within the scenario caused by This problem occurs because the 64-bit version of common language runtime (CLR) 2.0 uses one Intermediate Language (IL) stub cache in a shared domain.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 27, 2014 8:36 AM
    Moderator

All replies

  • Hello,

    Please check the kb 2282372 to see whether it would be helpful within the scenario caused by This problem occurs because the 64-bit version of common language runtime (CLR) 2.0 uses one Intermediate Language (IL) stub cache in a shared domain.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 27, 2014 8:36 AM
    Moderator
  • Any update? I have marked my own reply as answer, if you think it provides no help, please unmark it.

    Thank you for your understanding and support.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 8, 2014 9:17 AM
    Moderator