CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Jan 2004
    Posts
    12

    .net searching wrong assembly

    hi, I am creating a unit testing utility. Basically, what it does is look
    for all the "private" and "protected" keywords in a source file from the
    ORIGINAL project and replace them with the "public" keyword. It also
    changes the namespace name to avoid naming collisions and puts these
    files in a DIFFERENT project, and then compiles this new project to
    provide an assembly

    So both projects (the original and the generated one) produce assemblies
    that have the same filename (but have a different version).
    From the original project, I reference the generated project. Everything
    is fine. Intellisense and object browser work on the reference. It
    compiles fine.
    But when I try to run the project I get:

    _____________________________________________________________
    An unhandled exception of type 'System.TypeLoadException' occurred in
    Unknown Module.
    Additional information: Could not load type sf.PTTest.SimpleVandFAccess
    from assembly SimpleVariableAndFunctionAccessibility,
    Version=1.0.1778.28574, Culture=neutral, PublicKeyToken=null.
    _____________________________________________________________


    For this project, there are 2 "SimpleVariableAndFunctionAccessibility
    "
    assemblies.
    One is:
    SimpleVariableAndFunctionAccessibility.exe --> the assembly of the
    project being compiled and run

    SimpleVariableAndFunctionAccessibility.dll --> a linked assembly (the
    generated assembly)



    I am not sure why I am getting the System.TypeLoadException, but the
    version mentioned in the error is of the WRONG ASSEMBLY.

    Visual Studio is looking in SimpleVariableAndFunctionAccessibility.EXE
    (I know this because of the version number) for the class -BUT- it should
    be looking in SimpleVariableAndFunctionAccessibility.DLL
    SimpleVariableAndFunctionAccessibility.DLL has a TOTALLY DIFFERENT
    version number than that mentioned in the error... so it is obvious VS is
    not looking for it in the right place...

    I have been working on this for a few days trying to come up with a
    solution... but so far nothing. Any insight or help would be greatly
    appreciated

    Note: I've attached the projects. The post-build event won't work, since the file is missing, but its not neccessary so it should be ok.
    Attached Files Attached Files
    • File Type: zip 2.zip (73.1 KB, 56 views)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured