Does target .net Framework matter for DLLs?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JamesX
    New Member
    • Dec 2009
    • 7

    Does target .net Framework matter for DLLs?

    Hi I am new to programming and I just wrote a small test program to see if Visual Studios 2010 works.

    It seems that even though I targeted the Program for .Net 3.5, the DLL project is still targeted for 4.0 (with no options to change it, that I found).

    The program runes fine on my computer. But it crashes on friend's computers unless they also had .Net 4.0 Installed (comes with VS2010 Beta).

    Does it matter that the DLL library is targeted for .net 4.0? Or is the crashes unrelated to the DLL file and is something else at work?

    [Edit]
    Just tested and it is the DLL's fault. If I comment out all the lines that uses the DLL the program launch without any problems.

    Does anyone know how to fix the requirement for .net 4.0 in regards to a DLL? I have no idea how.
    Last edited by JamesX; Dec 21 '09, 09:04 PM. Reason: Additinal Information
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Can't you change the Application property of the DLL project from 4.0 to 3.5 ?

    Comment

    • JamesX
      New Member
      • Dec 2009
      • 7

      #3
      There is no options to change it that I have found.

      The options for targeting framework is grayed out.

      Is there a way to change it?

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        Are we talking about the same thing?

        I created a C# class library project and the Application property does let me set the target framework. Of course, I am using VS.NET 2008 so my choices are 2.0, 3.0 or 3.5.

        Comment

        • JamesX
          New Member
          • Dec 2009
          • 7

          #5
          The DLL Library project I gotten was a pre-made one. I don't see an option to re-target an existing project. I am complete newbie, so please forgive me if I just missed some glaringly obvious menu option.

          I tried both in 2008 and 2010 to no avail.

          What makes it even worse is even if you select 2.0 as the project target for Win32 Project, once the DLL project is made it will be targeting 4.0 regardless. That could just be because it is beta however.

          Comment

          • weaknessforcats
            Recognized Expert Expert
            • Mar 2007
            • 9214

            #6
            Are you talking about a C/C++ DLL project ot a C# Class Library project?

            Comment

            • JamesX
              New Member
              • Dec 2009
              • 7

              #7
              a C++ Win32 Project, that is added into a C# Windows Form Application.

              It is the MuParser (C++)'s C# Wrapper. The Wrapper is C# but the DLL that came with the project didn't work,so I had to make a new project and build the DLL from scratch.

              Comment

              • weaknessforcats
                Recognized Expert Expert
                • Mar 2007
                • 9214

                #8
                There is nothing in a Win32 C/C++ DLL project to set a framework version.

                Therefore, if that DLL is calling a framework function, it will use the one that's currently on the system. Like 4.0.

                I don't know how your DLL works but I'm guessing that there's no code in there requesting a specific framework version. Prseumable this could be added in the DllMain.

                Only in a C# Class Library project can you target a specific framework version.

                Comment

                Working...