Updating the application with the new .ll dll gives me a FileLoadException?

I have a .net 3.5 application with many DLLs, I tried to rebuild a specific dll without creating the entire application, but after replacing the old one with a new one, the application throws an exception, because it cannot load a new dll exception: System.IO.FileLoadException: failed upload a file or assembly. I understand that he is looking for an assembly with a specific version and a public token, how can I solve this problem without creating the application again? also the application is signed but not registered in the GAC. PS: How can I skip creating the application again, or is it necessary, since the dll is rebuilding?

+5
source share
5 answers

The reason you get the error is because your assembly is signed, and most likely your link to it has the Specific Version property equal to True, and your assembly version number with which you changed this change. I tried many scripts and this was the only script in which I was able to get a FileLoadException. If you change the Target Framework to a newer version, such as 4.0, you will get a BadImageFormatException instead. Even if you say that you have not changed the version number, still check it or set the specific version to False by selecting your link and right-clicking and selecting properties.

Your exception might look like this:

Could not load file or assembly 'LoadedAssembly, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=889080b75eb3bad2' or one of its dependencies. The located assembly manifest
definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

, , , 1.0.0.0 (, - , ). (beit small) , reference 1.0.0.0, True, 2.0.0.0, FileLoadException.

, , " " "False" DLL. .

enter image description here

+5

DEVPATH? , "GAC ". , , :

1) machine.config( , machine.config )

  • C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG *

       

2) DEVPATH

set devpath="e:\temp\Message_DLL\bin\Debug"     /// manually, console
/// or open windows config form - see below

Setting DEVPATH environment variable

3) / UI dll DEVPATH.

Adding reference to dll

, "local copy = false, specific version = false". , ( Starker) true.

4) ONCE! DLL . - DEVPATH DLL!

! UI VS, . - . , UI VS , CLR - DLL.


MSDN MSDN2.

: . , DEVPATH. .

, /-.

CodeProject - , ,

MSDN DEVPATH

, !

+2

, dll.

0

Windows , . DLL? - , DLL ++ Runtime 2005 ( Dev-, , ).

0

... , , DLL, ReadOnly.

> a > ReadOnly > "" > > "".

.

0

All Articles