.net-standard-2.0

Could not load file or assembly error in .Net Standard 2.0 class library

╄→гoц情女王★ 提交于 2019-11-30 01:17:21
问题 I have a .NET Standard 2.0 class library project with installed Nuget package System.Data.SqlClient version 4.4.0 and a Windows Form .NET Framework 4.7 project that has a reference to that class library. Installing the Nuget Package and building the solution is successful. but in runtime every time that the code reaches a method that has any thing from SqlClient assembly inside it (for example an instance from SqlConnection) it gets this error: Could not load file or assembly 'System.Data

The current .NET SDK does not support targeting .NET Standard 2.0 error in Visual Studio 2017 update 15.3

青春壹個敷衍的年華 提交于 2019-11-29 20:47:08
I want to create a class library project with Target Framework .NET Standard 2.0. I've updated my Visual Studio 2017 to Version 15.3 and also in Visual Studio installer checked .NET Framework 4.7 SDK and .NET Framework 4.7 targeting pack manually and installed them. There is still no .NET Standard 2.0 option in the Target Framework combo box in the Project/Application window. So I changed TargetFramework tag in .csproj file manually to netstandard2.0 , but after trying to build I get this error: The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6

Disable transitive project reference in .NET Standard 2

非 Y 不嫁゛ 提交于 2019-11-29 07:38:00
I'm writing an MVC website using ASP.NET Core 2.0. In the ASP.NET Core project (let's call it Web ), I reference a .NET Standard 2 project in the same solution (let's call it Service ). The Service project also references a third .NET Standard 2 library in the solution (let's call this one Business ). The Business project declares a type called Model . The problem is that I can use Model in the Web project (i.e. the compiler sees the type Model and I can do var a = new Model(); ) as if the Web project has referenced Business , but it actually only has a reference to Service . How can I hide

Adding .NET Standard libraries to 4.7.1 lib adds loads of references, some broken

非 Y 不嫁゛ 提交于 2019-11-29 07:03:24
As I need to import a library targeting .NET Standard 2, I had upgraded my library to .NET 4.7.1, as I understood from this MS video that should avoid this issue: https://www.youtube.com/watch?v=u67Eu_IgEMs However, adding .NET standard now results in dozens of System.xxx references, rather than a single reference to .NET Standard (as per the video). Worse still, several of the references have been added but the underlying file appears to be missing generating warnings, e.g. Warning The referenced component 'Microsoft.Win32.Primitives' could not be found. Warning The referenced component

VSTS build: Packages failed to restore - Unable to resolve 'NETStandard.Library (>= 1.6.1)' for '.NETStandard,Version=v2.0'

烂漫一生 提交于 2019-11-28 22:37:23
问题 I'm getting Unable to resolve 'NETStandard.Library (>= 1.6.1)' for '.NETStandard,Version=v2.0'. in VSTS build using Hosted2017 build agent after I upgraded my aspnetcore app to netcoreapp2.0 and my libraries to use netstandard2.0 . Works fine locally. I've edited my build definition to use .net core build task v2.* preview : here is the build log: Current agent version: '2.120.2' Download all required tasks. Downloading task: DotNetCoreCLI Starting: Get Sources Syncing repository: Liero

The current .NET SDK does not support targeting .NET Standard 2.0 error in Visual Studio 2017 update 15.3

◇◆丶佛笑我妖孽 提交于 2019-11-28 17:15:54
问题 I want to create a class library project with Target Framework .NET Standard 2.0. I've updated my Visual Studio 2017 to Version 15.3 and also in Visual Studio installer checked .NET Framework 4.7 SDK and .NET Framework 4.7 targeting pack manually and installed them. There is still no .NET Standard 2.0 option in the Target Framework combo box in the Project/Application window. So I changed TargetFramework tag in .csproj file manually to netstandard2.0 , but after trying to build I get this

Reading appsettings.json from .net standard library

不想你离开。 提交于 2019-11-28 01:16:43
问题 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 into one of these i'd like to provide a Configuration class with the generic method T GetAppSetting<T>(string Key) . My question is: how can i get the access to the AppSettings.json file in .NET Standard? I have found so many example about reading

Adding UWP Background task causes AppManifest errors

我的未来我决定 提交于 2019-11-27 06:18:06
问题 I've been trying to add an out of process background task to my project to update my App's live tile. The task needs to make a database call to get some data, then process that data to send out a few tile notifications. I've managed to get it to work in one project that I created specifically for prototyping the background task functionality. However, when I tried to add a background task to my main project it gives me the following error: Validation error. error 80080204: App manifest