简体   繁体   中英

Site compiled to .net 3.5 as target framework but still seems to reference .net 4.0

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.Extensions and 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM