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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

Access SharePoint API using CSOM from .NET Standard

I am trying to create a .NET core console app that can access a Office 365 SharePoint site. I'm use the recommended auth manager from the PnP Framework to try to establish a connection. I followed the ...
Adam's user avatar
  • 4,540
0 votes
0 answers
22 views

Create custom DLL plugins for Unity

I'm creating a custom DLL file for my Unity workflow by create .Net solution in Rider. But I have 2 issues: I want to save all my animation function which I created and used before. All my animation ...
BBQgarden's user avatar
0 votes
1 answer
21 views

Use Winforms Enums in .Net Standard 2.0

I have a solution simplified as follows: MyProject.Models (trying to upgrade from framework 4.7.2 to standard 2.0) MyModel.cs IUIController.cs MyProject.UI (Winforms app, targets framework 4.7.2) ...
Eric Pitz's user avatar
  • 364
0 votes
1 answer
17 views

Resolve the reference of the library inside the NuGet package

.NET Standard 2.0 project uses a NuGet package with Library A v1.9 which references Library B. Library B has both v1.9 and v2.0. When the project is built, it always picks up Library B v1.9. How to ...
Sunny's user avatar
  • 4,765
1 vote
1 answer
75 views

Diagnostic with ID is not supported by the analyzer, but it's in the SupportedDiagnostics property

I have a C# code analyzer base class: using System; using System.Collections.Immutable; using System.Diagnostics; using System.Linq; using CodeQuality.Shared; using Microsoft.CodeAnalysis; using ...
Jeff's user avatar
  • 11
0 votes
0 answers
47 views

What is the update/patch policy on vulnerable Microsoft.AspNetCore package versions?

I have some quite old library code using Microsoft.AspNetCore 2.2.0, which has vulnerability CVE-2019-0548. The library is compiled for targets Netstandard 2.0 and NET 6.0, consumed by NET Framework 4....
Erik Hart's user avatar
  • 1,084
0 votes
1 answer
31 views

Can we upgrade targetframework versions as netstandard and netcoreapp to a .net framework version?

I have projects in a repository with trarget framewrk version as lower .net framework versions(2.0,3.0,3.5..etc). I need to upgrade them to higher framework version(v4.8) due to some security ...
Parashuram's user avatar
1 vote
1 answer
54 views

What's the reason for the weird error message "package is not compatible with netstandard2.0. Package does support netstandard2.0"?

We are getting weird error messages during our build. They don't make any sense, because they are wrong (see MS documentation): Error NU1202: Package XY 1.0.0 is not compatible with net48 (....
ndsvw's user avatar
  • 2,380
0 votes
2 answers
54 views

How can I make a .net standard fully compatible with legacy projects?

I'm trying to develop a .NET 7.0 Console application CustomizedTelegramBot that needs to reference a .NET 4.7 Framework library DataBase. I have added a .NET Standard 2.0 project DataBaseWrapper to ...
Lucio Menci's user avatar
-1 votes
2 answers
108 views

Should I use .NET Standard or .NET 5/6/7 class library for creating nuget package? [closed]

I want to create a nuget package and I want this package to have backward compatibility. Should I use .NET Standard class library or .NET 5/6/7 class library?
Hüseyin ÖZSOY's user avatar
1 vote
1 answer
83 views

How to select specific AppShell-tab programmatically in Xamarin

I have been trying to navigate to the specific tab/page on a button event in the page, using the below lines, however, it doesn't work for me. private void Button_Clicked(object sender, EventArgs e) ...
okd's user avatar
  • 7
0 votes
0 answers
97 views

Is it possible to share common code between .Net6 and .Net Framework Nuget Packages

I develop mostly for .Net Framework 4.6.2. Lately we have decided to start developing for .Net 6. I have my own Nuget Server. I would like to develop a suite of Utilities and publish them to our Nuget ...
Kieran's user avatar
  • 176
0 votes
0 answers
28 views

What is the alternate for HostingEnvironment.ApplicationVirtualPath in Netstandard2.0?

Working on VB class library with .net framework (net462). Now need to be multi-targeted to 'Net462' and NetStandard2.0'. Question. Need an equivalent replacement for HostingEnvironment....
Rishi's user avatar
  • 1
0 votes
1 answer
122 views

Create X509Certificate2 object from client cert and key file in .net standard 2.1

.Net6 has a function X509Certificate2.CreateFromPem. What is the way to use client cert and key.pem file and create X509Certificate2 object in .Net Standard 2.1.
Jitendra's user avatar
  • 5,108
1 vote
0 answers
118 views

Error: Package 'NETStandard.Library.Ref 2.1.0' has a package type 'DotnetPlatform' that is not supported by project '...'

When I try to install NETStandard.Library.Ref from here, I get in Packet Manager console this error: What am I missing?
Ionut's user avatar
  • 714
0 votes
0 answers
48 views

What is the best approach to read from both Web.config and appsettings.json in a .NET Standard library?

We have an old .NET Framework nuget package built with .NET Framework that reads settings from Web.configs files on .NET Framework projects using the ConfigurationManager.AppSettings class. Now, we ...
Danilo Dantas's user avatar
0 votes
1 answer
212 views

Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies

When I debug my MVC app everything is OK, but when I run my published app, I get this error: System.IO.FileNotFoundException Message : Could not load file or assembly 'netstandard, Version=2.1.0.0, ...
Ionut's user avatar
  • 714
0 votes
0 answers
17 views

Does a VS project that targets netstandard2.0 need to install the NetStandard.Library nuget package?

Does a VS project that targets netstandard2.0 need to install the NetStandard.Library nuget package? This MS doc says " The most common way to target netstandard is by referencing this ...
Elroy Flynn's user avatar
  • 2,960
0 votes
0 answers
62 views

.NET Portability analyser tool reports as not compatible for Array.Reverse() API in net standard 2.0

I have created a .NET core 2.0 project and added the below code public static void Main() { int nMonths = DateTimeFormatInfo.CurrentInfo.Calendar.GetMonthsInYear(DateTime.Now.Year); ...
Charan's user avatar
  • 1
1 vote
1 answer
153 views

How can I get service principal properties using Azure SDK for .Net

I need to get application display name by service principal id in UWP C# project. I found sample Getting started on managing service principals using C#, but this sample based on Microsoft.Azure....
Stanislav's user avatar
2 votes
0 answers
109 views

Using SignalR.Client in Unity - The method or operation is not implemented

I want to use SignalR in a UWP project on the HoloLens 2 and my application is partially running (one way works, one not). The way it doesn't work It does not run, when I have HTTPS-Redirection on my ....
Perazim's user avatar
  • 1,482
0 votes
0 answers
176 views

Resolution of Microsoft.Net.Http.Headers assembly version 2.2.0 versus 6.0.0 depends on seemingly unrelated package references

While trying to use HeaderNames.XFrameOptions, I found that it works in one of my projects and fails in another. Both are targeting .NET 6. In my app, I need to work with the X-Frame-Options HTTP ...
Palec's user avatar
  • 12.5k
-1 votes
2 answers
116 views

Creating a project in Visual Studio with Windows Forms and the .NET Framework

I've been trying to create a new project with the layered architecture using layers like: Presentation (Windows Forms Application with .NET Framework), Data (Class Library), Common (Class Library) and ...
Francisco Javier Espinosa Limo's user avatar
0 votes
2 answers
165 views

How to convert a script(Capture Packets and save it to log file) into Window Service?

I want to write a window service for keep capturing the network traffic and save the packets info into a log file, but I can't start it. "Error 1064: An exception occurred in the service when ...
Sam1916's user avatar
1 vote
0 answers
27 views

Apparent Net7 dll Differences using Blazor Wasm with Shared Netstandard Libraries

Good Afternoon, I apologize for the title if it is weird, as I don't really know how to describe this. To describe my project: Project has been fine for months Blazor Wasm project, using Identity ...
fafafooey's user avatar
  • 181
0 votes
0 answers
136 views

Will assembly which targets .netstandard2.0 but runs on .NET 7 get all the performance boost from the latest runtime?

I have a choice for the assembly to target .netstandard2.0 or .net7.0. If I do not need latest features of C#, will it eventually make any performance difference when running my application on .NET ? ...
Pavel Voronin's user avatar
0 votes
0 answers
164 views

Upgrading TargetFramework in multi project C# solution

I will admit up front I have been coding for 20+ years and never really understood the whole dot net standard/core/net567.0 thing. I have a xamarin forms solution with 6 projects in it. There is ...
ThirdPrize's user avatar
0 votes
0 answers
320 views

How to detect if running in IIS, across .NET Framework and .NET Core?

I am trying to update a library of shared code from .NET Framework to .NET Standard. The library has important dependencies on System.Web.Hosting.HostingEnvironment.IsHosted and HostingEnvironment....
Bruce's user avatar
  • 187
1 vote
1 answer
468 views

Get a status code from HttpRequestException with netstandard 2.1

I'm having trouble to get a status code from a HttpRequestException on netstandard 2.1 at the catch block. At the .NET Framework there is an extra property "StatusCode", but I can't find any ...
Häkkebräker's user avatar
0 votes
0 answers
280 views

Could not load file or assembly 'netstandard, Version=2.0.0.0, Cultur e=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies

I have developed a simple class library project under .Net Standard 2.0 Target Framework. Compiled the dll and tried using the library and the method via powershell script, but encountering the below ...
Santhosh's user avatar
0 votes
0 answers
82 views

Visual Studio 2022 - .NET Standard 2.0 - Razor CSHTML File Won't Build

I am trying to create a .NET Standard 2.0 library that will hold CSHTML Razor files for templating. I have tried installing the following libraries: Microsoft.AspNetCore.Components.Web Microsoft....
codeMonkey's user avatar
  • 4,034
0 votes
0 answers
4 views

Suggestion on library run multiple versions

I would like to implement a dll that support older and newer versions of .Net for example implementation of this dll can reference in .net frameworks projects and .Net core projects (all versions) ...
leo's user avatar
  • 411
0 votes
0 answers
18 views

How to add a package in onAfterInstall event?

My application contains both .net framework and .net standard app in the solution while installing the artifacts of this application I am getting an exception Error 1001. Error 1001. An exception ...
Aditya Dalai's user avatar
0 votes
0 answers
112 views

Cannot evaluate. Expression 'System.Data.NameNode' is not an aggregate

I am trying the evaluate an expression using DataTable, But it's throwing the below exception on line var temp = dt.Compute(formula, filter); I have followed this documentation but it didn't help me. ...
Vivek Nuna's user avatar
  • 24.2k
0 votes
1 answer
55 views

Spreadsheet does not exist in the namespace Telerik.Documents even though nuget Telerik.Documents.Spreadsheet.FormatProviders.Xls is installed

Even though I have successfully installed the nuget package Telerik.Documents.Spreadsheet.FormatProviders.Xls, I am receiving the error : CS0234: 'Spreadsheet' does not exist in the namespace Telerik....
Tyson Gibby's user avatar
  • 1,998
4 votes
2 answers
2k views

How to make internals visible to multiple other assemblies in .NET Standard

I have multiple assemblies which include unit tests for a single .NET Standard 2.0 project. To thoroughly test my project I want the internal classes to be visible to both assemblies. Here is the part ...
Timo's user avatar
  • 43
-1 votes
1 answer
470 views

How to get Body and Headers from webhook callback in asp.net c#

How to get webhook request header and body, Body coming fine when using [FromBody]. What class can we use to get both headers and body please check my below code. public class WebhookController : ...
Ajay's user avatar
  • 19
0 votes
0 answers
114 views

How to provide a web view in a class library?

I have a c# class library targeting .NET Standard 2.0. I want to provide a view in my class library so that someone can use and display in their app. Here is the simple use case: someone will use the ...
peakpeaktan's user avatar
0 votes
1 answer
59 views

Fast dynamic invoke between assemblies

Invoker.csproj -> Program.cs namespace InvokeLibrary { public class Invoke { public static void Invoker(Delegate method, params object[] data) { for (int i = 0; ...
Yoav Haik's user avatar
0 votes
1 answer
234 views

Why .NET Standard 2.0 has full support for Span even if MS lists it as unsupported?

I started digging around about spans, and I have found official reference information that it is supported as System.Span<T> since .NET Standard 2.1 here. However, I have Xamarin Application ...
Adam Kaczmarski's user avatar
0 votes
0 answers
49 views

What exactly is missing from MetadataReference.CreateFromFile while loading an assembly?

I have an .NET 6.0 Web app, referencing a class library that targets both netstandard2.0 and net48. I am trying to load the Dapper.Contrib assembly in my class library project. // Here it goes to C:\...
tRuEsAtM's user avatar
  • 3,481
0 votes
1 answer
602 views

X509Certificate2.PrivateKey as RSACryptoServiceProvider returns null in .Net Standards 2.1

I am writing a .Net Standard 2.1 class library that implements some cryptographic logic. I need to create a RSACryptoServiceProvider object from .pfx file to create a signature for my OpenIdConnect ...
Rama's user avatar
  • 187
1 vote
1 answer
467 views

Can you create a NuGet package for just an assembly

Background: I am using Visual Studio 2019 Professional Version 16.11.15, and NuGet Package Manager 5.11. I was provided some 3rd party assemblies to use for my .NET Standard 2.0 class library. These ...
Shandy Sawyer's user avatar
6 votes
1 answer
267 views

Regex match differs between .net versions

I am getting different regex matches when running below sample with .netstandard2.0 and .net6.0 Code var stringToMatch = "sydney bogota berlin tokyo nairobi denver rio"; Console.WriteLine($&...
dhilmathy's user avatar
  • 2,792
1 vote
2 answers
591 views

XmlSerializer exception: You must add a reference to assembly netstandard

I'm working on a solution that has a mixture of the following target frameworks: .Net Framework 4.7.2 .Net 6.0 .Net Standard 2.0 (Note: None of our projects target a Framework version lower than 4.7....
Mike Baxter's user avatar
  • 6,798
0 votes
0 answers
34 views

Creating a Soap server in .NET Standard

I want to create a .NET Standard based SOAP server, but I couldn't find such a library. Is there a .Net Standard based Soap server library you can recommend?
Özgür Utku's user avatar
0 votes
0 answers
36 views

Multi-targeted UWP project can't refer .NET Standard 2.0 project

I have a multi-targeted project (MultiTargetedProj) that targets .NET Standard 2.0 and UWP. This project refers a .NET Standard 2.0 project (SayClassLibraryProj). When building MultiTargetedProj, I ...
Sanjay Subramaniam's user avatar
0 votes
0 answers
255 views

Roslyn generator fails to load referenced assembly present in nuget packages

In my VS 2022 solution I have two projects, a roslyn generator and a console app that I use to test the generator and other stuff. Whenever I try to build the test app I get this warning: CS8784: ...
ctinarelli's user avatar
0 votes
1 answer
530 views

Dotmim.Sync is throwing exception when synchronizing existing SQLite with SQL Server databases

I get a Dotmim.Sync.SyncException when calling the agent.SynchronizeAsync(tables) function: Exception: Seems you are trying another Setup tables that what is stored in your server scope database. ...
Sam's user avatar
  • 59
2 votes
2 answers
470 views

invoking WCF service with custombinding from a .Net standard client

I have a legacy WCF service with custom binding. I want to invoke this service from a .Net Standard 2.0 client. I have added nuget packages system.servicemodel.primitives, system.servicemodel.security ...
Dinesh's user avatar
  • 19

1
2 3 4 5
33