.net-standard

Copy files from Nuget package to output directory with MsBuild in .csproj and dotnet pack command

雨燕双飞 提交于 2020-08-22 11:41:40
问题 Last time I had to find out how to extract some files from a Nuget package in took me at least 6 months but I finally managed to find the solution. The thing is that, this solution assumes I have a .nupkg file and manually add a .targets file to perform the extraction process. Now, things are different: I don't have any .nupgk file, we generate one automatically on our VSTS server using the dotnet pack command. Then we consume the package from our Nuget server We can't afford to take another

Copy files from Nuget package to output directory with MsBuild in .csproj and dotnet pack command

孤人 提交于 2020-08-22 11:38:32
问题 Last time I had to find out how to extract some files from a Nuget package in took me at least 6 months but I finally managed to find the solution. The thing is that, this solution assumes I have a .nupkg file and manually add a .targets file to perform the extraction process. Now, things are different: I don't have any .nupgk file, we generate one automatically on our VSTS server using the dotnet pack command. Then we consume the package from our Nuget server We can't afford to take another

Nuget package for just content files

旧时模样 提交于 2020-07-06 12:41:12
问题 I am trying to create a .NET standard nuget package of content files (with no managed assemblies), to be consumed by .NET Framework assemblies. My aim is to get this folder of files copied to the bin folder of the consuming assembly. This question is similar Add native files from NuGet package to project output directory (and uses this nuget package http://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/), but I require my nuget package to be .NET Standard I have added the files in the

Nuget package for just content files

可紊 提交于 2020-07-06 12:41:06
问题 I am trying to create a .NET standard nuget package of content files (with no managed assemblies), to be consumed by .NET Framework assemblies. My aim is to get this folder of files copied to the bin folder of the consuming assembly. This question is similar Add native files from NuGet package to project output directory (and uses this nuget package http://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/), but I require my nuget package to be .NET Standard I have added the files in the

Blazor WebAssembly 3.1 Target Framework is missing

旧城冷巷雨未停 提交于 2020-06-28 07:19:27
问题 I created a .NET Core Web API and class library with .NET Standard 3.1. But when I try to create Blazor WebAssembly with 3.1, it automatically creates a 2.1 version - as seen here: This is my Blazor web and .NET Core 3.1 is not listed. I install the 3.1 version again but still not listing. I already have .NET Core 3.1 version on Web API and class library but I don't understand why I can not create Blazor 3.1. But when can I create blazor server side application as 3.1 but I can't create web

Force project references to be included in netstandard nuget package

六月ゝ 毕业季﹏ 提交于 2020-06-27 07:11:13
问题 I have a netstandard project which includes two project references. Visual studio 2017 is being used to build the nukpg. When the project is built the produced nupkg only contains the assembly produced by that project and lists the two project references as nuget dependencies. Is there a way to force the packaging to include those assemblies as lib files? csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net462</TargetFramework> <RootNamespace>Verifier.Observations

Using config file in .NET Standard does not work

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-12 05:10:36
问题 How can you use a console config file (App.config) in a .NET Standard project. I have one console application with in the App.config: <appSettings> <add key="Test" value="test" /> </appSettings> In my .NET Standard project I added the NuGet package: Install-Package System.Configuration.ConfigurationManager -Version 4.5.0 And have a class that returns the value of that Key: public string Test() { return ConfigurationManager.AppSettings["Test"]; } This is just to test if I could use App.config

Referencing between NetStandard and .Net Framework

人盡茶涼 提交于 2020-06-10 19:08:10
问题 I'm trying to get .Net Framework and NetStandard assemblies to communicate with each other (to learn what is possible). I currently have four projects, two Framework 4.5.2 projects and two NetStandard1.2 projects: Framework452.Library NetStandard12.CentralLibrary NetStandard12.BaseLibrary Framework452.Tests The referencing structure is: Framework452.Tests references NetStandard12.CentralLibrary : working by adding the NetStandard.Library nuget package to Framework452.Tests . NetStandard12

Referencing AspNetCore Library In .Net Standard Target

扶醉桌前 提交于 2020-05-29 03:58:47
问题 I am trying to learn from an N-tier application written by my senior. Target Framework of Data Access and Business layers are .NET Standard 2.0 but inside dependencies of that layers there are libraries from Microsoft.AspNetCore ! How come a .Net Standart target can reference .Net Core libraries ? 回答1: .NET Standard is just a codification of supported APIs, kind of like an interface in code, with .NET Framework/.NET Core/etc. being the implementations of that interface. Just as with using an

How to set dependencies when I use .NET Standard 2.0 DLL libraries with a .NET Framework console application?

夙愿已清 提交于 2020-05-28 12:58:27
问题 I can't figure out how should I set up dependencies (where to add EntityFramework nuget packages) in this scenario: Core.Persistence project which compiles to .NET Standard 2.0 DLL library. I have Entity Framework 6, database entity classes for EF, DbContext etc. It is supposed to depend just on EntityFrameworkCore . Core.Domain project which also compiles to .NET Standard 2.0 DLL library. I want to put my business object POCO classes here. This is supposed to have no dependencies. Core