3

I'm creating a nuget package from a class library project I made with Visual Studio 2013. My project has the following file structure:

enter image description here

I generated the nuspec file and left it pretty much unchanged. If I understood the NuGet docs correctly, 'nuget pack Infrastructure.csproj' should result in a package with the following structure:

enter image description here

Only it doesn't. I get this:

enter image description here

If I install this package, test.js doesn't end up in '~/Scripts/Infrastructure/test.js' but in '~/Content/Scripts/Infrastructure/test.js'. What could I be doing wrong? And is there a way to configure this behaviour in the nuspec file?

EPLKleijntjens
  • 916
  • 1
  • 8
  • 21

1 Answers1

2

All you need to do is eliminate your Content folder, in other words put the Scripts folder in the root of the source project.

Doing this will cause the Scripts folder to be installed into the root of the project in which you're installing the Nuget package.

Yann Duran
  • 3,842
  • 1
  • 24
  • 24
  • Thanks, it works! I just assumed the conventions for packaging a working directory applied to packaging a project as well, but I see now that they don't. I do wonder now how to include a .cs file from my project into the package, but that's another question. Thanks again! – EPLKleijntjens May 27 '14 at 12:40
  • 1
    Anything you put in the root of your project (as long as build type is set to "content") will be automatically copied into the project that the package is being installed into, including folders. I'm glad i was able to be of help. – Yann Duran May 27 '14 at 14:18