nuget-package

Unable to add reference to installed NuGet package?

泪湿孤枕 提交于 2020-08-24 06:30:12
问题 I created a NuGet package and I was able to successfully install it in another .NET solution. But I'm not able to add a reference to the NuGet package from the other .NET solution. For example, the NuGet package has a class with a namespace like MyCorp.SecurityApi . I'm currently not able to add a using directive for that namespace in my other .NET solution. For example, using MyCorp.SecurityApi directive returns this compilation error: The type or namespace 'MyCorp' could not be found Any

Reinstall Nuget Package Manager in Visual Studio 2019

☆樱花仙子☆ 提交于 2020-08-19 11:03:10
问题 I am facing a problem with my project. The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference? This has happened before and I solved it by reinstalling the Nuget Package Manager using a command. Unfortunately, I am not finding that command again. I tried to find the solution online but everything I am getting is installing/reinstalling NuGet packages and not package manager. Found this article: https://forums.asp.net/t/1776324.aspx

Error NU5012 - nuget pack unable to find path (/bin/release/MyProject/bin/release)

隐身守侯 提交于 2020-08-03 14:08:17
问题 I'm trying to update my nuget package by running the command nuget pack -properties Configuration=Release but this gives me the following error: Unable to find 'bin/Release/{project-name}/bin/Release'. Mae sure the project has been built I'm not quite sure why it goes to my Release folder and then continues to go down to another Release folder as this doesn't exist? I'm quite lost here, and I'm not sure what to do. 回答1: TL;DR For the new <Project Sdk="Microsoft.NET.Sdk"> .csproj file format,

Build NuGet package on Linux that targets .NET Framework

老子叫甜甜 提交于 2020-07-31 07:02:07
问题 I want to create a NuGet package that can simultaneously and explicitly target both .NET Framework 4.6.2 and .Net Standard 1.5. Here's an abbreviated .csproj file from VS 2017: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>net462;netstandard1.5</TargetFrameworks> ... </PropertyGroup> </Project> When I execute the dotnet build and pack commands from my local Windows machine, the NuGet package is created perfectly well as expected. However , when I attempt to execute the

How to solve NuGet.targets(124,5): error : Value cannot be > null. (Parameter 'folderName') error?

久未见 提交于 2020-07-16 05:46:40
问题 On building the project I am getting this error. Error NETSDK1004 Assets file 'J:\Test\core\fx-core\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. FxCore C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234 So to solve this I am running the command dotnet restore in package manager console. But on running I'm getting the below error. PM> dotnet restore J:\Test\core\fx-core\FxCore.csproj(3,3

How to solve NuGet.targets(124,5): error : Value cannot be > null. (Parameter 'folderName') error?

无人久伴 提交于 2020-07-16 05:46:12
问题 On building the project I am getting this error. Error NETSDK1004 Assets file 'J:\Test\core\fx-core\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. FxCore C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234 So to solve this I am running the command dotnet restore in package manager console. But on running I'm getting the below error. PM> dotnet restore J:\Test\core\fx-core\FxCore.csproj(3,3

How to override nuget dependencies id in nuspec file

被刻印的时光 ゝ 提交于 2020-07-10 10:27:26
问题 I have projectA and projectB in the same solution. projectA creates its own package, but I override the package id by using a prefix: <PackageIdPrefix></PackageIdPrefix> <PackageId>$(PackageIdPrefix)$(MSBuildProjectName)</PackageId> The command to generate the package is : dotnet pack .\$(ProjectName).csproj --include-symbols --no-build -o C:\dev\UPP\Packages -p:PackageIdPrefix=MyPrefix." Therefore the generated package name is MyPrefix.ProjectA.nupkg projectB references projectA as a project

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

Restore NuGet Package in TeamCity Build and Deploy Step

♀尐吖头ヾ 提交于 2020-06-18 17:18:39
问题 My Build and Deploy step in TeamCity is not successfully executed. It is showing "This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props." Below is the step process log: [Step 1/1] WebApplication2.sln.teamcity: Build target: TeamCity_Generated_Build [22:31:54]

Restore NuGet Package in TeamCity Build and Deploy Step

丶灬走出姿态 提交于 2020-06-18 17:17:41
问题 My Build and Deploy step in TeamCity is not successfully executed. It is showing "This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props." Below is the step process log: [Step 1/1] WebApplication2.sln.teamcity: Build target: TeamCity_Generated_Build [22:31:54]