804 questions
0
votes
0
answers
21
views
Downgraded package reference on build
I have an analyzer (targeting netstandard2.0) relying on Microsoft.CodeAnalysis v 4.12.0, which in turn has reference to System.Memory v 4.6.0. And I have no direct reference to any other version of ...
0
votes
0
answers
8
views
Migrating MDriven solution to .NET Standard 2.0, including WebProviders?
We have an old solution that has one ASP.NET MVC 5 app that targets .NET Framework 4.7.2, and one WinForms app that also targets .NET Framework 4.7.2. The soution has a separate project for the model ...
0
votes
0
answers
35
views
Microsoft Upgrade Assistant Stuck
I am trying to upgrade a class library from ASP.NET 4.8 to .NET Standard 2.0. When I click on Upgrade in VS 2022, I see the output for the Upgrade Assistant below.
Has anyone seen this error? I don't ...
0
votes
0
answers
19
views
Nuget Transitive Dependencies
I think I may have found the answer to my problem but I need confirmation. Basically, I need to override a transitive Nuget dependency that has a vulnerability. I upgraded the transitive dependency's ...
0
votes
0
answers
22
views
edmx files are not getting embedded into the output directory
I have a solution with projects that some / one of them (let's call that PROJECT-A) includes Entity Framework (version 4) with an .edmx file.
This file is not embedded into the output directory in the ...
0
votes
0
answers
27
views
Reactive extension method works in assembly targeting net48 but throws `MissingMethodException` targeting netstandard2.0
I have an extension method defined in a class library (call it My.Extensions.Reactive):
public static class ObservableExtensions
{
/// <summary>
/// Returns a sequence that is generated ...
3
votes
1
answer
104
views
Referencing a .Net Standard 2.0 assembly in a .Net Framework 4.8 projects generates build error
In a .NET Standard 2.0 assembly, I have a function to write to the eventlog:
public static void WriteEventLog(string Source, string Message, EventLogEntryType EvType)
The enum EventLogEntryType is ...
0
votes
0
answers
77
views
"could not connect ssl/tls secure channel" error while using RestSharp in .NetStandard2.0
I am getting "could not connect ssl/tls secure channel" error while trying to call our API from Windows application. The dll used in Windows Application targets .Net framework 4.8 and it ...
0
votes
0
answers
233
views
.NET Standard not working on .NET Framework 4.7.2
I have a .NET Framework 4.7.2 project (console app) for which I've done a NuGet DLL update to a version which they say it depends on .NET 4.8 or .Net Standard. I expected this to work since .Net ...
0
votes
0
answers
16
views
Roslyn ParameterListSyntax puts comma in wrong spot
In my CodeFixProvider I'm adding a new parameter to a constructor, but the formatting isn't working. When the person has each parameter on a line of its own, the new parameter is added but at the ...
0
votes
0
answers
91
views
Why is import clr throwing an exception after pythonnet has been installed?
I am trying to access a .NET DLL from python using pythonnet. The dll contains a library that has been converted to .netStandard2. However, I am getting an error when simply trying to import clr. Can ...
0
votes
0
answers
180
views
Mapperly - must have an implementation part because it has accessibility modifiers
I have a .net framework 4.6.1 Application, and im using few c# libraries which are targeting .net standard 2.0, Im using Mapperly to map my domain to External DTOS.
I am facing an issue when im trying ...
0
votes
1
answer
150
views
How to have IHttpContextAccessor if Microsoft.AspNetCore.Http.Abstractions si deprecated in a netstandard 2.0 project? [duplicate]
I can't find a solution that fit on my project. The project is a netstandard 2.0 project and all the solutions I found are referred to .net projects.
My project uses IHttpContextAccessor to get ...
-1
votes
1
answer
38
views
Looking for a CLI utility that converts dotnet framework assembly to a dotnet standard assembly
I have a set of trivial DotNet framework assemblies ("dlls") that I wish to convert to dotnet stanard 2.0.
By "trivial" I mean that they contain Enum definitions and trivial ...
-2
votes
1
answer
231
views
What are the steps to package and push a .net 2.0 standard library as a nuget package in Azure DevOps build pipeline?
This is what i have so far:
- job: Library
pool:
vmImage: ubuntu-latest
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
command: 'restore'
...
1
vote
1
answer
61
views
How to fix 'notnull type constraint is unavailable' in .NET Standard 2.0 when implementing custom Microsoft.Extensions.Logging.ILogger interface?
I am implementing a custom SQL Server implementation of Microsoft.Extensions.Logging.ILogger. The NuGet package states that it is compatible with .NET Standard 2.0, so I added a class library to my ...
1
vote
0
answers
165
views
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.2.0
I am trying to create a .Net Standard 2.0 library (I am using visual studio 22)
I encountered the following problem while running the project:
Unhandled Exception: System.IO.FileNotFoundException: ...
5
votes
2
answers
139
views
How to iterate over ReadOnlySpan in F#?
You can get Spans via System.Memory to.NET Standard 2.0 compatible libraries.
But how do you do this the most efficiently in F#:
let myRsp = "test1".AsSpan()
let test = Seq.forall (fun x -&...
1
vote
0
answers
68
views
Deserialize Object in .net standard which was serialized in .NET framework
I have a client-server application which runs on .NET Framework v4.8. Now I've migrated parts of the application to .NET Standard 2.0. The .NET Standard parts are used by the client and the server.
...
2
votes
1
answer
4k
views
System.Configuration App.config file with .NET 8.0
I have an old library that used .NET 4.7.2. It uses System.Configuration and an app.config file.
I migrated the library to target framework of .NET Standard 2.0. My unit tests, I migrated to .NET 8.0.
...
-1
votes
1
answer
132
views
Issue while using .NET Standard 2.0 library that uses Store API in WPF .NET Core 8.0 type of project
Hi fellow MSFT developers,
I have created a sample project for your convenience, available at
https://github.com/JiyaDesai-FandCo/WpfAppdotnet8
We have existing code in Library (of type .NET Standard ...
0
votes
0
answers
143
views
Migrate Old ASP.NET Application using EF6 and OWIN to .NET Standard 2.0
We have an old ASP.NET application that uses EF6 and OWIN for authentication. We are currently looking to migrate it to .NET Standard 2.0 => that means we will need to replace EF6 with EF Core so ...
0
votes
1
answer
161
views
Migrate project from .NET Framework 4.5 to .NET Standard 2.0
I've got a .NET Framework 4.5 project and I want to migrate it to .NET Standard 2.0.
When I try to open this project a windows pops up telling me project is targeting .NET Framework 4.5 and it's no ...
1
vote
2
answers
108
views
can't reference netstandard2.0 library if a reference to CodeAnalysis.CSharp is present
Background
Originally I wrote multiple code generators (need netstandard2.0), and wanted to extract common functionalities into a library (also netstandard2.0). However, when trying to reference the ...
0
votes
0
answers
31
views
How do I suppress warnings for dependencies in sourcecode generators?
TL:DR; How do I disable warnings that come through a IncludeAssets="Build" dependency?
I've written a sourcecode generator that includes an external dependency (Scriban). Including ...
0
votes
1
answer
210
views
Wrong version loaded of "System.Servicemodel" when using a service reference
I have a project in Visual Studio that targets "netstandard2.0". I add a service reference (WCF Web Service) and as a result Visual Studio (NuGet) installs for me a package reference, "...
0
votes
0
answers
135
views
Using PdfiumViewer in a .NET standard Assembly
I am trying to split a pdf into seperate images using PdfiumViewer and keep errors saying:
Severity Code Description Project File Line Suppression State
Error CS7069 Reference to type '...
0
votes
1
answer
515
views
The SqlParameterCollection only accepts non-null SqlParameter type objects, not SqlParameter objects
After upgrading some of our class libraries to .NET Standard 2.0, System.Data.SqlClient went away and we now need to use Microsoft.Data.SqlClient in those projects.
However, we are now seeing this ...
0
votes
0
answers
68
views
How to ensure that implementations have a static factory method in older versions of .NET?
Overall, I'm looking for a clean and safe solution to write an interface/abstract class that ensures a private constructor and public static factory method on its implementation(s), in a context where ...
0
votes
0
answers
65
views
How to specify DevTools protocol version in Selenium?
I'm using this Chrome option in my project:
var options = new ChromeOptions();
// Runs Chrome in headless mode, which is very useful for running automated tests.
...
0
votes
0
answers
55
views
How to consume a SOAP api with WCF Service on Xamarin.iOS
I am facing a problem from the past few days : I struggle to understand what I need to implement in my Xamarin client to avoid WCF service proxy code generation on iOS.
From what I've found on https://...
1
vote
1
answer
445
views
Why are unsupported System.Web classes still accessible in .Net Standard?
I am nearing the end of the task of porting a large library project from .Net Framework 4.7.2 to .Net Standard 2.0. This library previously used the System.Web namespace, but since most of that ...
0
votes
1
answer
2k
views
System.ServiceModel.Primitives is simply not being referenced at build time (though corresponding DLL seems to be properly installed)
In a .Net Standard 2.0 project, I am unable to load a reference to System.ServiceModel.Primitives... It says that Primitives doesn't exist on the System.ServiceModel namespace, even though I installed ...
0
votes
1
answer
69
views
unable to create a target path for the nuget package in linux , but its working in Windows
currently I am trying to create a nuget package in linux with the help of nuspec file . below is the content of my nuspec file .
<?xml version="1.0"?>
<package >
<metadata&...
1
vote
1
answer
177
views
How does Visual Studio picks up the current framework?
I started with a net6.0 project. And decided to provide netstandard2.0 as internal nuget output for the older supported builds.
Replaced <TargetFramework>net6.0</TargetFramework> with <...
2
votes
1
answer
2k
views
string.AsSpan() vs implicit cast operator performance in .NET for ReadOnlySpan<char>
Since .NET version something we now have an implicit cast from string -> ReadOnlySpan<char>. This means that if a function accepts a ReadOnlySpan<char>, we can just pass it a string and ...
0
votes
0
answers
488
views
nuget package .dll not copying to bin with msbuild despite dll.refresh file
i'm sure it's me doing something wrong and could do with someone smarter than myself having a look at this.
the problem im having is that MSBuild targeting .NET 4.7.2 fails to copy dll referenced in ...
0
votes
2
answers
783
views
Could not load file or assembly 'netstandard' from FW 4.8 console app
I have an older console app that targets .NET Framework 4.8. It loads a few Nugets that all support .NET Standard 2.0 as well as 2.1. The console app builds just fine but I get this runtime error as ...
0
votes
1
answer
38
views
Migration to netstandard2.0 - CS0246: 'ExportAttribute' could not be found
When I try to migrate to the
<TargetFramework>netstandard2.0</TargetFramework>
I have error
error CS0246: The type or namespace name 'ExportAttribute' could not be found (are you missing a ...
0
votes
1
answer
176
views
Legacy VB .NET Code migration issues to .Net Standard 2.0 with specific VB functions
We have some legacy code in a .NET 4.8.1 Library (assumed migrated from VB.6 written decades ago) that is used by our main Application running on 4.8.1
We plan to move this library to .Net Standard 2....
-1
votes
1
answer
138
views
how to create a firewall rule in .net standard 2.0 which can Support in linux?
Currently we are using NetFwTypeLib COMReference for adding a firewall rule to out application ,but it working only on Windows
public static bool AddRule(Firewall Rule){
INetFwRule ...
0
votes
1
answer
198
views
C# - Options to return multiple error types from method
I currently have to following method written in .NET Standard 2.0
/// <summary>
/// Get all items
/// </summary>
/// <returns>All Items</returns>
/// <exception cref="...
2
votes
1
answer
225
views
Stuck with SHA1 on .NET Standard 2.0
I am making an upgrade from .NET Framework to hopefully .NET.
The thing is that we have a big solution with more than a 100 projects. The idea is that this can go into stages. We could upgrade to .NET ...
0
votes
1
answer
171
views
System.Web.Http fails with not found error when upgrading Microsoft.Azure.Devices sdk version
I'm essentially facing the same issue as here: Can not find system.web.http but this ONLY occurs when I bump up my Microsoft.Azure.Devices version from 1.5.2 to 1.33.0. I have tested this repeatedly ...
0
votes
0
answers
301
views
Challenges Running a .NET Standard 2.0 Test App on Linux and macOS
I'm currently working on creating a test application using .NET Standard 2.0 as the target framework. In my current project, my .csproj file looks like this:
<Project Sdk="Microsoft.NET.Sdk&...
0
votes
1
answer
424
views
How can I use system.web as a configuration section in a asp.net net472 app that uses System.Configuration.ConfigurationManager
I am migrating a large .net framework application to net6. The strategy I am using is to migrate libraries to netstandard2.0 while keeping the net472 runtime until the application is ready to migrate ...
1
vote
1
answer
270
views
Unable to deploy/push to a GitHub the .Net 4.72 ASMX Webservice because of error MSB4019 (Microsoft.WebApplication.targets" was not found)
I have .NET 4.72 ASMX Web Service that references a .Net Standard 2.0 class library with the Entity Framework
I am using Visual Studio 2022
Everything works fine when I work with the code locally. ...
0
votes
0
answers
334
views
Compatibility issues with .NET 4.8, .netstandard2.0 and .NET 6
I created a new application in .NET 6. The real engine is written in .NET 4.8 and I can't change it now, so the layer on .NET 6 that is really call the engine in .NET 4.8 is written in .netstandard2.0....
1
vote
1
answer
1k
views
Binding Redirect from System.Buffers 4.0.2.0 to 4.0.3.0 not working on some machines
Bug description
We are using MessagePack in our .NET Framework 4.8 solution. On some of our customers machines, there is a problem with the serialization, especially the usage of System.Buffers. The ...
0
votes
2
answers
225
views
Runtime libraries are not installed or copied
I have a netstandard 2.0 project that I am trying to add into it a reference to nuget ChilkatDnStandard. The ChilkatDnStandard library depends on ChilkatNativeLib which contains all the native ...