Anyname Donotcare Anyname Donotcare - 10 days ago 6
ASP.NET (C#) Question

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

Answer

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.