Questions tagged [nuget-spec]

NuGet spec is a command on the nuget executable. The command is used to generate a .nuspec file for a new package. This .nuspec file is used in the generation of Nuget packages. It can be used to specify meta data about the package, to define a package's dependencies, and to specify which files should be packaged.

spec command (NuGet CLI)

Applies to: package creation • Supported versions: all

Generates a .nuspec file for a new package. If run in the same folder as a project file (.csproj, .vbproj, .fsproj), spec creates a tokenized .nuspec file. For additional information, see Creating a Package.

Usage

nuget spec [<packageID>] [options]

where <packageID> is an optional package identifier to save in the .nuspec file.

Options

Option | Description

AssemblyPath | Specifies the path to the assembly to use for metadata.

Force | Overwrites any existing .nuspec file.

ForceEnglishOutput | (3.5+) Forces nuget.exe to run using an invariant, English-based culture.

Help | Displays help information for the command.

NonInteractive | Suppresses prompts for user input or confirmations.

Verbosity | Specifies the amount of detail displayed in the output: normal, quiet, detailed (2.5+).

Also see Environment variables

Examples

nuget spec

nuget spec MyPackage

nuget spec -a MyAssembly.dll
226 questions
4
votes
0 answers

Release multiple assemblies in single .net core package

I'm trying to release my library (lz4net) for .NET Core. The library "architecture" differs a little from "normal" as it contains multiple assemblies but only one should be referenced, the other ones are just its dependencies. They are not separate…
Milosz Krajewski
  • 1,160
  • 1
  • 12
  • 19
4
votes
0 answers

Can you create a NuGet package of SSRS Reports?

Is there a way to create a NuGet package of SSRS reports and data sources? I have the following spec, but get the message: Cannot create a package that has no dependencies nor content.
M Kenyon II
  • 4,136
  • 4
  • 46
  • 94
4
votes
1 answer

Can I use multiple wildcards in .nuspec file paths?

I am attempting to collect a series of Razor views into a NuGet package using .nuspec elements. My project structure is non-standard, however, for reasons I won't get into, I cannot change it. Here's my project structure: * Project * Bar …
Derek Hunziker
  • 12,996
  • 4
  • 57
  • 105
4
votes
1 answer

Nuget doesn't install dependencies when 'targetFramework' attribute isn't specified

According to the nuspec reference chapter "Specifying Dependencies in version 2.0 and above", it's possible to declare a dependency in a group element without an additional targetFramework attribute, which implies that this dependency is valid for…
artganify
  • 683
  • 1
  • 8
  • 23
4
votes
0 answers

How to exclude referenced content folder from nuget package

I have three referenced content folders from another project in my .csproj file: Infrastructure\Content\%(RecursiveDir)%(FileName)%(Extension) …
AllOutOfSalt
  • 1,516
  • 3
  • 27
  • 46
4
votes
2 answers

Is there a way to tell nuGet to install a file, into a project, only if the file is not already in the project?

Is there a way to configure a nuGet package so that a file is installed, inside a project, only if it does not already exist in the project? Specifically, my nuGet package contains a custom config file. Once installed, the user will make…
JNT
  • 155
  • 11
3
votes
1 answer

NuGet transitive dependencies and floating notation

According to Microsoft's documentation using floating notation with NuGet PackageReference “resolves to the highest existent version that matches the version description” - NuGet Package Version Reference | Microsoft Docs When you use this approach…
Techromancer
  • 431
  • 4
  • 15
3
votes
1 answer

How to create a nuget package from DLLs after obfuscating them

Hi I have a class Library project I built it DLLs and I apply obfuscation on the DLLs using a software, after that I got new obfuscated DLLs. so now my question is how can I create nuget package just from the obfuscated DLLs ? thank you in advance.
XDev
  • 125
  • 1
  • 8
3
votes
0 answers

Nuget package for UWP Class Library issue

I am trying to package a custom UWP usercontrol into a nuget package. The project builds fine and works when used by a test app with a reference to the control. I generated a .nuspec and I'm packaging the control via an Azure pipeline which then…
3
votes
1 answer

Publishing to NuGet using csProj: How to add Metadata?

I use Azure DevOps to pack and push my project to NuGet. Here I got two options: Use the .csproj - file as information what to push or use a .nuspec What I like about the .csproj - approach is that I don't have to care about dependencies when I…
Ole Albers
  • 8,715
  • 10
  • 73
  • 166
3
votes
2 answers

How to exclude all content files?

With NuGet 4.6.2, how to exclude all content files when creating the package from a project file using PackageReference? I run this command as postbuid event : $(SolutionDir)\.nuget\nuget pack $(ProjectPath) -IncludeReferencedProjects -properties…
Troopers
  • 5,127
  • 1
  • 37
  • 64
3
votes
0 answers

Nuget feed in VSTS "Including description is not supported while including all versions."

I created a nuget feed in my VSTS and I follow the instructions to push a package but I'm getting this error consuming it from Visual Studio: "[CGPE.LogClient3] Failed to retrieve metadata from source …
3
votes
1 answer

Testing my NuGet package, "project cannot be viewed in the object browser" error with package but not with the comprising DLL

I am making a NuGet package which targets .Net Standard 1.3 and .Net Fx 4.5. To do this, I have a solution with my NetStandard version of the code, which is highly tested, and I copy across the two *.cs files to a duplicate project which targets Fx…
Ste Griffiths
  • 318
  • 5
  • 15
3
votes
1 answer

.Net NuGet package conflicts - DLL Hell is back

I have a Visual Studio project. It requires the Newtonsoft.Json library. It is referenced with the NuGet package manager of Visual Studio 2017. Actually the version 10.0.3. This project is referencing the NuGet package LibA and LibB. LibA uses…
Alex 75
  • 2,798
  • 1
  • 31
  • 48
3
votes
1 answer

NuGet Dependency not getting installed

What i want to achieve: We have a C# solution with a bunch of assemblies to be created. I want to create a NuGet package that includes all of the assemblies created by the solution (you could call it a "solution-wide" package). The package should…
Michael Beck
  • 120
  • 1
  • 3
  • 11
1 2
3
15 16