Mardoxx Mardoxx -3 years ago 294
C# Question

Load in netstandard2.0 libraries to net461 project

A quick google says this is possible, but I can't find out how?

I want to play around with SignalR-Core and service fabric. The latest

package is
and targets

The current version of ServiceFabric's libraries
for the other libraries) target
(I think?.. Anyone know how to quickly check what frameworks a nuget package targets?). From what I'm aware
libraries can run on any framework
>= net45
so that shouldn't be a problem.

My service fabric application project targets
and I'm running VS2017 with whatever the latest update is as of today.

When I try and install the package with
install-package Microsoft.AspNetCore.SignalR -pre
it says
install-package : Package Microsoft.AspNetCore.SignalR 1.0.0-alpha1-26359 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.AspNetCore.SignalR 1.0.0-alpha1-26359 supports: netstandard2.0 (.NETStandard,Version=v2.0)

What am I missing here? Is there some csproj trickery I have to do that the powershell script/VS2017 isn't aware of yet? Will this only be a feature when .NET Core 2.0 is released proper?

Answer Source

Using VS2017-Update3 (Preview) made this work fine.

VS2017 15.3 includes support for this.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download