Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet package dll's + content files = fail?

I created a nuget package. I put some files and folders in a "content" folder and it worked great. So I added a bin folder with dll's and put this in my nuspec file :

  <files>
     src="bin\*.dll" target="lib" />
  </files>

dll's are nicely put in the reference, but the content isn't copied anymore.

How can I manage to get them both working ?

@Edit

I know have this:

<file src="content\Controllers\*.*" target="Controllers" />
<file src="content\Views\Account\*.*" target = "Views\Account" />
<file src="bin\*.dll" target="lib" />

The package contains the right structure and files, but the files are not copied into my project.

The files are in a folder structure. When I put them directly into my content folder the are copied to the root of my project ...

like image 892
Nealv Avatar asked May 05 '11 16:05

Nealv


1 Answers

When you define a files section in the nuspec we no longer do "automatic" / "Convention" based package creation. We see it as you are telling us what to include so we don't include things not in the list. Simply add the content folder to that list and it will work.

Edit to include comments from answerer's comment below

The NuSpec file "files" section tell NuGet where to put the files in the package not in sln/proj when it its unpacked. you want to write it like this:

<file src="content\Controllers*.*" target="content\Controllers" /> 
<file src="content\Views\Account*.*" target = "content\Views\Account" /> 
<file src="bin*.dll" target="lib" />
like image 146
Matthew M. Osborn Avatar answered Sep 27 '22 22:09

Matthew M. Osborn