Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have already searched on Google but I cannot find any solution regarding this problem.
It gives me solution for project but I have already done that in App.config

My problem is with the deployed software.

ERROR:
----------------
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.   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)

--------------------------------------------
I got error like as I mentioned above. Actually I have already added
XML
<startup useLegacyV2RuntimeActivationPolicy="true">
   <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
 </startup>

---------------------------------------------
In my app.config file. project is working fine in debug mode but it is not working in deployed software, when I run my software and open crystal report form, I get this error.

Any idea please help.
Posted
Updated 4-Apr-11 22:33pm
v2

It looks like your Crystal DLL is not .NET Framework 4.0 compatible.

Error says that something is still trying to refer Framework 2.0 though you are trying to run the application on Framework 4.0.
Make sure that all the dll's used and the projects are using/running on Framework 4.0.

In IIS, once you host/deploy it, the Framework selected for the same is 4.0
 
Share this answer
 
Comments
sheladiyaketan 5-Apr-11 6:27am    
actually in app.config if i add code

<startup uselegacyv2runtimeactivationpolicy="true">
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0">


its works finely in debug mode. but if we install application at any computer and run that software it show me error and software's exe.config not contains the above code ,if i add the above code in software's exe.config then application doesn't read the exe.config file.
Sandeep Mewara 5-Apr-11 6:32am    
There must be higher version DLL's on your locat system and missing on server. As said, try to find the wrongly built dll.
sheladiyaketan 5-Apr-11 6:39am    
actually i have made one manual data set to generate report that can be a problem? i m using SAP crystal report.and all other required dlls which i need that i had devloped on .net 4.o version.
sheladiyaketan 5-Apr-11 7:40am    
finally i got the solution.i just change the framework v4.0 to v2.0
It could be that one of the dll's you are referencing is actually running an older version on this particular machine.
 
Share this answer
 
v2
Comments
sheladiyaketan 5-Apr-11 6:58am    
thanks
sheladiyaketan 5-Apr-11 7:46am    
finally i got the solution.i just change the framework v4.0 to v2.0

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900