locked
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. RRS feed

  • Question

  • User-336410117 posted

    Hi, since i deployed my new Asp.Net 4.0 application i receive the exception below in my Event Log.
    The application uses Crystal Reports (the last version) and i hate these components cause they are such a "problem factory". In this case it seems that CR is a .Net 2.0 assembly.

    I searched for a solution on the web and i added this startup element in my Web.Config, but i haven't solved:

      <startup useLegacyV2RuntimeActivationPolicy="true">        
      <supportedRuntime version="v2.0.50727" />        
      <supportedRuntime version="v4.0" />    
      </startup>

     Then i added the startup element in aspnet.config (WINDOWS\Microsoft.NET\Framework\v4.0.30319) but i still haven''t solved my problem.

    I think i need and help :-)
    Thanks.
    Andrea

     

    Exception details:

    An unhandled exception occurred and the process was terminated.

    Application ID: DefaultDomain

    Process ID: 5572

    Exception: System.IO.FileLoadException

    Message: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

    StackTrace:    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
       at System.Reflection.Assembly.LoadFrom(String assemblyFile)
       at CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.DataSetProcessingDelegate(IntPtr arg)


    Application: w3wp.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.IO.FileLoadException
    Stack:
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
       at System.Reflection.Assembly.LoadFrom(String assemblyFile)
       at CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.DataSetProcessingDelegate(IntPtr arg)

    Monday, April 11, 2011 4:45 AM

Answers

  • User690216013 posted

    First, you should revert all changes you have performed on this box to make the environment clean again.

    Second, Crystal Reports is a huge third party component, so fixing its issues, you need to consult SAP,

    http://support.microsoft.com/kb/100368

    Regards,

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, April 16, 2011 5:12 AM

All replies

  • User690216013 posted

    First, you should revert all changes you have performed on this box to make the environment clean again.

    Second, Crystal Reports is a huge third party component, so fixing its issues, you need to consult SAP,

    http://support.microsoft.com/kb/100368

    Regards,

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, April 16, 2011 5:12 AM
  • User-336410117 posted
    Thanks Lex, the point is that in the SAP support forum they said that this is a Microsoft issue, relative to the FW 4.0 and FW 2.0 assembly runtime policy. The issue, should have been solved with this configuration (and some users have solved it), but in my application the issue persists. <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v2.0.50727" /> <supportedRuntime version="v4.0" /> </startup> I put this config in my web.config and in my aspnet_config too. Is there something else i can do? Thanks
    Monday, April 18, 2011 4:33 AM
  • User690216013 posted
    Then you should be able to use paid tech support service either from Microsoft or SAP to find out the real cause if you like.
    Monday, April 18, 2011 6:07 AM
  • User-1672167363 posted

    Hello,

    Could you check http://www.davidmoore.info/2010/12/17/running-net-2-runtime-applications-under-the-net-4-runtime/ information

    and change the order of  and number startup elements for your configuration. Please and add the suggested items from the Blog Post.

    I also look at the MSDN http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx 

    startup Element

     http://msdn.microsoft.com/en-us/library/w4atty68.aspx  supported Runtime

     http://msdn.microsoft.com/en-us/library/dd409253.aspx legacy Security to understand

    why and how to use these changes.

    Hope this helps,

    Martin

     

     

    Tuesday, April 19, 2011 12:49 AM