Reference a .NET Core Library in a .NET 4.6 project

后端 未结 5 1097
夕颜
夕颜 2020-11-30 00:11

Maybe I have a miss understanding of what \".NET Core Library\" means, but when I try to add a .NET Core Library in a .NET 4.6 Assembly using Visual Studio 2015, I get the e

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 01:00

    Change your class library (and any dependents) to build against 4.6 as well .NET Core;

    This will now build both versions of the class library for you.

    In your .NET 4.6 project (App) then add a direct reference to the class library's DLL found in the debug folder

    You can now import this namespace, and build against it. Although ReSharper (2016.3 EAP 2) seems to get confused and marks those lines in red - it's a stop gap until later .NET releases.

    If you open up the application project file (.csproj), you'll see the reference added by framework.

    NB: Build code dnx462 doesn't seem to work, complains about .NET framework not being installed, even though the project has a 4.6.2 WPF App.

提交回复
热议问题