.net-standard

How To Access Azure Function App ConnectionString Using dotnet Standard

旧街凉风 提交于 2019-12-07 06:12:36
问题 My Azure Function App has a ConnectionString defined. I want to retrieve it from a C# function written in dotnet standard 2.0. I have tried adding System.Configuration.ConfigurationManager to the project.json and using var str = ConfigurationManager.ConnectionStrings["my string"].ConnectionString; but I get the error run.csx(24,15): error CS0103: The name 'ConfigurationManager' does not exist in the current context How do I access the connection string? 回答1: ConfigurationManager is not

Missing .NET Standard 2.0 Framework with latest .NET Core SDK 2.2.1, .NET Framework 4.7.2, VS2017 15.9.3

て烟熏妆下的殇ゞ 提交于 2019-12-07 06:04:18
问题 EDIT FIX - Reinstalling VS did not work, reinstalling windows then VS did the trick... we live in 2019 almost and this shit is required to get vs to work properly? I created a .NET Standard Class library which it seems to point to 1.6, when i go to change it to 2.0, I dont see it in the list (see attached image) Also attached is latest info from my machine and versions, I have installed both the .NET Core 2.2.1 x64/x86 SDKs and I have the .NET Full Framework 4.7.2 EDIT 1: how vs was installed

using .NET Standard 2.1 with UWP

谁说我不能喝 提交于 2019-12-07 04:37:42
问题 I made the big mistake of taking some NuGet library updates today. It forced me to either roll back a week's worth of work, or upgrade to ASP .NET Core 3.0. I hate to use stuff that's not production, but I didn't want to untangle the libraries either, so I upgraded. Then it force me to retarget .NET Standard 2.1 libraries. Which I did. My problem now is with the client UWP code. When I try to compile, I get: error : Project '..\ClassLibrary1\ClassLibrary1.csproj' targets 'netstandard2.1'. It

Add build number to package version with `dotnet pack` in VSTS Build process

痞子三分冷 提交于 2019-12-07 04:11:36
问题 With a .NET Framework library you could specify a version with a wildcard and NUGET pack command would append the build date and version automatically when running a NUGET Build Task in VSTS. [assembly: AssemblyVersion("1.0.*")] NUGET PACK would generate a NUPKG file with a version like 1.0.6604.1234 appending the date number and a build ID. NET Standard issues In .NET Core and .NET standard the new .csproj format does not support this wildcard format. We can't package with Nuget.exe (reason:

“Error MSB4057 missing target pack” when building .netstandard nuget package

纵然是瞬间 提交于 2019-12-07 01:06:01
问题 I'm trying to create a .netstandard nuget package following these instructions, using VS2017 RC. It builds fine, but when I try to create the package using msbuild /t:pack /p:Configuration=Release I get an error, that the target pack is not available in my solution: error MSB4057: The target "pack" does not exist in the project. I'm not really sure what to do with this message or where I should be looking to fix it. Any suggestions? 回答1: Thanks to an answer on the MSDN forums I was able to

CPU usage in .net core (at least on Windows)

我是研究僧i 提交于 2019-12-06 20:22:20
问题 So PerformanceCounter is gone in dotnet core. I understand it was because it was not Linux-compatible. This comment here: ( What is the story of Performance Counters for .NET Core? ) seems to suggest that if I was willing to run it only on Windows I could "make use of Windows-specific features", but I don't know how I could integrate that in dotnet core. The reason I am willing to do this workaround is to keep the dotnet core codebase so I don't have to migrate once there is a cross-platform

Type does not contain a definition for 'GetProperties'

蓝咒 提交于 2019-12-06 17:18:06
问题 I am migrating a library project to a .net standard and I am getting the following compilation error when I try to use the System.Reflection API to call Type:GetProperties() : Type does not contain a definition for 'GetProperties' Here it is my project.json : { "version": "1.0.0-*", "buildOptions": { "debugType": "portable" }, "dependencies": {}, "frameworks": { "netstandard1.6": { "dependencies": { "NETStandard.Library": "1.6.0" } } } } What am I missing? 回答1: As of writing this,

How can I change a .NET standard library to a .NET framework library?

偶尔善良 提交于 2019-12-06 16:52:26
问题 I'm writing a class library for a simple parser in C#. When I first created it, I used .NET standard 2.0, but now I need to migrate it to .NET 4.6 both to conform to the other projects in my solution and in order to use NUnit. I tried to follow the instructions in the Microsoft documentation, but when I try to select another framework in the properties, I can only find other .NET standard versions. How can I migrate it? Will I need to manually edit the .csproj file? 回答1: Open up the project

“Could not load file or assembly” error when net462 app references a netstandard1.5 library. But why?

陌路散爱 提交于 2019-12-06 13:58:26
I am trying to figure out what I could be doing wrong in this sample project. I am getting an error when my net462 application references a netstandard1.5 library. The application has a dependency on "System.Collections.Immutable": "1.3.0" , which targets NetStandard 1.0 according to Nuget. The library depends on "NETStandard.Library": "1.6.0" . Am I setting up either of these projects wrong? I would greatly appreciate any insight on this... Here are their project.json : app: { "buildOptions": { "emitEntryPoint": true }, "dependencies": { "SomeLibrary": "1.0.0-*" }, "frameworks": { "net462": {

Microsoft.AspNet.Identity and Microsoft.AspNet.Identity.EntityFramework in .NET Standard 2.0

 ̄綄美尐妖づ 提交于 2019-12-06 12:25:35
Background: The project we are wokring on consists of several solutions that share two libraries . Everything is written in .NET Framework 4.6.1 today. A goal for the project has been to adopt .NET Core for new projects and being able to run web applications in Docker . With the new release of .NET Standard 2.1 and the fact that .NET Framework 4.8 will remain on .NET Standard 2.0 rather than implement .NET Standard 2.1 it felt like the right time to start. Immo Landwerth from Microsoft says this: But what is also true is that the rate of innovation in .NET Framework has to slow down in order