locked
How to use .net dll in .net core application RRS feed

  • Question

  • User-454825017 posted

    suppose i have dll which was developed by .net 4.5.2 and if i want to use it in .net core web or windows application. is it possible ? can i add that dll file as a reference in my project ?

    thanks

    Thursday, July 9, 2020 4:37 PM

Answers

  • User348806598 posted

    It may not be a good idea. To use a library across .net framework or core, you can develop the library in .net standard, then you can use this for both.

    https://docs.microsoft.com/en-us/dotnet/core/porting/libraries

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2020 4:50 PM
  • User475983607 posted

    TDP

    It will be very helpful if you tell me how can i migrate one class library project from .net 4.5 to .net standard. if possible please include one good article link which help me to port my existing class lib project from .net 4.5 to .net standard. thanks

    Again, it depends on what the DLL does.  The ASP.NET Core documentation has migration guides and you can start with this guidance.

    https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-3.1

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2020 5:15 PM
  • User-474980206 posted

    It will be very helpful if you tell me how can i migrate one class library project from .net 4.5 to .net standard. if possible please include one good article link which help me to port my existing class lib project from .net 4.5 to .net standard. thanks

    to convert a 4.* library to .net standard is just create a new .net standard library project, and copy the source files to it. then add all the required nuget packages.  if there is a .netstandard version of the package you are good to  go. if there not a .netstandard version of the library, you will need to find a replacement, and make the coding changes. often the standard version is not fully compatible with the old version, and again you must make the required coding changes.

      http://www.lhotka.net/weblog/MigratingFromNETToNETStandard.aspx

    official:

      https://docs.microsoft.com/en-us/dotnet/core/porting/libraries

    note: the official docs say upgrade to 4.7.2 first because they are old, you should upgrade to 4.8 first.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2020 7:48 PM

All replies

  • User475983607 posted
    Depends on the version of Code and what the dll does. Core 3.x is not compatible with .net 4.5.2.
    Thursday, July 9, 2020 4:50 PM
  • User348806598 posted

    It may not be a good idea. To use a library across .net framework or core, you can develop the library in .net standard, then you can use this for both.

    https://docs.microsoft.com/en-us/dotnet/core/porting/libraries

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2020 4:50 PM
  • User-454825017 posted

    It will be very helpful if you tell me how can i migrate one class library project from .net 4.5 to .net standard. if possible please include one good article link which help me to port my existing class lib project from .net 4.5 to .net standard. thanks

    Thursday, July 9, 2020 4:55 PM
  • User475983607 posted

    TDP

    It will be very helpful if you tell me how can i migrate one class library project from .net 4.5 to .net standard. if possible please include one good article link which help me to port my existing class lib project from .net 4.5 to .net standard. thanks

    Again, it depends on what the DLL does.  The ASP.NET Core documentation has migration guides and you can start with this guidance.

    https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-3.1

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2020 5:15 PM
  • User-474980206 posted

    It will be very helpful if you tell me how can i migrate one class library project from .net 4.5 to .net standard. if possible please include one good article link which help me to port my existing class lib project from .net 4.5 to .net standard. thanks

    to convert a 4.* library to .net standard is just create a new .net standard library project, and copy the source files to it. then add all the required nuget packages.  if there is a .netstandard version of the package you are good to  go. if there not a .netstandard version of the library, you will need to find a replacement, and make the coding changes. often the standard version is not fully compatible with the old version, and again you must make the required coding changes.

      http://www.lhotka.net/weblog/MigratingFromNETToNETStandard.aspx

    official:

      https://docs.microsoft.com/en-us/dotnet/core/porting/libraries

    note: the official docs say upgrade to 4.7.2 first because they are old, you should upgrade to 4.8 first.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2020 7:48 PM