Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In the TeamCity "NuGet Pack" runner type, how can I avoid that the BasePath option is used?

I'm currently using Teamcity 7.x, and we're not ready to upgrade yet.

For our internal NuGet packages, my specifications are relative to the location of the nuspec file (as per default), but when run in the NuGet Pack runner, they must be relative to the build checkout directory.

For example, I should have a nuspec containing this:

<files>
  <file src="Content\**" target="content" />
</files>

but that won't work in TeamCity as it automatically adds a BasePath option, so I have to change my nuspec to this:

<files>
  <file src="Source\Project\Content\**" target="content" />
</files>

How can this be avoided? I can have my specifications changed, but I have a number of packages created in a single build step, and I'm trying to use the new -IncludeReferencedProjects option, but that fails as it looks in the wrong place.

The BasePath option is not needed, so why does it default to the build checkout directory?

like image 751
Dave Van den Eynde Avatar asked Jan 25 '26 16:01

Dave Van den Eynde


1 Answers

Per the following documentation, step 2, bullet 3: http://confluence.jetbrains.com/display/TCD7/NuGet+Pack

  • Specify base directory, where the files defined in the nuspec file are located (the directory against which the paths in from nuspec are resolved, usually some bin directory). If left blank, TeamCity will use build checkout directory as base directory.

You may try adjusting this setting to the root of your project (theoretically the same location as your nuspec file), rather than the build checkout directory (default).

like image 117
Bo TX Avatar answered Jan 29 '26 02:01

Bo TX



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!