Help: DLL run-time problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Troy

    #1

    Help: DLL run-time problem

    I have a class library (DLL) that I created and have been using for sometime in my various .NET applications. Recently, I have been having problems with what I believe is corruption (or a bug) of the DLL. The problem goes something like this:

    - I add new classes, methods, types, etc to the class library DLL and compile. The compile completes successfully with no errors or warnings

    - In the app that references this dll, I can use the new types I have defined in the class library dll (the new types appear in the intellisense list and in the object browser). It compiles fine with no errors or warnings

    - However, when I run the app that references the dll, it will generate an exception that says that it cannot find or load the particular class/method/type that I am using, even though it did not find any problems at compile time. When debugging the code I have noticed two things
    1. the exception/error does not get caught by any exception handlers I have adde
    2. I am prevented from "Stepping Into" the method containing the call to the supposedly missing typ

    - I can however use classes/methods/types that were defined prior to the new additions

    - I have found a way for the app to recognise the new types at run-time. It involves creating a new solution and importing the code from the old app into the new solution. This will solve the problem, however I will have to do this every time I want to make a change to the class library DL

    What I have tried
    - Removing the reference and adding it back i
    - Deleting the DLL and recompiling source cod
    - Turning "Option Strict" ON and OF
    - I have NOT tried to re-create the class library DLL (as a new solution) as another bug prevents me from doing so (Currently being looked at by Microsoft and is not (unlikely?) related to this problem)

  • Tian Min Huang

    #2
    RE: Help: DLL run-time problem

    Hello,

    Thanks for your post. As I understand, the problem you are facing is that
    you .NET app will always load previous version of a class library at
    run-time. Please correct me if there is any misunderstandin g. I now share
    the following information with you:

    1. Please check if you have multiple version of class library (DLL)
    existing on your system or even installed in GAC. If so, I suggest you to
    rename or delete the older version and see if it works.

    2. Did you specify to load early version of DLL in you .NET app's
    configure? For more information on "Managing Versions of an Application",
    please refer to the following MSDN article:

    http://msdn.microsoft.com/vstudio/us...?pull=/library
    /en-us/dndotnet/html/managevers.asp

    3. In addition, you can use Process Explorer to check which DLL is loaded
    to your .NET app. You can get this tool from www.sysinternals.com:

    Process Explorer


    I look forward to your response.

    Regards,

    HuangTM
    Microsoft Online Partner Support
    MCSE/MCSD

    Get Secure! -- www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.

    Comment

    • Troy

      #3
      RE: Help: DLL run-time problem

      Thanks for your response.

      Unfortunately I have tried all of those things you have suggested. There is only one possible DLL it can be loading. I have found some additional information about this problem that may help further. I have tried to replicate this problem by creating a "Windows Application" to use the DLL. I have found that I cannot replicate the problem using this type of project. The only project I can get this problem to replicate is with an "Excel Project" (Visual Tools For Office). I hope this helps.

      Comment

      • Tian Min Huang

        #4
        RE: Help: DLL run-time problem

        Hi,

        Is it possible for your to post a sample project and tell me the detailed
        steps to reproduce the problem? I will be glad to check it on my side.

        I look forward to hearing from you.

        Regards,

        HuangTM
        Microsoft Online Partner Support
        MCSE/MCSD

        Get Secure! -- www.microsoft.com/security
        This posting is provided "as is" with no warranties and confers no rights.

        Comment

        Working...