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
20
votes
1 answer

How to replace the classes of System.ComponentModel.DataAnnotations for .NET Standard?

.NET Standard did not support 'System.ComponentModel.DataAnnotations', and 'System.Type.Properties', how to keep compatible with it ?
coffeedrunk
  • 203
  • 1
  • 2
  • 5
20
votes
4 answers

Alternatives of CompileToMethod in .Net Standard

I'm now porting some library that uses expressions to .Net Core application and encountered a problem that all my logic is based on LambdaExpression.CompileToMethod which is simply missing in. Here is sample code: public static MethodInfo…
Alex Zhukovskiy
  • 9,565
  • 11
  • 75
  • 151
20
votes
3 answers

Netstandard1.x Nuget packages cannot be installed for netstandard1.x projects

After doing a fresh Windows 10 installation along with latest Visual Studio 2015, netcore, and nuget tooling - I can no longer install Nuget packages to any .netstandard projects. Here's some example output: Restoring packages for…
zone117x
  • 995
  • 2
  • 10
  • 18
19
votes
3 answers

Copy files from Nuget package to output directory with MsBuild in .csproj and dotnet pack command

Last time I had to find out how to extract some files from a Nuget package in took me at least 6 months but I finally managed to find the solution. The thing is that, this solution assumes I have a .nupkg file and manually add a .targets file to…
Jérôme MEVEL
  • 7,031
  • 6
  • 46
  • 78
19
votes
2 answers

Azure Function gives error: System.Drawing is not supported on this platform

(If this question is poorly worded, could someone please help me clear it up?) I have an Azure Function (2.0) which relies on some System.Drawing code. I've added a NuGet reference to System.Drawing.Common (4.5.0). After publishing the app,…
19
votes
3 answers

Referencing a .NET Standard library from a Windows Class Library

There are two projects in my solution currently: a Windows Class Library (targeting .NET Framework 4.6.1) and another class library that targets .NET Standard 1.3. I'm using Visual Studio 2015 Update 3. I've added a reference to the .NET Standard…
Bedford
  • 1,136
  • 2
  • 12
  • 36
19
votes
5 answers

Which .NET versions should be supported by NuGet packages to maximize their availability and functionality?

TL;DR: Given: I wrote a library with relatively portable functionality (for example, Left.Pad.©.dll). I want to make it available though NuGet. Requirement: If somebody wants to use my library on any version of any platform on any version of any…
Athari
  • 33,702
  • 16
  • 105
  • 146
18
votes
1 answer

How to change .NET Framework to .NET Standard/Core in Visual Studio?

I have a solution in C# in Visual Studios. It was first created in .NET Framework. I want to convert the project to .NET Standard/Core. If I go into project --> properties I see the attached screen, where Target Framework is .NET Framework. How am I…
ENV
  • 877
  • 2
  • 10
  • 32
18
votes
1 answer

Reference netstandard 2.0 types in ASP.NET MVC 5 razor views in .NET 4.7.1

.NET 4.7.1 was supposed to solve problems we had in referencing netstandard 2.0 libraries from the full framework. It sort of did, despite some continuing and painful dll conflict warnings and related problems, and the need to manually update to…
Nicholas Petersen
  • 9,104
  • 7
  • 59
  • 69
18
votes
2 answers

How do I target .NET Standard 2.0 in a freshly created .NET Core 2.0 web app?

I've just created a fresh project using dotnet new web. My Google-foo may be failing me, but I didn't find anything relating to my answer (please link to another SO answer, or relevant documentation if I've missed something obvious). If I want to…
Geesh_SO
  • 2,156
  • 5
  • 31
  • 58
18
votes
2 answers

Cannot load a reference assembly for execution from a Web-Site project

Using .NET 4.6.2 and an older Web-Site (not Web-Application) project. If I clear the BIN directory and then build and run it works, but sometimes after multiple builds and runs, it fails with this error. Server Error in '/' Application. Cannot load…
Ian Mercer
  • 38,490
  • 8
  • 97
  • 133
18
votes
4 answers

How can I revert to referencing Nuget packages in packages.config after using Package References in a .NET Standard project?

Background I have several C# code libraries which I recently converted to target .NET Standard 1.4, for use in a Xamarin Forms project as well as many legacy .NET Framework 4.6.1 projects. I initially added Nuget packages to the .NET Standard class…
Cass
  • 870
  • 8
  • 21
18
votes
3 answers

"Error MSB4057 missing target pack" when building .netstandard nuget package

I'm trying to create a .netstandard nuget package following these instructions, using VS2017 RC. It builds fine, but when I try to create the package using msbuild /t:pack /p:Configuration=Release I get an error, that the target pack is not…
Thomas
  • 4,030
  • 4
  • 40
  • 79
18
votes
4 answers

.NET Standard API Reference

UPDATE: So it seems to be an open issue now. So I guess until this is done I will have to rely on .NET Core API reference and pray I won't hit one of the 43 APIs that .NET Framework 4.6.1 doesn't support but are officially supposed to be... Also…
Jérôme MEVEL
  • 7,031
  • 6
  • 46
  • 78
17
votes
3 answers

Cannot Load Assemblies For .Net Standard library (System.Text.Json)

I am writing a .Net Standard 2.0 library that will be used by a binary PowerShell module. The library will be basically an API client with a lot of classes for dealing with the JSON responses. Prior to trying to deserialise the strings, I confirmed…
Ash
  • 3,030
  • 3
  • 15
  • 33