开发者

NuGet Pack in Jenkins CI Server

开发者 https://www.devze.com 2023-04-03 12:31 出处:网络
I\'m building a NuGet package in a build step in Jenkins (although Jenkins is probably unrelated). I\'m running NuGet command line like this:

I'm building a NuGet package in a build step in Jenkins (although Jenkins is probably unrelated).

I'm running NuGet command line like this:

NuGet Pack MyProject.csproj

There is also a MyProject.nuspec file in the same folder, I'm using a few variables like $id$, $version$, etc.

My nuspec only has a few files such as this:

<files>
    <file src="..\..\Build\MyProject.dll" target="lib\net40\MyProject.dll" />
    <file src="..\..\Build\MyProject.pdb" target="lib\net40\MyProject.pdb" />
    <file src="..\..\Build\MyProject.XML" target="lib\net40\MyProject.XML" />
</files>

My issue is that when there I inspect the built nupkg contents with 7zip, I notice there are additional files (dlls, pdb, xml, etc.) that happen to be in the Build folder I am pulling my files from.

These files are present from a previous build step, and will eventually be used in other Nu开发者_C百科Get packages (but I don't want them included in this main package).

What would cause NuGet to put extra files in the nupkg?


When you pack from a project file it will include things marked as Content in your project. Also your nuspec file doesn't need to add the xml pdb and dll for that project unless it isn't in the TargetPath (msbuild property).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号