Link to home
Start Free TrialLog in
Avatar of nbkbar7
nbkbar7

asked on

Could not load file or assembly. cannot find the file specified.

I am a not a new .NET programmer and should be able to figure this out myself,  but I am stumped someone please help!

Here is the first error I am dealing with.

Could not load file or assembly Infragistics2.Win.v9.2, version=..., or one of its dependencies. The system cannot find the file specified.

So I have an application (IPAPSig) that works on my dev machine but gives the above error when it loads on a newly installed XP Pro sp3 (virtual) machine. The listed file is located in the GAC along with all of the rest of the Infragistics toolset.

I have copied all of the Infragistics files into the startup directory. With the files in the startup directory I get a different error as follows:

Could not load file or assembly Infragistics2.Win.v9.2, version=..., or one of its dependencies. The located assembly's manifeest definition does not match the assembly reference (Exception from HRESULT: 0c80131040)

So I take the files from the startup directory and drop them in the GAC and remove them from the startup directory. When I run IPAPSig I am back to "cannot find the file specified".

These files are the same exact files that I compiled with.

OK That is confusing but here is the really confusing part. I have another app called IPAP.
IPAPSig is a duplicate of the IPAP code. Software to capture signatures was added and the new code was called IPAPSig. I have installed IPAP on the same machine and it works perfectly!

I thought perhaps that the signature code and 3rd (SigPlusNET) party dll might be the issue but the error messages are complaining about Infragistics not SigPlusNET.

thoughts?

thx in advance

Dave
Avatar of Member_2_861731
Member_2_861731
Flag of Canada image

Are you creating the Deployment Package from Visual Studio?
If you are, you should include all dependencies and register them in the GAC of the target machine. This link explains how to do it: http://stackoverflow.com/questions/1889906/registering-dlls-in-the-gac-using-visual-studio-installer
Avatar of nbkbar7
nbkbar7

ASKER

No actually I am dropping everything into a shared subdir and copying it into a dir on the virtual machine.
So you want to run this with Visual Studio? Or do you want to simulate how it will run once you install it?
Avatar of nbkbar7

ASKER

I created an application. I made a copy of the application code and created a second application. In the second application I added some features. Both applications run perfectly on my DEV machine. Only the first one runs on the XP machine.

This has nothing to do with installing. It only has to do with running the applications.
If you move the application to another machine and plan to run it from VS, you should add the assembly to the GAC in the new machine (which you already did) and then add the reference again to the project in VS.

Give this a try and let us know.
Avatar of nbkbar7

ASKER

I'm confused I guess. I'm not running the app from VS. It's a standalone application. I'm not sure how to clarify further. I wrote IPAP.exe and IPAPSig.exe and I copied them over to another machine. IPAP.exe works and IPAPSig.exe gives the above errors.

make sense?
I doubt that's gonna work, because of the versioning in the gac. Your application must have the exact version (not the dll version, but the assembly version in the gac) is this isn't the same the application will not recognize the assembly.

On the other hand if you copy the dll files to the new computer it still won't work because the reference is pointing to the gac. So I think you have two options:

a. Create an install package in the dev box and install the app in the new box.

b. Add the reference to the physical (not through the gac) file and copy the entire bin folder to the new box and it should run.
Avatar of nbkbar7

ASKER

Clearly you are not understanding my problem. If you have any input related to my problem I would appreciate it.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_861731
Member_2_861731
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nbkbar7

ASKER

The problem was another 3rd party dll was not the version that IPAPSig was compiled with. What that dll has to do with the one in the error message I don't know. But everything is working now.

Thanx for your effort and perserverance your last post jogged my memory and I went through and checked all my version numbers.

Thx LIONKING!


D