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
13
votes
3 answers

How to use System.Configuration.ConfigurationManager in .netstanard library for .net core and .netframework

I am migrating the .netframework 4.7.2 class library to .netstandard 2.0 library. ConfigurationManager is used in the .netframework class library to read the app settings. Any alternative option available for the…
Manu
  • 168
  • 1
  • 1
  • 8
13
votes
2 answers

Migrating .NET Framework 4.6.2 to .NET Standard 2.0

We have a set of class libraries which are created under.NET Framework 4.6.2, we want to move these libraries into .NET Core 2.0 or .NET Standard 2.0 We have the following ways, Create a new project and copy over the code. Convert your existing…
13
votes
2 answers

.NET Standard 2.0 cannot be referenced in .NET Framework 2.0

I received an error: 'c:......\xxxx.csproj' targets '.NETStandard,Version=v2.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v2.0'. WindowsFormsApp1 How to resolve?
mjb
  • 7,649
  • 8
  • 44
  • 60
13
votes
2 answers

Automatically publish a NuGet package built with VS2017

New in Visual Studio 2017 is the ability to generate a NuGet package on build for some target types (namely, .NET Standard 2.0 which is what I'm using). This works great, and the .nupkg file is generated on successful build. However, I'm not able to…
qJake
  • 16,821
  • 17
  • 83
  • 135
13
votes
6 answers

How to "Add Service Reference" in .NET Standard project

I would like to do "Add Service Reference" in .NET Standard project.(Visual Studio 2017) I installed "System.ServiceModel.Http" and "System.ServiceModel.Security" on NuGet in order to make WCF access possible. However, there is no "Add Service…
Peri
  • 253
  • 1
  • 2
  • 12
13
votes
2 answers

Using Microsoft.AspNetCore.All package in netstandard

At the moment I'm porting an asp web api to .Net Core. The api uses a Class library which provides some implementations of the ActionFilterAttribute class. So I have to port this class library as well. When I tried to add the nuget package…
Ced
  • 1,301
  • 11
  • 30
13
votes
1 answer

CPU usage in .net core (at least on Windows)

So PerformanceCounter is gone in dotnet core. I understand it was because it was not Linux-compatible. This comment here: ( What is the story of Performance Counters for .NET Core? ) seems to suggest that if I was willing to run it only on Windows I…
Xavier Peña
  • 7,399
  • 9
  • 57
  • 99
13
votes
2 answers

Project X targets '.NETStandard,Version=v1.6'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.6.1'

I really wanted to be a good citizen... copied all my classes to .net standard 1.6 libraries. Just to find out that my test DLL can't use it. I get the following error Project X targets '.NETStandard,Version=v1.6'. It cannot be referenced by a…
Philippe Lavoie
  • 177
  • 1
  • 7
13
votes
2 answers

Monotouch/WCF: How to consume the wcf service without svcutil

Becuase monotouch compile to native code, so it has some limitation such as dynamic invoke is not allowed. But I have a lot class in .net, that I use the ChannelFactory dynamic to invoke the wcf service: new ChannelFactory(myBinding, myEndpoint);…
BlueSky
  • 747
  • 6
  • 19
12
votes
3 answers

Getting 'TypeError: Failed to fetch' error when trying to call AspNetCore Restful API from Blazor Wasm

I'm getting a 'TypeError: Failed to fetch' error when trying to call my AspNetCore Restful API from Blazor Wasm. I can call it from Postman, and it works fine. My Environment: Microsoft Visual Studio Community 2019 Preview Version 16.6.0 Preview…
12
votes
2 answers

Is it possible to use Entity Framework 6.3.0 in a .NET Standard 2.0 class library?

Is it possible to use Entity Framework 6.3.0 in a .NET Standard 2.0 class library? In Dependencies -> Packages I have a reference to Entity Framework 6.3.0 And I have code like this: using System.Data.Entity; public partial class AlertContext :…
12
votes
2 answers

How to Configure Network Tracing Dotnet core for HttpClient calls?

As per reference document at https://learn.microsoft.com/en-us/dotnet/framework/network-programming/how-to-configure-network-tracing We can setup this in web.config or any other configuration file and we get detailed system.net traces, packets…
12
votes
4 answers

The attribute "Version" in element is unrecognized

I have a solution with many projects that target .net 4.6.1. On our MS build server it builds just fine. I recently added a project that targets .NET Standard 1.3. This will not build on the build server. It builds locally with VS2017 just fine.…
birken25
  • 333
  • 1
  • 2
  • 11
12
votes
1 answer

Microsoft.SqlServer.Types incompatible with .NET Standard

I'm attempting to convert all of our C# class libraries from .NET Framework to .NET Standard projects, as we are starting to leverage .NET Core so need these to be consumable by both .NET Core and .NET Framework apps (with the latter being ported…
Justin
  • 17,670
  • 38
  • 132
  • 201
12
votes
6 answers

I am using .NET Core with C# on Linux, and library *System.Drawing* is missing

Error message Program.cs(1,14): error CS0234: The type or namespace name 'Drawing' does not exist in the namespace 'System' (are you missing an assembly reference? Is it possible to fix that? Or I am not meant to be using this library, if I am…
Daniel
  • 145
  • 1
  • 1
  • 6