.NET app loading old dll's

Posted on 2011-05-11
Last Modified: 2013-11-07
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.

Question by:supertedusa
    LVL 18

    Expert Comment

    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" ?>
         <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">        
             <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" />            
                    <publisherPolicy apply="no"/>              
    LVL 16

    Expert Comment

    by:Kamal Khaleefa
    try to check the verion in ur web.config

    Author Comment

    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?

    LVL 41

    Expert Comment

    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?

    Author Comment

    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?

    LVL 41

    Accepted Solution

    There may not be any "direct" references....  instead, you might only reference A (which in turn, references B and C).

    In the solution explorer, you can click on a reference and see the properties.  One of the properties is the "Copy Local" property (which you previously said you had configured to "false').  When this is set to "True" (my mistake on the "copy if newer" comment...I should have said just "true'), then VS attempts to figure out what other components need to "come along for the ride".   It will place all of the DLLs that it thinks needs to be there in the bin directory.

    If you configure that property to True, then you can browse the project's bin directory and see all of the DLLs (and their version numbers)

    Author Closing Comment

    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.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now