I have a site that I compiled to .net 3.5 as the target framework, it works fine locally, but when I upload it onto godaddy’s servers I get the following error:-
System.Web.HttpParseException: Could not load file or assembly ‘System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified. —> System.IO.FileNotFoundException: Could not load file or assembly ‘System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
File name: ‘System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
I’ve inspected my web.config file and there is no reference to any 4.0.0.0 dll’s, any ideas what I could be doing wrong and why I’m getting these errors? my Godaddy server is running .net 3.5. I don’t see how a project compiled to 3.5 can be getting these problems.
Check project references, remove reference to
System.Web.Extensionsand then add it again but check that you’re choosing the right version.Projects target framework is different thing to dependency target framework. You can compile a project for one, but it’s dependency may be compiled for another target framework.
When dependency uses higher version of runtime, this application will fail once it starts. When using dependency with lower version of runtime everything will run fine.