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
3
votes
1 answer

Nuget project.json vs packages.config

Here is an error that I receive in a W10 Universal app. Warning Could not locate C:\Users...\Examplinvi.UniversalApp\packages.config. Ensure that this project has Microsoft.Bcl.Build installed and packages.config is located next to the…
Linvi
  • 2,077
  • 1
  • 14
  • 28
3
votes
0 answers

Nuget 3.3/VS 2015 package causes project to reference dlls but not include content files

I've been working on a Nuget package using the newest version of Nuget (3.3) and I am trying to include content using the new "contentFiles" feature. However, Nuget is completely refusing to copy content files into the destination project…
Pip
  • 4,387
  • 4
  • 23
  • 31
3
votes
1 answer

How should I include MVC related namespaces in a nuget package?

I would like to create a nuget package to import a library of MVC-ish stuff into an MVC project. For example: models enums attributes But I am confused as to how I should be including their namespaces. After creating a new Class Library, I try…
Martin Hansen Lennox
  • 2,837
  • 2
  • 23
  • 64
3
votes
1 answer

Nuget package targeting Win10 both Win8 devices

I have a generated nuget package with a library compiled for W8 and WP8.1: .nuspec:
3
votes
3 answers

NuSpec-generated NuGet file is resolving the wrong version of a dependency - how can I force it to do otherwise?

I have created a NuSpec file for my .NET Project as follows: $id$ $version$ $title$ Author My…
Holf
  • 5,605
  • 3
  • 42
  • 63
3
votes
1 answer

Overriding dependencies in .nuspec

I want to package my project by packing the project file .csproj and not the .nuspec. But I also want to explicitly specify the dependencies. The problem is that when packing the project file (so that I can use the props from my project) the…
mrahhal
  • 3,322
  • 1
  • 22
  • 41
3
votes
0 answers

How do I include contract assemblies in the nupkg automatically?

I just started using nuget to create some packages for an internal library in our company. This library is comprised of many assemblies, and a lot of them have contract reference assemblies generated from Code Contracts. I'm using the most…
julealgon
  • 7,072
  • 3
  • 32
  • 77
3
votes
0 answers

Deciding which referenced assemblies should be added to frameworkAssemblies

I'm currently working on packing the libraries we work with in my team, and I got stuck when it comes to frameworkAssemblies list in the nuspec file. I understand that frameworkAssemblies is only for assemblies installed on GAC. The problems is that…
Peas
  • 313
  • 1
  • 9
3
votes
1 answer

How to create a NuGet package with MSBuild tasks and a targets file

I'm using NuGet 2.8.50506.491. I created a couple of C# projects with custom Microsoft Build tasks and helper functions. There is a targets file. It looks something like this. $id$
bloudraak
  • 5,902
  • 5
  • 37
  • 52
3
votes
1 answer

Folder structure wrong when creating a nuget package from csproj

I'm creating a nuget package from a class library project I made with Visual Studio 2013. My project has the following file structure: I generated the nuspec file and left it pretty much unchanged. If I understood the NuGet docs correctly, 'nuget…
EPLKleijntjens
  • 916
  • 1
  • 8
  • 21
2
votes
1 answer

Nuget Central Package Management - Transitive

We have a huge Visual Studio solution with many projects (SDK style). In order to simplify the update/maintenance we introduced the central package management feature with a Directory.Packages.props file including:
Franz Gsell
  • 1,425
  • 2
  • 13
  • 22
2
votes
1 answer

NuGet Build Not Adding RepositoryUrl Property

I'm having trouble setting the RepositoryUrl tag within my NuGet package. It just doesn't seem to be reflected in the built output and the documentation for where exactly it should go is extremely unclear. Here is my .csproj:
Gerard Wilkinson
  • 1,512
  • 14
  • 33
2
votes
0 answers

nuget package .pp not transform to .cs file

I am creating a NuGet package and I need to include some cs files and hope their namespace can auto transform to the target project's namespace. So I found the document said that I need to use .pp and replace the origin namespace to $rootname$. But…
Nicky Liu
  • 165
  • 2
  • 13
2
votes
1 answer

CPack NuGet native library

I struggle to create a NuGet package from a native C++ library. For now, I have the following setup: include(GNUInstallDirs) file(RELATIVE_PATH relDir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR} …
loics2
  • 616
  • 1
  • 10
  • 24
2
votes
1 answer

Targeting multiple .NET Framework versions in a nuspec file

I have a Visual Studio solution with multiple projects. There is one single csproj for every version of .NET Framework (+ .NET Core) I want to support, and I want to keep it that way. They all generate one DLL each. All DLLs are named the same but…
Helena
  • 1,041
  • 2
  • 12
  • 24