Error after upgrade to .Net4

4 posts, 1 answers
  1. Froggie
    Froggie avatar
    29 posts
    Member since:
    Jan 2012

    Posted 15 Aug 2013 Link to this post

    HI!
    I've updated my Winforms-App from .Net 3.5 to .Net 4 and now I'm getting an error right after I'm starting the Monitor. See attached files.

    Can anyone help me?
  2. Soren
    Admin
    Soren avatar
    44 posts

    Posted 15 Aug 2013 Link to this post

    Hi Sebastian,

    It is not an issue that we've seen before so I am very keen on understanding what is going on here. Thank you for the screenshots, it does make it easier to see what is going on.

    Specifically, a google search for 'mscorlib recursive resource lookup bug' yields a few interesting hits, namely a relative new Connect issue on Microsoft: (https://connect.microsoft.com/VisualStudio/feedback/details/790637/devenv-exe-assert-failure-expression-mscorlib-recursive-resource-lookup-bug) and an MSDN forum (http://social.msdn.microsoft.com/Forums/vstudio/en-US/33711409-9259-428e-9b6d-a16b132997a4/mscorlib-recursive-resource-lookup-bug) on user-level tracing being involved. I think this exception is introduced if the user has hooked up some tracing to some of the extensibility events in the framework and through this is triggering some recursion.

    From looking at your code I see NLog being involved in some tracing activity on the AssemblyResolve event (perhaps you're tracing the loaded assemlies?) and it seems that this is the NLog call that starts the actual recursion( the NLogLogger.get_IsTraceEnabled), 

    Could I ask you to turn off this NLogger tracing for just a little while and see if you continue to experience this issue?

    Looking forward to hearing from you.
     
    Regards,
    Soren
    Telerik
    JAVASCRIPT MONITOR (BETA) AVAILABLE FOR DOWNLOAD.
    Monitor web applications with the new EQATEC Application Analytics JS library. Compatible with all modern browsers.
    Test it today >>
  3. Froggie
    Froggie avatar
    29 posts
    Member since:
    Jan 2012

    Posted 15 Aug 2013 Link to this post

    Hi!

    I've managed to run my app now.
    The error was caused by Debug.WriteLine, when the assemblyname equals mscorlib.resources.dll.
    When commenting out the Monitor.Start line, then this Assembly is never requested. So maybe an error in analytics.dll?
    My solution was commenting out the Debug.WriteLine and now everthing works fine (I have no ressources-Assemblies).

    static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
            {
                string assemblyName = new AssemblyName(args.Name).Name + ".dll";
                Debug.WriteLine(assemblyName); //causes the error, when assemblyName == mscorlib.resources.dll
                if (assemblyName.EndsWith(".resources.dll", StringComparison.InvariantCulture))
                {
                    return null;
                }
    }
  4. Answer
    Soren
    Admin
    Soren avatar
    44 posts

    Posted 15 Aug 2013 Link to this post

    Hi Sebastian,

    I'm glad you got thinks working.

    From your description it would seem that this was triggered by a move to 4.0. Our monitor is compiled against 2.0 and perhaps the assembly-resources it is looking for is the old 2.0 resources assembly? I'm not sure, but perhaps you can avoid this by tweaking some settings in the app.config file (perhaps the supportedRuntime or some clever assembly redirects)

    Let me know if you continue experimenting and if there are further results. I'd love to ensure that others are not hitting the same issue inadvertently.

     Regards,

    Soren
    Telerik
    JAVASCRIPT MONITOR (BETA) AVAILABLE FOR DOWNLOAD.
    Monitor web applications with the new EQATEC Application Analytics JS library. Compatible with all modern browsers.
    Test it today >>
Back to Top