C# windows application Event: CLR20r3 on application start

I've seen this same problem when my application depended on a referenced assembly that was not present on the deployment machine. I'm not sure what you mean by "referencing DotNetBar out of the install directory" - make sure it's set to CopyLocal=true in your project, or exists at the same full path on both your development and production machine.


I encountered the same problem when I built an application on a Windows 7 box that had previously been maintained on an XP machine.

The program ran fine when built for Debug, but failed with this error when built for Release. I found the answer on the project's Properties page. Go to the "Build" tab and try changing the Platform Target from "Any CPU" to "x86".


.NET has two CLRs 2.0 and 4.0. CLR 2.0 works till .NET framework 3.5. CLR 4.0 works from .NET 4.0 onwards. Its possible that your solution is using a different CLR than your reference assemblies. In your local development environment, you might have both the CLRs and hence you did not faced any problem. However when you moved to deployment environments, they might have a single CLR only and you got this error.