none
C# multitarget platform dll RRS feed

  • Question

  • I have problem with using C# dll on 3.5 and 4.5 platform. I have main app (unmanaged code) which use C# dll. And i need to target my dll to both 3.5 and 4.5 platforms. For C# exe application i've used app.exe.config file like

    <?xml version="1.0"?>
    <configuration>
      <startup>
        <supportedRuntime version="v2.0.50727" />
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
      </startup>
    </configuration>

    I've tried to put it in dll folder, in main app folder with lib_name.config.dll and main_app.config.exe name. But it still doesn't work. I should target single dll to both platform (so i can't use only 3.5 or 4.5 framework). How can i use config file for dll?

    Thursday, August 6, 2015 6:36 AM

Answers

  • Hi Eternal_,

    It is not entirly clear to me about your issue.

    >>I have problem with using C# dll on 3.5 and 4.5 platform.

    How many dlls do you have? Do you mean only one dll but has 3.5 and 4.5 versions?

    If so, could you compile two twice?  One is 3.5 version and the other is 4.5.

    Adding 3,5 version dll when you target your project to 3.5 and the same is 4.5 version.

    >>I should target single dll to both platform (so i can't use only 3.5 or 4.5 framework). How can i use config file for dll?

    If you want to target the single dll to both platform, as far as I know, this is  impossible.

    How to: Configure an App to Support .NET Framework 4 or 4.5

    If I missunderstand something,  please feel free to let me know.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 7, 2015 5:51 AM

All replies

  • " I have main app (unmanaged code) which use C# dll."

    How is the main app using the C# dll? COM interop perhaps?

    Thursday, August 6, 2015 10:48 AM
    Moderator
  • No, it calls dll via WinAPI LoadLibrary method
    Thursday, August 6, 2015 11:31 AM
  • Hi Eternal_,

    It is not entirly clear to me about your issue.

    >>I have problem with using C# dll on 3.5 and 4.5 platform.

    How many dlls do you have? Do you mean only one dll but has 3.5 and 4.5 versions?

    If so, could you compile two twice?  One is 3.5 version and the other is 4.5.

    Adding 3,5 version dll when you target your project to 3.5 and the same is 4.5 version.

    >>I should target single dll to both platform (so i can't use only 3.5 or 4.5 framework). How can i use config file for dll?

    If you want to target the single dll to both platform, as far as I know, this is  impossible.

    How to: Configure an App to Support .NET Framework 4 or 4.5

    If I missunderstand something,  please feel free to let me know.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 7, 2015 5:51 AM
  • >>How many dlls do you have? Do you mean only one dll but has 3.5 and 4.5 versions?

    Dll have to support both 3.5 and 4.5 runtimes. And it should be single dll file to both platforms

    >>How to: Configure an App to Support .NET Framework 4 or 4.5

    Yes, i've read this guide, but i can't apply it to dll (with exe application it works without questions)

    >>If you want to target the single dll to both platform, as far as I know, this is  impossible.

    It's a pity :(

    Friday, August 7, 2015 7:43 AM