Link to the .NET Standard csproj project from the traditional .NET Framework project

I have a library written against .NET Standard 1.3 that should be compatible with the .NET Framework 4.6.1 . The library uses the new csproj and works great when referencing .NET Core projects.

I also have a WPF project on traditional csproj that should be able to use this library. In Visual Studio 2017, I was able to reference the .NET Standard library, and it compiles without errors.

At runtime, it tries to load assemblies, which are dependencies of the .NET Standard project, and assembly not found does not work with errors. And I see that there are no dependencies in my output folder.

Is there a way to link to my library in such a way that all the necessary dependencies are copied to the output folder (or an equivalent solution for the successful completion of the WPF project)?

Note. If I manually reference all the missing dependencies and use the assembly version binding of the assembly, I can make it work, but I should not do this by referring to the project. p>

This is the full project page: https://github.com/UnoSD/PasswordManager

Csproj standard standard

WPF package.config

WPF csproj

Currently Roslyn issue : GitHub issue

+5
source share
2 answers

You must specify compiler output for .NET 4.6.1

Place the line as shown below in your csproj project in your .NET standard library project.

 <TargetFrameworks>netstandard1.4;net461</TargetFrameworks> 

(select <TargetFramework>netstandard1.4</TargetFramework> )

Build will create binaries for both .NET 4.6.1 and the .NET Core environment compatible with NET Standard 1.4.

+2
source

Source: https://habr.com/ru/post/1265182/


All Articles