C#: check references dynamically

Posted on 2007-07-25
Last Modified: 2013-12-17
Is it possible to check dynamically where the references point to? If yes, I need some sample code or a link.

Question by:gromul
    LVL 37

    Expert Comment

    which type of reference are you talking about? an object reference or a dll reference?

    If a dll reference I am not quite sure what you are asking.. Are you trying to figure out which version of a dll will be used and say its file location? This would not be easy to get as its dependent upon your current configuration (things like search paths) as well as things like whether it is GAC installed and/or whether you have overriden the default loading behavior.

    Could you clarify a bit what you are trying to do?



    Author Comment

    I need a way to debug why a dll file (added as a reference in the solution) is not found. The issue appears on the build machine when building, but not when in the dev environment.
    LVL 37

    Accepted Solution

    ok well is the reference something in a local projectetc or is it in the GAC / a directory? Are you building from visual studio on the build machine? You can expand references and right click (select properties) to view information about them. A reference with an obvious problem will have its icon changed.

    Author Comment

    The dll file is in a local project and appears correctly in Visual Studio on the build machine. I'm using Team Foundation Build for building, so if references are correct is not visible.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 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

    8 Experts available now in Live!

    Get 1:1 Help Now