Questions tagged [.net-standard-2.0]

766 questions
3
votes
1 answer

VS2019: Can't add OpenAPI service reference to .NET Standard class library?

When I try to add an OpenAPI service reference (from a valid .json file) to my .Net Standard 2.0 class library, Visual Studio 2019 throws the following error message at me (message box): "Project needs to be restored before the service reference can…
3
votes
1 answer

.Net Framework 4.7.2 Referencing .Net Standard 2.0 project

My situation: I have a .Net 4.7.2 WinForms application. It references a project that is a .Net Standard class library The .Net Standard library references the Microsoft.SqlServer.SqlManagementObjects NuGet package using a PackageReference When I…
MadSkeletor
  • 161
  • 1
  • 14
3
votes
2 answers

Nullability warning for Task.FromResult

We have the following method in our code base (.NET Standard 2.0 library): public Task GetDefaultTask() { return Task.FromResult(default(T)); } We're currently trying to shift to C# 8.0 Nullability and get a warning in the code…
D.R.
  • 20,268
  • 21
  • 102
  • 205
3
votes
0 answers

F# Type provider FSharp,Data.SqlClient targeting .NetStandard 2.0 fails when using dotNet Build from commandLine but succeeds in Visual Studion 2019

I am using the F# Type Provider FSharp.Data.SqlClient in a DLL targeting .Net-Standard-2.0, while this successfully builds in Visual Studio 2019 it fails when I try to build it using the command prompt compiler dotNet compiler with the following…
Z.M.
  • 39
  • 1
3
votes
1 answer

Using SAS Token with Azure ServiceBus

I am using new Azure ServiceBus SDK which is .NET Standard 2.0 and I am finding it difficult to use SAS Token. Previously, it used to be MessagingFactory but in new SDK it's not there. ServiceBusConnectionStringBuilder has SAS Token but it also…
Amit
  • 191
  • 4
  • 14
3
votes
0 answers

I thought ValueTuple was built-in to .NET Standard 2.0?

I have a .NET Framework 4.7.2 website running with a .NET Standard 2.0 Class Library DLL. I thought I understood ValueTuple and .NET Standard 2.0. Apparently I don't. Here's a ValueTuple defined in a .NET Standard 2.0 DLL. public static…
Robert4Real
  • 1,332
  • 5
  • 21
  • 39
3
votes
1 answer

Referencing .NET Framework DLL from .Net Core 3

I have a .NET Framework library provided by a vendor (CyberSource payment processor - https://github.com/CyberSource/cybersource-sdk-dotnet). This API is being referenced by an ASP.NET Core 3.0 application. Everything compiles fine but when I…
3
votes
1 answer

How does .NET 4.7.2 manage redirects for a dependency compiled in .NET Standard 2.0?

Background I have a large, old, monolithic application that currently targets .NET Framework 4.7.2 and uses several recently-written modules (also targeting net472) with no issues. There is also a recently-written module that targets .NET Standard…
JAF
  • 385
  • 1
  • 2
  • 12
3
votes
2 answers

EndpointIdentity does not contain a definition for CreateUpnIdentity

When converting a class library from .NET Framework 4.6.2 to .NET Standard 2.0 i get this error: "EndpointIdentity does not contain a definition for CreateUpnIdentity". The change that i needed to make is install System.ServiceModel.Primitives. But…
3
votes
0 answers

Google.Apis version doesn't work with newer version of Newtonsoft.Json

I am using Google .net client library version 1.36.1 in a web application in .NET Framework 4.7.2 which works with a Newtonsoft.Json version 10.0.2. I want to include in my web application a class library in .NET Standard 2.0 which uses…
3
votes
1 answer

Create Custom complex Datatypes in OPC UA (UA-.NETStandard)

I am new to the OPC UA world. Can anybody guide my how to create a custom complex type in c# using OPCFoundation/UA-.NETStandard.In my CreateAddressSpace method I want to create a node 'ABC' with custom datatype like Person and Person will have…
Yasir
  • 47
  • 2
3
votes
1 answer

Kusto client failed to send a request to the service: Request headers must contain only ASCII characters

I'm using the following code to generate a connectionstring var kustoUri = $"https://{clusername}.{region}.kusto.windows.net"; var dmKustoUri = $"https://ingest-{clusername}.{region}.kusto.windows.net"; this.engineKustoConnectionStringBuilder = new…
JSC
  • 3,705
  • 3
  • 26
  • 25
3
votes
1 answer

Xamarin forms - Realm accessed from incorrect thread

Maybe I'm missing something really simple out here but gonna ask anyways..... I am using Xamarin forms (.NET Standard project), MVVMLight, Realm DB and ZXing Barcode Scanner. I have a realmobject like so... public class Participant : RealmObject { …
Noel
  • 373
  • 3
  • 15
3
votes
1 answer

Can't access HttpRuntime.Cache in .NET Standard class library

I'm beginning to port our .NET Framework class libraries to .NET Standard 2.0. Right away, I'm running into an issue with not finding an equivalent to: private readonly System.Web.Caching.Cache _cache = HttpRuntime.Cache; I understand that a .NET…
Justin
  • 17,670
  • 38
  • 132
  • 201
3
votes
0 answers

Reference netstandard Nuget Package in 4.7.2 Project Mono

I am trying to reference a .net standard Nuget package in my .Net 4.7.2 Project in Mono. The build works fine in Windows, however under Ubuntu 18.04, I get the following error when using an Attribute from the library. DataClassThing.cs(7, 10):…
Tjaart
  • 3,912
  • 2
  • 37
  • 61