Application still references previous build version

I have problems with the GAC / my application. I previously used Version 9.0.2.3951 to reference the iAnywhere.Data.AsaClient assembly, but now I deleted it by going to C: \ Windows \ Assembly. There is currently version 9.0.2.3924 in the GAC, but when it starts the application, it is still looking for version 9.0.2.3951 instead of 3924.

I tried to go to the Assembly.cs file in my project to find out if it has an entry for 3951, but it doesn't even mention it, then I tried to go into the App.Config file to find out if it has any either a record, but it’s not. I also removed the links from the project and again added the link to the file version 3924.

How can I make my application search for 3924 instead of the 3951 version of the file.

App still referencing newer version although there is no references

+4
source share
4 answers

code4life gave a good solution that will work in most cases. However, in my case, another solution worked for me. To help everyone else, I am adding this solution here with screen screens.

  • In VS2010, click Tools , and then click options , then Project and solutions , then click Build and run , and then in MSBuild the output of the project assembly: select "Diagnostics"

  • In the multi-line MSBuild project build log file section : select Diagnostics, and then click OK

Options Screen

"3". Press F5 to start the project again. This time, browse the EXIT window to find the Build Invocation section. In my case, it showed me the following.

enter image description here The highlighted text in the above image shows me that there is a policy file in the GAC that redirects the 3924 version call from my application to 3951 . After looking at this, I went into C: \ Windows \ Assembly ** and started looking for a policy file that causes a redirect to ** delete . The screenshot is as follows: enter image description here

"4". I just right-clicked on the file and deleted the version that I did not want, and ran my program again and it was fixed.

+1
source

You need to add assemblyBinding information to your configuration in order to force it to bind. Something like that:

 <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="" /> <dependentAssembly> <assemblyIdentity name="iAnywhere.Data.AsaClient" publicKeyToken="f222fc4333e0d400" culture="neutral" /> <bindingRedirect oldVersion="9.0.2.3951-9.0.2.3951" newVersion="9.0.2.3924" /> </dependentAssembly> </assemblyBinding> </runtime> 

The second option: unload the corresponding project, and then select change it (via the context menu). Find the link to the project, which should look like this:

 <Reference Include="iAnywhere.Data.AsaClient, Version=9.0.2.3951, Culture=neutral, PublicKeyToken=f222fc4333e0d400"> 

You can either delete it, or restore it manually, or simply change the XML entry:

 <Reference Include="iAnywhere.Data.AsaClient, Version=9.0.2.3924, Culture=neutral, PublicKeyToken=f222fc4333e0d400"> 

Hurrah!

+3
source

Find your entire iAnywhere.Data.AsaClient dll and find out which dlls are storing

  open cmd.exe cd\ dir iAnywhere.Data.AsaClient.dll /s 

Check the entire dll for the version you are looking for and remove the rest from the application that finds these dlls

if you find that the dll, which is the wrong version in gac, removes it from gac, if you need help knowing how to do this, let me know and I can tell you

0
source

The problem is that your application was compiled against a build version that it can no longer find. Your options:

  • Update your build link and recompile your code
  • Create a binding redirect as @ code4life mentions in his answer
0
source

Source: https://habr.com/ru/post/1402970/


All Articles