Questions tagged [.net-standard-2.0]
766 questions
4
votes
1 answer
How to determine if .NET CORE DLL runs in Web server/host or Console App
Title is pretty much it. The DLL that has the logic that differs depending if this is website or some other app type. In the framework we often used HttpContext.Current. We could also retrieve request from it. I looked at different docs, like…

T.S.
- 18,195
- 11
- 58
- 78
4
votes
1 answer
Mixing .net Framework projects with .net Core projects (and languages) - System.IO.FileNotFoundException
I have a solution in which most of the projects are VB.net projects which all target the .NET Framework 4.8. All of those specific projects compile properly and are running in production.
I have added a C# project that targets .net standard 2.0. The…

Dimitri Rodis
- 142
- 1
- 8
4
votes
1 answer
Nuget package not copying native DLLs on build
I'm trying to create a managed library and package it with Nuget. The managed library consumes another DLL written in C and makes the calls through [DllImport] P/Invoke calls. In the root of the project I have a folder structure…

Logan K
- 324
- 2
- 8
4
votes
1 answer
Transient dependencies of .NET Standard 2.0 dll are missing in bin when referenced by .NET 462 project
If a .NET 462 project references a .NET Standard 2.0 dll the dependencies are not copied to the output bin folder.
It works correctly when the .NET Standard 2.0 project is referenced as and…

bobschi
- 325
- 1
- 3
- 13
4
votes
2 answers
Microsoft.Azure.KeyVault.Core doesn't Restore with NETStandard20
I've got a NetStandard20 project Microsoft.Bot.Builder.Azure that pulls in storage dependencies to Azure (CosmosDB, Storage.Common, Blob). I'm on the latest version of each of those dependencies.
No matter what I've tried, I get this warning on…

Chris M.
- 1,731
- 14
- 15
4
votes
2 answers
TFS2017 dotnet build not overriding Version number
I am working with the TFS2017 build process and am having issues with versioning the assemblies. I am using the dotnet build task, command is set to build, Projects is set to **/*.sln and arguments set to --configuration $(BuildConfiguration)…

davefester
- 41
- 4
4
votes
1 answer
Can .NET standard libraries somehow consume nuget packages, which support .NET Framework 4.6.1
I am converting a C# net461 based library to netstandard2. Some of the dependencies of the library support at most net461. Visual Studio shows the following warning for those dependencies:
Warning NU1701 Package 'IKVM v8.1.5717' was restored…

Bahaa
- 1,577
- 18
- 31
4
votes
4 answers
Error: Unable to generate deps.json, it may have been already generated. when adding a Service reference to Xamarin forms
I have a Xamarin forms v3.1 project with the .NET standard approach.
I tried to add a reference to a web service I have using
"add connected service" and then from the pop up, I choose Microsoft web service reference provider.
I add the web service…

a.tolba
- 137
- 1
- 1
- 13
4
votes
3 answers
Azure Functions Not Generating extensions.json
I have an Azure Functions Project with multiple functions, triggered by ServiceBus and BlobStorage.
They have been building and deploying to azure fine for a couple months now.
Something happened recently and they are no longer deploying from my…

Chris
- 4,425
- 5
- 34
- 49
4
votes
1 answer
Solution targeting .NET Core 2.1 builds with old System.ServiceModel.Primitives and System.Private.ServiceModel
I have a solution made up of projects targeting .NET Standard 2.0 and .NET Core 2.1.304. When built this solution utilizes old vulnerable versions of System.ServiceModel.Primitives and System.Private.ServiceModel (CVE-2018-0786).
I am probably…

ahsteele
- 26,243
- 28
- 134
- 248
4
votes
1 answer
How to get total system RAM in .NET Standard 2.0?
As the title says, is there a way to get the total (installed) system RAM in .NET Standard 2.0? All my searches only turn up with .NET Framework solutions.

Jared
- 764
- 7
- 17
4
votes
1 answer
What does the error "argument is value while parameter is declared as in" mean?
In a netstandard 2.0 application, I have the following method that is part of a static class:
public static class Argument
{
/// Inst.
/// Inst name.
///

Kzryzstof
- 7,688
- 10
- 61
- 108
4
votes
1 answer
AddCommandLine not found .netcore 2.1
While i'm trying to invoke AddCommandLine() function on ConfigurationBuilder am getting syntax error that specifying
IConfigurationBuilder doesn't a definition or doesnot contain an extension method AddCommandLine accepting the first argument as…

leox
- 1,315
- 17
- 26
4
votes
1 answer
Using Fluent Api to set foreign key constraint in Entity Framework Core 2.1
We're moving an existing application to .net core 2.1. We currently have a table called ApplicationUser which is referenced by most of the tables in our application because of the audit columns in the tables.
Given the following…

Felix Cen
- 733
- 1
- 6
- 24
4
votes
2 answers
IEnumerable string join in C# .NetStandard 2.0
I'm trying to write a library with .NetStandard 2.0, and apparently there's not an overload for the string.Join method that accepts an IEnumerable. This code works fine in .NetCore 2.0, but not standard:
string.Join('/', parts.Skip(index))

eltiare
- 1,817
- 1
- 20
- 28