Link to home
Start Free TrialLog in
Avatar of supertedusa
supertedusaFlag for United States of America

asked on

.NET app loading old dll's

VS2010, Windows 7 Ultimate 64-bit, .NET 3.5 Framework

I have a C# app written in VS2003 that I converted into VS2010.  I've changed the framework from 2.0 to 3.5.  I also have some 3rd party reporting dll's that the app uses and upgraded those as well to compatible versions.

I've deleted the old references and added the new ones, verified the versions are the correct updated ones.  They are not being copied to local and no specific version is selected in the reference properties.  The app builds and runs fine in VS.  It is set to build for x86 architecture.

On my target machine (Win7 64-bit) it runs in XP compatibility mode and as Administrator on the properties.  It dies on load and after debugging it, it is trying to load the older version of the reporting dll's which can't be found.

My question is, where in the dll-hell is the reference info coming from?  Cached config files?  I've done a 1/2 day reading on .config files, manifest files and other stuff but where is this stuff on the target machine?  I need some straight education on where the hell the reference to the old is coming from and how to correct it to point to the versions the app's compiled to find.

Thanks!
Avatar of dj_alik
dj_alik

You can put right dlls in  your application directory and they will be found by application first.
Or put dlls in GAC
and also set specific version of dlls in app.config like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>  
  <runtime>      
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">        
           <dependentAssembly>                  
         <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" />            
                <publisherPolicy apply="no"/>              
      </dependentAssembly>    
       </assemblyBinding>  
 </runtime>
</configuration>
try to check the verion in ur web.config
Avatar of supertedusa

ASKER

Meant to add that:  they are listed correctly in the GAC.  I'm cloudy on how app.config works.  I created that file via the project properties but it doesn't list any of my references (or these dll's) in it.  Where would the old references be found?

king2002:  does a client-based C# app have a web.config?

Thanks.
So, why did you configure VS to not copy the DLLs to the local directory?   If you changed that to "copy if newer", then you'd get a nice list of DLLs that the VS thinks your app needs.  That'd be a good way to check out the version numbers.

Did I understand that this is a Windows From application that's running under a virtual machine (aka the XP Mode)?   If so, how did you deploy the application?  Did you just copy the contents of the bin directory?
I've tried the copy local setting on them but it didn't help.  I'm not sure what "copy if newer" is?

Yes, it's a WinForm app on a virtual machine.  I'm using WISE installer to build the install.  Those files are set to "Always Replace" during installation and I can verify they are correctly installed on the machine.  What I can't understand is where are these references found in my application?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of graye
graye
Flag of United States of America 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
Thanks, I deleted the project, restored an original but deleted the references before upgrading it to VS2010 and then added them in.  Copied local and set the build settings I needed for x86 and it's all running fine.