Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File not found when creating a package

This the first time trying to create a Nuget package .

I try to run the following command :

nuget.exe pack Package.nuspec

But i get the following exception :

NuGet.exe : File not found: 'Site1.Master'. At line:1 char:10 + nuget.exe <<<< pack Package.nuspec + CategoryInfo : NotSpecified: (File not found: 'Site1.Master'.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError


The files section in Package.nuspec is like this :

<files>
    <file src="Site1.Master" target="content\Site1.Master" />
    <file src="Site1.Master.cs" target="content\Site1.Master.cs" />
    <file src="Site1.Master.cs.designer" target="content\Site1.Master.cs.designer" />
</files>

My Sample Solution is like this :

enter image description here


The Directory :

enter image description here

like image 898
Anyname Donotcare Avatar asked Nov 28 '16 13:11

Anyname Donotcare


People also ask

How do I run a NuGet package restore to generate this file?

Restore packages manually using Visual Studio Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.


1 Answers

Paths in a .nuspec file are always relative to the location of the .nuspec file itself. Either the file name is wrong, or the directory path is wrong.

like image 158
ste-fu Avatar answered Oct 05 '22 16:10

ste-fu