FileLoad Exception

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am running into an issue while loading an assembly.

I have created an exe which was referenced with version 1.5.2.3
This assembly was into GAC.
I installed the application on other machine where i don't have it in the
GAC. Hence
I kept the dll in bin directory of the application.
It worked fine.
Now I have changed the dll, i added certain private metods, no public
methods have been added. I compiled the dll with same version.
Now i am trying to place just the dll on the user machine.

When the user tries to run the application. I get an error which is as below -

Can some one help me out

System.IO.FileLoadException: The located assembly's manifest definition with
name 'DevExpress.XtraEditors' does not match the assembly reference.

File name: "DevExpress.XtraEditors"

at LandataSystems.AIM.UI.Main.frmLogin.InitializeComponent()

at LandataSystems.AIM.UI.Main.frmLogin..ctor(String vstrCompanyName,
String vstrUsername)

at LandataSystems.AIM.UI.Startup.mdlMain.Main(String[] vstrParameters)



=== Pre-bind state information ===

LOG: DisplayName = DevExpress.XtraEditors, Version=1.5.2.3, Culture=neutral,
PublicKeyToken=28b7beea11938153
(Fully-specified)

LOG: Appbase = C:\Program Files\AIM.NET\AIM.NET\

LOG: Initial PrivatePath = NULL

Calling assembly : UI.Main, Version=1.0.1739.33639, Culture=neutral,
PublicKeyToken=null.

===


LOG: Publisher policy file is not found.

LOG: Host configuration file not found.

LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.

LOG: Post-policy reference: DevExpress.XtraEditors, Version=1.5.2.3,
Culture=neutral, PublicKeyToken=28b7beea11938153

LOG: Attempting download of new URL file:///C:/Program
Files/AIM.NET/AIM.NET/DevExpress.XtraEditors.DLL.

WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
 
Dinoo,

You can either strongname an assembly and put it in the GAC and get the
below error because you did not update the references properly in your
calling program.
OR
You can remove the strong nameing and not have the flexibility of putting it
in the GAC and use the simple file copy.
OR
You can do GAC and dynamic copy but use reflection to load the assembly and
be version agnostic.

Here's a rule coined by Sahil Malik --- Donot put things in GAC unless you
absolutely must.

I believe there might be other solutions by creating a publisher policy, but
thats way above my head. Someone from Microsoft CLR team might be able to
comment better on this. I recommend Jeff Richter.

The problem you are running into is because of the publickeytoken and the
minor version being changed.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik


dinoo said:
I am running into an issue while loading an assembly.

I have created an exe which was referenced with version 1.5.2.3
This assembly was into GAC.
I installed the application on other machine where i don't have it in the
GAC. Hence
I kept the dll in bin directory of the application.
It worked fine.
Now I have changed the dll, i added certain private metods, no public
methods have been added. I compiled the dll with same version.
Now i am trying to place just the dll on the user machine.

When the user tries to run the application. I get an error which is as below -

Can some one help me out

System.IO.FileLoadException: The located assembly's manifest definition with
name 'DevExpress.XtraEditors' does not match the assembly reference.

File name: "DevExpress.XtraEditors"

at LandataSystems.AIM.UI.Main.frmLogin.InitializeComponent()

at LandataSystems.AIM.UI.Main.frmLogin..ctor(String vstrCompanyName,
String vstrUsername)

at LandataSystems.AIM.UI.Startup.mdlMain.Main(String[] vstrParameters)



=== Pre-bind state information ===

LOG: DisplayName = DevExpress.XtraEditors, Version=1.5.2.3, Culture=neutral,
PublicKeyToken=28b7beea11938153
(Fully-specified)

LOG: Appbase = C:\Program Files\AIM.NET\AIM.NET\

LOG: Initial PrivatePath = NULL

Calling assembly : UI.Main, Version=1.0.1739.33639, Culture=neutral,
PublicKeyToken=null.

===


LOG: Publisher policy file is not found.

LOG: Host configuration file not found.

LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.

LOG: Post-policy reference: DevExpress.XtraEditors, Version=1.5.2.3,
Culture=neutral, PublicKeyToken=28b7beea11938153

LOG: Attempting download of new URL file:///C:/Program
Files/AIM.NET/AIM.NET/DevExpress.XtraEditors.DLL.

WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
 
Back
Top