senzacionale
senzacionale

Reputation: 20916

Could not load file or assembly 'AjaxControlToolkit,

<tt:TooltipExtender ID="teAutoServiceShutdown" TargetControlID="cbAutoServiceShutdown"

Parser Error Message: Could not load file or assembly 'AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

what to do?

Upvotes: 1

Views: 13789

Answers (3)

RAM
RAM

Reputation: 485

The build Output window should give you a fix/workaround for this problem.

Clean and rebuild the solution.

Examine the contents of the Output window, look for this text:

Consider app.config remapping of assembly "AjaxControlToolkit, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" from Version "4.1.40412.0" [C:\Visual Studio\App\Lib\bin\Debug\AjaxControlToolkit.dll]

Following this there will be a fragment you can paste into the <assemblyBinding> section of your web.config.

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3247: 
Found conflicts between different versions of the same dependent assembly. 
In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; 
otherwise, add the following binding redirects to the "runtime" node in the application configuration file: 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="AjaxControlToolkit" culture="neutral" publicKeyToken="28f01b0e84b6d53e" />
        <bindingRedirect oldVersion="0.0.0.0-16.1.0.0" newVersion="16.1.0.0" />
    </dependentAssembly>
</assemblyBinding>

Once you paste that in and rebuild it should automatically reference the version of the Toolkit specified as the newVersion.

Upvotes: 1

timbck2
timbck2

Reputation: 1066

I know this question is nearly a year old, but I just ran into this problem myself. I solved it by simply doing "Build -> Clean Solution" which I guess cleared the assembly cache.

Upvotes: 2

sll
sll

Reputation: 62504

Few possible ways:

  1. Read How the Runtime Locates Assemblies and then try to figure out whether an assembly is referenced correctly and is in any of the expected path (basically you can manually go through the assembly resolving steps yourself and see whether you are able to find reference yourself ;) )
  2. Remove a reference from project file (and I believe web.config), cleanup solution, add reference again
  3. Build project manually using msbuild YourSolution.sln /v:diag > log.txt command line and then see generated log.txt file for any issues while an assembly reference resolving
  4. Use filemon tool to see where Visual Studio trying to find a file

Upvotes: 1

Related Questions