So, I have a 3rd party .dll written in C# 2.0 that needs to be strongly typed and I do not have access to the source code. I found several articles on how to disassembly the .dll and re-assembly it with a strongly named key file.
Problem I am having is that VS2010 recompiles it as a .NET 4.0 .dll instead of a 2.0 .dll (the version our application is currently in). I can't include the "new" dll in my project because it gives me a runtime error of: "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." If I don't sign the dll, I get the "assembly is not strongly typed." error.
Is there a way to recompile this .dll in the 2.0 framework using VS2010 ilasm.exe?
You are probably using the Visual Studio 2010 Command Prompt. It will setup the environment to run C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe when you type "ilasm.exe". Wrong version, you want v2.0.50727\ilasm.exe. Type the full name. Or copy and edit vc\bin\vsvarsall.bat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With