问题
I am trying to use Ajax control toolkit in asp.net website. I copied the dll from one of my previous sample project. It has the following details
Assembly Version – 3.5.40412.0
File Version - 3.5.40412.2
Internal Name: Ajax Control Toolkit
Language : Neutral
Product Version - 3.5.40412.2
When I add reference to this assembly, it appears as “AjaxControlToolkit-3.5.40412.2” in the reference list. When I run the solution, I get a FileLoadException:
Could not load file or assembly 'AjaxControlToolkit-3.5.40412.2' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I think the problem is with the difference in Assembly version and File version. Is it so? How can we overcome it?
回答1:
Edit the web.config file to remove the reference, which is not required for normal operation:
1 - Open the web.config file in the root of your site
2 - Find the following line and comment it out():xxxxx-is your assembly name.
<add assembly="xxxxx", Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
3 - Save and close the web.config file and try again
Ref Link : http://manual.aspdotnetstorefront.com/p-1118-could-not-load-file-or-assembly-microsoftwebservices3-version3000-cultureneutral-publickeytoken31bf3856ad364e35.aspx
来源:https://stackoverflow.com/questions/10295614/mismatch-in-assembly-and-product-version