question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Packing a NuSpec file

See original GitHub issue

I’m converting a part of our build which depended on using nuget pack on a nuspec file directly to use dotnet pack. I’ve read a number of threads on this, including dotnet/sdk#5525, and none seem to fit the scenario I have here.

The nupkg I’m trying to build is for the Roslyn compiler tools. This is a collection of projects which are built separately. There is no single project that builds the entire set of binaries that I can attach a <NuspecFile> entry too.

I’ve tried creating a dummy csproj file just to drive the NuSpec file argument but that’s not working:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <NuspecFile>Microsoft.NETCore.Compilers.nuspec</NuspecFile>
  </PropertyGroup>
  <Target Name="Build" />
</Project>

Attempting to run dotnet pack on this project still tries to build the project. That’s a huge step backwards for us. Particularly because there are ~30 nuspec files we need to migrate. Adding 30 new dummy builds is excessive here.

How can I use a nuspec file for a project that has no reasonable build story?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
livarcocccommented, Mar 13, 2018

This has come up before: supporting nuspec directly without a csproj file. I suggest filling an issue on nuget/home for that.

0reactions
livarcocccommented, Mar 13, 2018

This issue was moved to NuGet/Home#6672

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a package using the nuget.exe CLI
Technically speaking, a NuGet package is just a ZIP file that's been renamed with the .nupkg extension and whose contents match certain ...
Read more >
package - nuget pack content files only
Yes. You can create a .nuspec file that simply references the content files. You must use nuget pack MyPackage.nuspec.
Read more >
allow dotnet pack to pack nuspec file without needing a ...
It can be scripted by running dotnet new classlib in an empty folder, then dotnet pack -p:NuspecFile=/path/to/your.nuspec -o /path/to/ ...
Read more >
How To Create NuGet Packages - A Journey In .NET Core
NET equivalent of NPM packages, in that .NET developers can encapsulate entire libraries into a single package file which can be added to...
Read more >
NuGet Pack | TeamCity On-Premises Documentation
The NuGet Pack build runner allows building a NuGet package from a given specification file. If you want to publish this package, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found