locked
How to load NET 3.5 dll ? RRS feed

  • Question

  • I have an application build in .NET 3.5, but now I want to build a WorkflowHost with WF 4.0 (in NET 4.0) only I need to use some dll's of the application that is build in .NET 3.5.

    How can I do this and is this possible ?
    Tuesday, December 22, 2009 10:28 AM

Answers

  • This doesn't look like VS 2010 issue.
    This looks like either you are missing a reference to the Class Library from your Workflow Console Application, or your BusinessEntities class is not public. Check both things in VS or via Reflector or ildasm on your Class Library binary.

    -Karel

    I allready checked both things multiple times.. I guess the problem is that .Net 3.5 is running on .NET 2.0 runtime and .NET 4.0 on a new .NET 4.0 runtime ;)


    I allready found the problem, when I set the Class Library on .NET 3.5 target framework and the WF console app on .NET 4.0, I can use .NET 3.5 DLLs in my app! :)
    • Marked as answer by Bisterbosy Wednesday, December 30, 2009 2:08 PM
    Wednesday, December 30, 2009 2:08 PM

All replies

  • Set target framework of your library DLLs to 3.5 (Properties of your project).

    -Karel
    Tuesday, December 22, 2009 5:02 PM
    Moderator
  • Set target framework of your library DLLs to 3.5 (Properties of your project).

    -Karel

    Karel,

    thanks for your reply. Unfortunately it didn't work. :(

    The problem is that my solution has a project (Workflow Console Application) that makes use of the NET 4.0 framework and I have a project (Class Library) that uses some NET 3.5 framework DLLs that I made in an other project a while ago.

    When I set the target of the Class Library to NET 3.5 framework, I am still getting the same error. When I also set the Workflow Console Applications target to NET 3.5 framework, I get errors because I use alot of WF 4.0 thats in NET 4.0 framework and he can't recognize them anymore.

    Can you tell me how I can solve this problem ?
    Wednesday, December 23, 2009 8:04 AM
  • And what error (exactly) would that be when you set Class Library to 3.5 Fx? (You didn't mention it before)

    BTW: Only your 3.5 libraries should be set to 3.5 target framework. It doesn't make sense to set your main app to 3.5 if it uses 4.0 features/APIs.

    -Karel
    Wednesday, December 23, 2009 6:30 PM
    Moderator
  • And what error (exactly) would that be when you set Class Library to 3.5 Fx? (You didn't mention it before)

    BTW: Only your 3.5 libraries should be set to 3.5 target framework. It doesn't make sense to set your main app to 3.5 if it uses 4.0 features/APIs.

    -Karel

    Karel,

    I know that I need the Workflow Console Application set on the 4.0 target framework. Thats the whole reason I am using VS 10 beta 2 at the moment. Only my Class Library needs to import some DLLs written in 3.5 and thats the problem.

    This is the error I get: The type or namespace name 'BusinessEntities' does not exist in the namespace 'WorkflowHost' (are you missing an assembly reference?)
    Note that 'BusinessEntities' is the Class Library I was talking about, it is in the following namespace: WorkflowHost.BusinessEntities. I am getting this error in the 'WorkflowHost' namespace, after I add the reference and added the using sentence.

    The strange thing is, that I can compile and build the Class Library (with 4.0 as target framework) and also make use of NET 3.5 DLLs (own made) without getting any errors.. But when I want to make a reference to that Class Library I am getting the error above.
    So the namespace and classes do exist, can compile and build correctly, but I can't use it in another project ?!
    Thursday, December 24, 2009 7:55 AM
  • This doesn't look like VS 2010 issue.
    This looks like either you are missing a reference to the Class Library from your Workflow Console Application, or your BusinessEntities class is not public. Check both things in VS or via Reflector or ildasm on your Class Library binary.

    -Karel
    Thursday, December 24, 2009 8:19 PM
    Moderator
  • This doesn't look like VS 2010 issue.
    This looks like either you are missing a reference to the Class Library from your Workflow Console Application, or your BusinessEntities class is not public. Check both things in VS or via Reflector or ildasm on your Class Library binary.

    -Karel

    I allready checked both things multiple times.. I guess the problem is that .Net 3.5 is running on .NET 2.0 runtime and .NET 4.0 on a new .NET 4.0 runtime ;)


    I allready found the problem, when I set the Class Library on .NET 3.5 target framework and the WF console app on .NET 4.0, I can use .NET 3.5 DLLs in my app! :)
    • Marked as answer by Bisterbosy Wednesday, December 30, 2009 2:08 PM
    Wednesday, December 30, 2009 2:08 PM