Impersonating an assembly

C

C.

Hi,

I'm working on a gnarly 1.1 legacy app that contains hundreds of
assemblies. Each of those assemblies reference the legacy assembly
AuthKeeper.

Without access to the source code, I've updated AuthKeeper, ensuring
all public properties and methods are still available, though their
internal implementations have changed.

Is there some way to swap out the old version with the new version
without breaking all those inbound references from the other
assemblies?

I attempted to simply name my new assembly with the AssemblyName of
AuthKeeper and keep the version number, but that doesn't cut it, I get
the error:

System.IO.FileLoadException: Could not load file or assembly
'AuthKeeper, Version=1.0.2804.14599, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)

Thanks!
 
K

kndg

Hi,

I'm working on a gnarly 1.1 legacy app that contains hundreds of
assemblies. Each of those assemblies reference the legacy assembly
AuthKeeper.

Without access to the source code, I've updated AuthKeeper, ensuring
all public properties and methods are still available, though their
internal implementations have changed.

Is there some way to swap out the old version with the new version
without breaking all those inbound references from the other
assemblies?

I attempted to simply name my new assembly with the AssemblyName of
AuthKeeper and keep the version number, but that doesn't cut it, I get
the error:

System.IO.FileLoadException: Could not load file or assembly
'AuthKeeper, Version=1.0.2804.14599, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)

Thanks!

Hi,

I think your problem is because you had compiled the AuthKeeper assembly
using the latest version of compiler. If you still have the old version
compiler (check the C:\Windows\Microsoft.NET\Framework folder), you can
try compile it using that compiler instead.

Or, you could modify the application config file to make the application
to target the new version of .Net framework. For example,

<?xml version ="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0.30319" />
</startup>
</configuration>

Change the above version to match the version of framework that your
compiler is targeted (just run csc.exe without any argument). The above
is the latest.

Regards.
 
K

kndg

I have to apologize...(I should have try it before replying)

When I try to reproduce your situation, the exception I got was
System.BadImageFormatException, not the System.IO.FileLoadException as
you had mentioned. Sorry, and I don't have the solution for this type of
problem either... Maybe google would give you some hints.

Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top