locked
Does ASP.NET 4 create dynamic assemblies on its own? RRS feed

  • Question

  • User-604442531 posted

    I am working on our development site that we are migrating from ASP.NET 3.5 to 4.0.  Most stuff seems to be working fairly well, with only a few tweaks necessary so far.

    My issue is with a third party component that uses version 2.1 of Xheo.Licensing.dll. We've been using the control and licensing successfully under 3.5 since it was first released, but in 4.0 things have gotten a little hairy.

    The licensing control iterates over all of the assemblies in the AppDomain and accesses the CodeBase property on them. I now get a "The invoked member is not supported in a dynamic assembly." exception during that iteration.  This was not a problem under 3.5!  More frustrating is that is doesn't happen all of the time.

    I was able to do a little investigation and found a couple of assemblies that appear to be created by the framework itself. 

    The first assembly has a unique GUID name (A_f3fd500a_14ae_46c4_8df9_5ad80e8c7744, for example) and a varying number of classes, each also with a GUID name (T_f8b496b1_d316_4973_8f42_24fc8871eb30 and T_2cf3382c_031d_40c6_b1c6_0fec31022de0, for example).  Each of the exposed classes implements only the System.Web.Util.IWebObjectFactory interface.

    The second dynamic assembly that I have been able to identify was named "Anonymously Hosted DynamicMethods Assembly", though there were no classes in it.

    When things recycle, things work until one of these classes is created again, though I have not been able to determine any sort of pattern or operation that can reproduce it.

    I know that none of my code does this, and it doesn't seem that the third-party components do, either, since they worked under 3.5 without creating the dynamic assemblies. Has something changed under the hood in 4.0 that now creates dynamic assemblies? Is there a way to revert to the old behavior?

    I obviously want the problem fixed at the licensing DLL-level, but that is slow going...


    Thanks!

    Joel

    Monday, April 19, 2010 8:37 AM

Answers

  • User-1666980993 posted

    Your best bet is to contact the vendor of that third-party component.  I would be wary of making configuration changes to your environment just to fix that one problem- you could end up breaking other things in the process.

    You could also contact Xheo, they may be able to assist.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 19, 2010 1:14 PM

All replies

  • User-1666980993 posted

    Your best bet is to contact the vendor of that third-party component.  I would be wary of making configuration changes to your environment just to fix that one problem- you could end up breaking other things in the process.

    You could also contact Xheo, they may be able to assist.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 19, 2010 1:14 PM
  • User-604442531 posted

    I agree that is the correct long-term solution.  I'm not the person with the contract with Xheo, but I'll give it a try with them directly as well.

    I'd still like to figure out the answer.  I like to know what secret things the system might be doing, and would like to keep up our testing of the site, even if a configuration change never made it into production.

    Monday, April 19, 2010 1:38 PM
  • User-604442531 posted

    Well I sorted out the issue.

    It's not that dynamic assembles weren't created under previous frameworks, but that the 4.0 framework handles them differently.

    The licensing assembly checked to see if an assembly was a System.Reflection.Emit.AssemblyBuilder (with System.Reflection.Assembly as a base) to determine if an assembly was dynamic.  If it was, then it was ignored, otherwise it went on to access the CodeBase property.

    In .NET 4.0, dynamic assembles are of type System.Reflection.Emit.InternalAssemblyBuilder!! Since this is also has System.Reflection.Assembly as a base, the check breaks!

    Ugh. :-)

    Joel

    Wednesday, April 21, 2010 9:02 PM
  • User-1666980993 posted

    Interesting!  Did your vendor or Xheo say they'll be updating for 4.0?

    Thursday, April 22, 2010 8:46 AM
  • User-604442531 posted

    I haven't gotten any confirmation.  I'm not sure if they even believe it is a problem yet, since I seem to be the only one that experienced it so far.

    My vendor is using version 2.1 of the Xheo controls, and they are up to 4.x now.  I'm not sure they are even supporting his version any more.   I reported it to them directly as well, though, but haven't heard back yet.

    Thursday, April 22, 2010 8:58 AM
  • User-518576940 posted

    I've been looking at this problem today also. 

    Friday, April 23, 2010 3:51 PM
  • User110921215 posted

    I have the same problem with the Xheo.Licensing.dll after migrating to ASP.Net 4.0
    The application cannot resolve the Xheo and generates a invalid license response.
     

    Event code: 3005

    Event message: An unhandled exception has occurred.

    Event time: 30/04/2010 10:05:36 a.m.

    Event time (UTC): 29/04/2010 10:05:36 p.m.

    Event ID: 75e13c4c6819426a840b813d9ef73dba

    Event sequence: 53

    Event occurrence: 3

    Event detail code: 0

     

    Application information:

    Application domain: /LM/W3SVC/1146484069/Root/evl-1-129170490436718750

    Trust level: Full

    Application Virtual Path: /xxx

    Application Path: E:\xxx\xxx\wwwxx1.xxx.xxx\xxx\

    Machine name: WWW

     

    Process information:

    Process ID: 8164

    Process name: w3wp.exe

    Account name: NT AUTHORITY\NETWORK SERVICE

     

    Exception information:

    Exception type: LicenseException

    Exception message: An unexpected error occurred while attempting to obtain a valid license for SurveyBox. Please contact Feedback Server for assistance (Url = http://www.dataillusion.com/fs, Email = support@dataillusion.com, Phone = N/A). The exception thrown was The invoked member is not supported in a dynamic assembly.

    at Xheo.Licensing.ExtendedLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)

    at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)

    at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)

    at DataIllusion.FeedbackServer.WebControls.SurveyBox.AIq)ZttkD()

    at DataIllusion.FeedbackServer.WebControls.SurveyBox.OnInit(EventArgs e)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    The invoked member is not supported in a dynamic assembly.

    at System.Reflection.Emit.InternalAssemblyBuilder.get_CodeBase()

    at Xheo.Licensing.ExtendedLicenseProvider.ᐁ(LicenseContext , Type , Object , LicenseSigningKey , ArrayList , StringBuilder )

    at Xheo.Licensing.ExtendedLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)

     

    Request information:

    Request URL: http://www1.xxx.org.nz/xxx/ContentPages/DataEntry/xxx/StudentSurveyBoxInsert.aspx?PKuID=105014&AnybodyName=xxx xxx&VoterType=Selected

    Request path: /xxx/ContentPages/DataEntry/xxx/StudentSurveyBoxInsert.aspx

    User host address: xxx.xxx.xxx.xx

    User: xxxxx

    Is authenticated: True

    Authentication Type: Forms

    Thread account name: NT AUTHORITY\NETWORK SERVICE

     

    Thread information:

    Thread ID: 1

    Thread account name: NT AUTHORITY\NETWORK SERVICE

    Is impersonating: False

    Stack trace: at Xheo.Licensing.ExtendedLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)

    at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)

    at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)

    at DataIllusion.FeedbackServer.WebControls.SurveyBox.AIq)ZttkD()

    at DataIllusion.FeedbackServer.WebControls.SurveyBox.OnInit(EventArgs e)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     

    Custom event details:

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Thursday, April 29, 2010 7:44 PM
  • User-604442531 posted

    HA!  I was having the issue with FeedbackServer as well.

    I was actually trying to help Thomas identify the scope of the issue when I made this post, and we were finally able to figure it out.

    They are working on an updated build that works around the issue now.

    Joel

    Friday, April 30, 2010 8:50 AM