Questions tagged [.net-standard-2.0]

766 questions
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
17
votes
4 answers

Why doesn't AutogenerateBindingRedirects work for a Web.config in Visual Studio 2017

I have a reference to a .Net Standard 2.0 library that requires Microsoft.AspNet.WebApi.Client 5.2.4. This has a lot of dependencies that need to be redirected to use newer versions. To avoid package/dependency explosion I've updated the first…
Daniel Leach
  • 5,517
  • 4
  • 18
  • 32
16
votes
2 answers

Can I get a pointer to a Span?

I have a (ReadOnly)Span from which I want to decode a string. Only in .NET Core 2.1 I have the new overload to decode a string from it without needing to copy the bytes: Encoding.GetString(ReadOnlySpan bytes); In .NET Standard 2.0 and…
Ray
  • 7,940
  • 7
  • 58
  • 90
16
votes
2 answers

Reading appsettings.json from .net standard library

i have started a new RESTful project using .NET Core Framework. I divided my solution in two parts: Framework (set of .NET standard libraries) and Web (RESTful project). With Framework folder i provide some of library for furthers web project and…
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
15
votes
0 answers

How can i do DbProviderFactories in .Net Standard 2.0 project as my main Application is framework 4.7.2

I have my main project in Framework 4.7.2 , and this project references a netStandard Library project which is a netstandard 2.0. I need "DbProviderFactories" in the .Net Standard project. like: System.Data.Common.DbProviderFactory fact =…
BeeGees
  • 451
  • 3
  • 10
15
votes
2 answers

Passing IHttpClientFactory to .NET Standard class library

There's a really cool IHttpClientFactory feature in the new ASP.NET Core 2.1 https://www.hanselman.com/blog/HttpClientFactoryForTypedHttpClientInstancesInASPNETCore21.aspx I'm trying to use this feature in my ASP.NET Core 2.1 Preview-2 app but I…
Sam
  • 26,817
  • 58
  • 206
  • 383
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
15
votes
1 answer

Porting Windows Forms to .Net Standard 2.0

Apologies if this is a very naive question. I wrote a Windows Form application using .Net 4.5 sometime ago. Recently, I thought it would be a good idea to port it to a .Net Standard 2.0 application using VS Code. There were a couple of problems with…
user304582
  • 1,910
  • 5
  • 28
  • 49
14
votes
3 answers

Xamarin and .NET Standard 2 Library issue

I've created a cross platform library which has 3 platform specific implementations: Android iOS .NET Standard 2.0 I've packed the library with Nuget in a similar vein as the cross platform library project does it. Now when I create a new Xamarin…
Łukasz Młynik
  • 642
  • 8
  • 24
14
votes
2 answers

Cannot compile simple dynamic code after migration on .netstandard 2.0 (CodeDom throws System.PlatformNotSupportedException)

Trying to compile this sample of code: var c = new CSharpCodeProvider(); var cp = new CompilerParameters(); var className = $"CodeEvaler_{Guid.NewGuid().ToString("N")}"; // doesn't work with or without netstandard reference var netstandard =…
14
votes
1 answer

How to Reference Microsoft.VisualBasic in a .Net Standard Class Library?

I am attempting to utilize some of the static classes in the Microsoft.VisualBasic name space in a .Net Standard 2.0 Class library (the Financial.Rate function specifically.) This is a C# project and the library contains various financial functions…
Luke Bethay
  • 143
  • 2
  • 8
11
votes
3 answers

Building ASP.NET-Core 3.1 with .NET-Standard 2.0 projects leads to conflicting Microsoft.AspNetCore.Mvc.Analyzers assemblies

I'm trying to build an ASP.NET-Core 3.1 (netcoreapp3.1) application which has a dependency on a NuGet library that is .NET-Standard 2.0 which uses MSBuild SDK "Microsoft.NET.Sdk.Razor". This builds and runs fine from Visual Studio (2019) but when I…
Daniel
  • 8,655
  • 5
  • 60
  • 87
11
votes
2 answers

How to set PipeSecurity of NamedPipeServerStream in .NET Core

I'm porting a library from .NET Framework 4.6.1 to .NET Standard 2.0. In Framework, the NamedPipeServerStream constructor could take a PipeSecurity parameter, but that isn't an option in Core. How do you set the security of a NamedPipeServerStream…
uncaged
  • 597
  • 1
  • 5
  • 17
11
votes
3 answers

.NET Standard 2.0 and System.Security.Cryptography.ProtectedData.Protect

I am looking at System.Security.Cryptography.ProtectedData.Protect @ https://learn.microsoft.com/en-gb/dotnet/api/ as we are looking to port a library from .NET Framework 4.7 to .NET Standard 2.0 to be used by .NET Core 2.0. I did a search and it…
Noel
  • 5,037
  • 9
  • 46
  • 69
1
2
3
51 52