What is the difference between .net Core multi target and .net Standard?

.Net Standard is used to can be use the same library in different type of projects, such as WPF, xamarin, UWP... etc.

.Net Core can't by default, but there is the possibility to configure the multi target in .net Core editing the csproj file, so I can set multiple targets. In one test that I have done, if I set as target net47, I can use this .net Core library in my WPF project.

So if I can do the same with .net Core multi target and with .net standard. What are the differences and when to use one and when to use other?

Thanks.

Jon Skeet
people
quotationmark

You would need to target multiple frameworks in the csproj file. In the original launch of Visual Studio 2017 there's no UI for this, but you can do it manually. I believe that there will be UI support for this in an update.

It's just a matter of changing the <TargetFramework> element to <TargetFrameworks> and using a semi-colon-separated list of targets. For example, in Noda Time I have:

<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>

You could have:

<TargetFrameworks>netcoreapp1.0;netstandard1.3</TargetFrameworks>

However, you'd only want to do this if you wanted to take advantage (conditionally) of some features that are only available in .NET Core, and not in .NET Standard.

people

See more on this question at Stackoverflow