Files are not attached to my Nuget Package

122 views Asked by At

I wanna create a very simple Nuet package.I just want to add a file(Such as image,Text Files,..) and when i install this test package, the attached files get added into my solution.I did the below steps :

1 : i created a custom Nuget Server (IIS). 2: I used the Nuget.exe command to create the package, create folder and copy the desired files into the folder

> NuGet Pack YourPackageName.nuspec
> mkdir content
> copy ..\src\SomeController.cs content

3: i Copied content Folder" and created package (YourPackageName.nuspec) into my package folder of Local nuget server (IIS Website)

Now, when i connect to local nuget server, i can see the package(YourPackageName.nuspec) and install it on my project BUT the "content" Folder, is not added to my Project.

Can anyone helps me?! What am i supposed to do more?

1

There are 1 answers

0
Dan Liu On BEST ANSWER

In your nuspec file, did you specify something like below:

<file src="..\src\SomeController.cs" target="content\SomeController.cs" />

Please refer to this link http://docs.nuget.org/docs/reference/nuspec-reference for more details, there is a section called "Specifying Files to Include in the Package" that should provide insights.