Reputation: 3171
I have a bunch of solutions in C# that I've been handed. There is production code on the server, and I have a version of it on a local dev machine. I make a code change, and build the dlls. When I try to copy the dlls to the server, it gives me errors like:
"Could not load file or assembly 'myfile.dll' or one of its dependencies.
This assembly is built by a runtime newer than the currently loaded runtime
and cannot be loaded."
One of the issues is that the projects that I use for building ORM, data, and business logic are not on the server, but are on my local, and I can use them to build dlls, but it isn't helpful when I can't tell what the server is using either. Where do you find out what versions it runs and how to build to match? I know this is my own ignorance in not knowing how the .net framework works, the different versions, how to build for the right one (32-bit vs 64-bit a concern too?) and get things to work. I have looked around a bit, but no where seems to explain this.
Upvotes: 0
Views: 542
Reputation: 924
To change the target framework of your project in vs2k10: Open project properties -> Application tab -> Target framework(its combobox with available versions)
To check/change the framework version on your server(it is for IIS 7.0 version):
Upvotes: 0
Reputation: 7692
32 or 64 bits should not bother you. To find the framework version, you must look for the website or virtual directory at IIS.
I don't have a Windows Server here, but it's something like this:
These steps are for IIS 6. For IIS 7 it's mostly the same, but they don't call it "properties" window, it's "Advanced something".
I'm sorry for not having the proper details, but you'll be able to find it.
Upvotes: 1