How should I create a library targetting .NET Framework 4.5.1 and .NET Standard 1.3 in VS 2017 RC?

user1676558

This is my first time trying anything that targets more than just a .NET Framework. I can't seem to do it from the GUI. I've tried project type 'Class Library (Portable)' and project type 'Class Library (.NET Standard)'. I can change a 'Class Library (Portable)' to target .NET Standard but then I can't select anything else. I'm not sure if I should try to change the .csproj of 'Class Library (.NET Standard)' or the project.json of 'Class Library (Portable)', I just want whatever is most future-proof.

user1676558

As of a few days ago the .csproj has been simplified and ease of use has improved. With the latest version of VS 2017 RC, I create such a library by creating a new 'Class Library (.NET Standard)', which has this default .csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard1.4</TargetFramework>
  </PropertyGroup>
</Project>

And I edit it by hand (I don't see a way to do it through the UI) to be this:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>netstandard1.3;net452</TargetFrameworks>
  </PropertyGroup>
</Project>

The 'Target framework' drop down under the project's Properties pane then becomes grayed out. By building you can verify separate netstandard1.3 and net452 folders under bin\Debug. Be aware of the following issue if you're creating a NuGet package on build, which may mislead you into thinking you've done something incorrectly: https://github.com/NuGet/Home/issues/4289.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I change a .NET standard library to a .NET framework library?

How to create .NET Standard NuGet package with minimal dependencies in VS 2017?

How to create an F# library with target framework as .NET Standard 2.0?

How Do You Reference a .NET Standard Library from a .NET Framework 4.5 Console Application in Visual Studio 2017?

How do I uninstall "Microsoft .NET Core 1.0.0 RC2 - VS 2015 Tooling Preview 1"?

Should I use .NET Standard or .NET 5/6/7 class library for creating nuget package?

Which .Net standard version should i use in a library if i have to target both Dot Net Core 3.0 and .Net Framework 4.7.2

Unit testing internal methods in VS2017 .Net Standard library

Create library targeting .Net Framework 4.5 and .Net Standard

How to test .NET Standard 2 library with either NUnit, xUnit or MSTest from either Rider or VS 2017?

How can I check for a response cookie in Asp.net Core MVC (aka Asp.Net 5 RC1)?

VS 2017 RC, F5 doesn't work with project configured for target "framework" (net462): The "RunCommand" property is not defined

Entity Framework in .NET Standard Library

How do I reference Entity Framework 6 from a .NET core class library in RC2?

Visual Studio 2017 won't load .NET Framework references in .NET Standard library

.Net5 vs .Net Core 3 Which one should I choose as a target

.net standard library fails in .net core but not in framework

How to decide .net framework versions to create a library

.NET Core vs standard .NET library performance

How to get rid of additional folder named "netstandardxx" in .NET standard class library project output path in VS2017?

How can I configure what .NET version should be installed by windows installer in VS 2017

How to uninstall MS .NET Core 1.0 RC2 VS 2015 Tooling Preview 1 without the installer?

SignalR not working in ASP .Net 5 RC-1

Can't uninstall .NET 5 RC1

ASP.Net 5 rc1 Localization in Views

Microsoft Asp.Net 5 RC1

Asp.net 5 rc1-final ReflectionTypeLoadException

In .NET Core, why would I decide to create a library that targets .NET Standard rather than .NET Core?

How to install .NET Framework 3.5 SP1 into Visual Studio 2017