Questions tagged [.net-standard]

The .NET Standard is a formal specification of .NET APIs that are intended to be available on all .NET runtimes. The motivation behind the .NET Standard is establishing greater uniformity in the .NET ecosystem. Consider tagging a more specific version of .NET Standard in your question.

The enables the following key scenarios:

  • Defines uniform set of APIs for all .NET platforms (, , ) to implement
  • Enables developers to produce portable libraries that are usable across .NET runtimes
  • Reduces and hopefully eliminates conditional compilation of shared source due to .NET APIs

Ref:

Related tags

1607 questions
17
votes
2 answers

using .NET Standard 2.1 with UWP

I made the big mistake of taking some NuGet library updates today. It forced me to either roll back a week's worth of work or upgrade to ASP .NET Core 3.0. I hate to use stuff that's not production, but I didn't want to untangle the libraries…
Quark Soup
  • 4,272
  • 3
  • 42
  • 74
17
votes
2 answers

Installing a .NetStandard 2.0 Nuget package into a VS2015 Net 4.6.1 project

I'm trying to install a Nuget package that targets .NetStandard 2.0 (Microsoft.Extensions.Logging.Abstractions) into a Net 4.6.1 project in Visual Studio 2015. However, while Frameworks should be compatible, it doesn't quite work: Install-Package :…
Bogey
  • 4,926
  • 4
  • 32
  • 57
17
votes
1 answer

Add Reference to dll vs. adding a NuGet package in .NET Standard project

I have a .NET Standard 2.0 project in my solution and I am using the IConfiguration interface. When I write the name VS suggest that I reference Microsoft.Extensions.Configuration.Abstractions.dll. If I do it is added under the reference node.…
Stilgar
  • 22,354
  • 14
  • 64
  • 101
17
votes
2 answers

Advantages of netcoreapp2.0 vs netstandard2.0 for a library project

I have a preexisting dotnet 4.6.2 solution that comprises of two outer projects (to be ported at the same time) and a shared core library. I need to choose the core assembly's TargetFramework, which could either be netcoreapp2.0 or netstandard2.0. …
Jon Bates
  • 3,055
  • 2
  • 30
  • 48
17
votes
2 answers

Type does not contain a definition for 'GetProperties'

I am migrating a library project to a .net standard and I am getting the following compilation error when I try to use the System.Reflection API to call Type:GetProperties(): Type does not contain a definition for 'GetProperties' Here it is my…
Miguel Gamboa
  • 8,855
  • 7
  • 47
  • 94
16
votes
2 answers

Can Entity Framework 6 be used in a .NET Standard project?

And if not, will it be? If so, when? I haven't been able to find any clear official information on this, and the limited information I was able to find on Stack Overflow is a year or two old. I was able to find official information saying EF 6.3…
NetherGranite
  • 1,940
  • 1
  • 14
  • 42
16
votes
2 answers

How get a Span view of a struct without the unsafe keyword

How can a Span view (reinterpret cast) be created from a single struct value with no copying, no allocations, and without the unsafe keyword. I can currently only accomplish this using the unsafe keyword: public unsafe Span
zone117x
  • 995
  • 2
  • 10
  • 18
16
votes
2 answers

.NET Core dependency injection backwards compatibility with .NET Framework?

I want to rebuild a .NET Framework library to .NET Core, and then use this library in the .NET Framework app. The library needs a database connectionstring. In .NET Core I would use Dependency Injection to pass the configuration with the…
fantastischIdee
  • 465
  • 2
  • 6
  • 17
16
votes
3 answers

Nuget cannot restore Microsoft.Net.Compilers.1.0.0

I am trying to install/restrore Microsoft.Net.Compilers.1.0.0 in VS 2017 using Nuget Package Manager. In the output it shows restore completed. however when i check the packages folder i dont see Microsoft.Net.Compilers folders. And beacuse of that…
LP13
  • 30,567
  • 53
  • 217
  • 400
16
votes
3 answers

How to distribute a .net core 2.0 console application on osx

I am using Visual Studio for Mac, my application is written, it does what I want. The user's target platform is OSX. It relies on 2 Nuget Packages with their own dependencies, specifically: NetMQ Microsoft.Extensions.Configuration.CommandLine I…
AJ Venturella
  • 4,742
  • 4
  • 33
  • 62
16
votes
4 answers

Is .NET Core an "Implementation" of .NET Standard?

I'm still pretty confused about how .NET Core and .NET Standard relate to each other. From what I understand, .NET Standard is an interface definition (not dissimilar in the way the Katana is an implementation of OWIN). .NET Framework will…
BanksySan
  • 27,362
  • 33
  • 117
  • 216
16
votes
3 answers

How can I change a PCL into a .net Platform Standard Library in Visual Studio 2017?

I am trying to figure out how to change a portable .net class library into a .net platform standard library. There is a clickable link in the project settings that looks right it says "Target .net platform standard". The error which seems absurd to…
Warren P
  • 65,725
  • 40
  • 181
  • 316
15
votes
3 answers

Missing .NET Standard 2.0 Framework with .NET Core SDK 2.2.1 & .NET Framework 4.7.2

I created a .NET Standard Class library which seems to point to 1.6, but when I go to change it to v2.0, I don't see it in the list: Also attached is the latest info from my machine and versions, I have installed both the .NET Core 2.2.1 x64 & x86…
Zoinky
  • 4,083
  • 11
  • 40
  • 78
15
votes
1 answer

How to choose target framework from Nuget package

I'm using a NuGet package which contains the assemblies for 2 target frameworks: net45 and netstandard1.5 My project is targeting net471 (so compatible with netstandard1.5). When I add the package, it copies the dll from net45 folder. How to force…
zgabi
  • 404
  • 1
  • 4
  • 11
15
votes
3 answers

Can't get .NET Standard 2.0 installed

I'm trying to create a .NET Standard 2.0 project, however on the project properties page it only has options up to .NET Standard 1.6. I went to Visual Studio > Tools > Extensions and Updates > Updates > Product Updates and upgraded Visual Studio…
Justin
  • 17,670
  • 38
  • 132
  • 201