The System cannot find the file specified

Oct 18, 2011 at 7:05 PM
Edited Oct 18, 2011 at 7:25 PM

i followed the documentation and tried to implement a simple project ( single solution , single assembly) from Sample project approaches. but i get an error message 'The system cannot find the file specified'  at CallNugetPackageCommandLine arguments  in PerformNuGetPack activity. Can you help me out ? Thanks.

Coordinator
Oct 18, 2011 at 8:58 PM

It is hard to say for sure without seeing what you provided in the build definition and how your app is set up but my first guess would be that it is not finding the .nuspec file.   In the build definition, the location should be relative to the solution.  So, if you said "NuGetPackageSupport\MyLibrary.nuspec" then the nuspec file would be in a subdirectory called NuGetPackageSupport inside of the folder containing the .sln file.

If that isn't it could you provide some of the build log?  More specifically, the information provided in the line that contains: "CallNuGetPackageCommandLine arguments:"



Regards,

MarkNic

Oct 19, 2011 at 1:34 PM
Edited Oct 19, 2011 at 2:00 PM



Hi MarkNic,

My app is a simple class library just created to test nugetter and the folder structure for my app is as follows:

ClickOnceSandbox(My Team Project under TFS)-->Dev.Branch(My development branch) -->DemoApp(Solution Folder)-->TFSBuildClassLibrary(Library Project)

Also I created 'NuGetPackageSupport' folder under TFSBuildClassLibrary(project folder) and copied my nuspec file into that folder, and placed NuGet.exe in folder ‘NuGet Exe’

 under ‘Custom Activity Storage’ in source control as mentioned in documentation.

 

below are the build defintion settings

Nugetter (A) - PrePackaging

Invoke PowerShell Script- False

PowerShell Script File Path- (Left blank)


NuGetter (B)- Package
 Additional NuGet Command Line Options- (Left blank)
 Base Path- DemoApp
 NuGet.Exe File Path- (Left blank)
 NuSpec File Path- $/ClickOnceSandbox/Dev.branch/DemoApp/TFSBuildClassLibrary/NuGetPackageSupport/TFSBuildClassLibrary.nuspec
 Output Directory- NuGetPackage
 Version or Version Seed File Path- 1.0.0.0


NuGetter (C)- Push and Publish
 Api Key or File Path- (Left blank)
 Create Only Do Not Publish- True
 Invoke Push Switch- True
 Source(Push Destination)- \\BIGHORN\ITDev\nuget.packages

  Below is my log-

Overall Build Process

 

00:00

Update Build Number

00:00

Create the Drop Location

00:07

Run On Agent (reserved build agent Default Agent - enterprisevault)

00:00

Delete Test Results Directory

00:00

Delete Binaries Directory

00:00

Delete Workspace

00:00

Delete Sources Directory

00:00

Create Workspace

00:00

Get Workspace

00:00

Create LabelLabel NugetterBuild_20111019.1@$/ClickOnceSandbox (version W57_1_enterprisevault;DEWBERRY\ENTTFSBUILD) was successfully created.

 

00:02

Compile, Test, and Associate Changesets and Work Items

00:01

Compile and Test

00:01

Run MSBuild for Project

00:00

Built $/ClickOnceSandbox/Dev.branch/DemoApp/DemoApp.sln for default targets.

00:00

Built $/ClickOnceSandbox/Dev.branch/DemoApp/TFSBuildClassLibrary/TFSBuildClassLibrary.csproj for default targets.MSBuild Log File 

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "e:\workspace\ClickOnceSandbox\NugetterBuild\Sources\Dev.branch\DemoApp\DemoApp.sln" /m:1 /fl /flp:"logfile=e:\workspace\ClickOnceSandbox\NugetterBuild\Sources\Dev.branch\DemoApp\DemoApp.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:OutDir="e:\workspace\ClickOnceSandbox\NugetterBuild\Binaries\DemoApp\\" /p:VCBuildOverride="e:\workspace\ClickOnceSandbox\NugetterBuild\Sources\Dev.branch\DemoApp\DemoApp.sln.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/3017;InformationNodeId=1523645;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://enterprisevault:8080/tfs/Default%20Collection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;"

 

00:00

Associate Changesets and Work ItemsAnalyzing labels NugetterBuild_20111018.21 and NugetterBuild_20111019.1.

 

00:00

Get Impacted Tests, Index Sources and Publish Symbols

00:00

Get Impacted Tests

00:00

Index SourcesC:\Program Files\Microsoft Team Foundation Server 2010\Tools\srctool.exe e:\workspace\ClickOnceSandbox\NugetterBuild\Binaries\DemoApp\TFSBuildClassLibrary.pdb -r

Skipped execution of Revert Workspace because of BuildReason Manual

 

00:00

Copy Files to Drop Location

00:01

Get Package Version

00:01

If NuSpec File Path not provided then no packaging

00:01

Sequence

00:00

Get the file path to the NuSpec file

00:00

Get NuGetterVNuSpecFilePathGetting file from Source: $/ClickOnceSandbox/Dev.branch/DemoApp/TFSBuildClassLibrary/NuGetPackageSupport/TFSBuildClassLibrary.nuspec

 

00:00

Get NuGetterVPackageIdNuGetterVPackageId is $id$

 

00:00

Where is the Package Version Coming From

00:00

Use the value in the version argument

00:00

Is the version argument pointing at a seed file in source control

00:00

SequenceSetting NuGetterVPackageVersionPatternOrFile to 1.0.0.0

 

00:00

Get Version PatternVersion Pattern: 1.0.0.0

 

00:00

Convert Version Pattern

00:00

PerformNuGetPack

00:00

Package NuGet NuPkg File

00:00

SummarizePropertiesPrePackage step will be skipped since the Invoke PowerShell switch was set to False.

NuGet Exe File Path is empty. Will attempt to find NuGet.Exe within the system 'Path'.

Will try to retrieve NuSpec file from source control: $/ClickOnceSandbox/Dev.branch/DemoApp/TFSBuildClassLibrary/NuGetPackageSupport/TFSBuildClassLibrary.nuspec

The following relative BasePath will be used as the file source for packaging: DemoApp

The following Output Directory will be used as the destination for the packaging process: NuGetPackage

The following version number will be used in the packaging process: 1.0.0.0

No additional options were provided for the packaging process.

The Invoke Push switch is set to True. The Push process will be executed.

No API Key was provided.

CreateOnly is set to True. The package will not be published

 

00:00

Validate Parameters

00:00

Initialize

00:00

Assume do not do prepackaging

00:00

Assume we will do packaging

00:00

Should we do PrePackage Step

00:00

If NuSpec File Path not provided then no packaging

00:00

Sequence

00:00

If

00:00

Get the file path to the NuSpec file

00:00

Sequence

00:00

GetFileGetting file from Source: $/ClickOnceSandbox/Dev.branch/DemoApp/TFSBuildClassLibrary/NuGetPackageSupport/TFSBuildClassLibrary.nuspec

 

00:00

If no Output Directory then just use a default

00:00

NuGetterVCreateOnly

00:00

Perform Pre-Package

00:00

PrePackage files for NuGet Processing

00:00

Should we attempt to do PrePackage Step

00:00

Do Packaging?

00:00

Sequence

00:00

If

00:00

Create Output Folder if necessary

00:00

CreateFolder - Use to get BasePath full path

00:00

Call NuGet Package Command LineIn CallNuGetPackageCommandLine:

nuGetExeFilePath:

basePath: \\bighorn\ITDev\nuget.packages\NugetterBuild\NugetterBuild_20111019.1\DemoApp

outputDirectory: \\bighorn\ITDev\nuget.packages\NugetterBuild\NugetterBuild_20111019.1\NuGetPackage

versionNumber: 1.0.0.0

additionalOptions:

CallNuGetPackageCommandLine arguments: pack "e:\workspace\ClickOnceSandbox\NugetterBuild\NuGetPackageSupport\TFSBuildClassLibrary.nuspec" -OutputDirectory "\\bighorn\ITDev\nuget.packages\NugetterBuild\NugetterBuild_20111019.1\NuGetPackage" -BasePath "\\bighorn\ITDev\nuget.packages\NugetterBuild\NugetterBuild_20111019.1\DemoApp" -version 1.0.0.0

The system cannot find the file specified

Please ask me if you need more information. I hope you can find where I am going wrong.

Thanks.

Coordinator
Oct 20, 2011 at 4:06 AM

The issue here was confusion in the documentation.  In this case, the location of the NuGet.exe was not included within the build definition. 

The documentation says in that case it will assume NuGet.exe is "in the Path".  This refers to the machine's Windows environment variable "path" on the build machine - not part of any source code control path. 

So, to demonstrate this: open a command window, type "path" and hit enter - a list of folders will appear. 

When the NuGet.exe location is not in the build definition, then it must exist inside one of the folders listed in the "path" environment variable.  That's how Windows finds applications when you don't include the entire filepath to the application.

I will make note of this and update the docs for the next release.

Thanks for working with me shravanpamani!

Regards,

MarkNic