Failed to Load file or assembly "xxx" or one of its dependencies. The runtime for generating this assembly is newer than the currently loaded runtime and cannot be loaded.

Source: Internet
Author: User

This problem occurs when I upload my project to the server. I have finally solved the problem by searching for the best medicine and working out the following methods:

1. The main reason is: the referenced project. the. net version is different from the framework started in windows xp. My PC is-> right-click Management-> Internet Information Service-> default website-> right-click Properties-> ASP. NET-> change the corresponding asp.net version to windows 7 my computer-> right-click Management-> Internet Information Service (IIS) manager-> double-click Open-> click application pool-> double-click the website to be modified-> Save. you can change the NET Framework version to the corresponding version. 2. If the iis program pool net framwork version is inconsistent with the net framwork version of your project when you debug the wcf Service, modify the iis program pool configuration, debug OK. 3. "failed to Load file or assembly or one of its dependencies, Access Denied" appears during the adjustment"

Method 1: Stop the Indexing service
Method 2: configure the temporary directory of ASP.net not affected by the Indexing service.
Method 3: delete the pdb file in the bin directory
Method 4: Modify the windows/temp directory permission and set asp.net Machine Account to fully control the directory.
But none of them can solve the problem.

This is because asp.net does not have the read/write permission on the Temporary Folder. For C:/WINDOWS/Microsoft. NET/Framework/v2.0.50727/Temporary ASP.. NET Files directory authorization can completely solve the problem, so far there has been no problem, but the premise is that the file does exist, no file is missing.

 

4. Delete and reload the dll file, and make sure that the dll file has been referenced in the bin folder;

5. Grant the read and write permissions to C: \ WINDOWS \ Microsoft. NET \ Framework \ v2.0.50727 \ Temporary ASP. NET Files.

I sorted out the above methods for reference only. After some tossing, I found my Web. the version in config is incorrect because my local compiling software uses the latest version 4.0 compiled by VS2010 and my server space is V3.5, so I used the method in Step 4 to delete the original dll file. After uploading the latest dll file, I can run it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.