Issue I ran into when using Nuget/SlowCheetah
Cannot add part to the package. Part names cannot be derived from another part name by appending segments to it
Last week I ran into an issue where I was using nuget to package a .csproj file.
What I was after was the contents of the nuget package to contain a Content folder and inside this Content folder have one file called app.config.transform, that’s it.
If my .csproj file contained the following:-
[sourcecode language=”xml”] <PropertyGroup Label="SlowCheetah"><SlowCheetahTargets>..\.shared\SlowCheetah.Transforms.targets</SlowCheetahTargets>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(SlowCheetahTargets)" Condition="Exists(‘$(SlowCheetahTargets)’)" Label="SlowCheetah" />
[/sourcecode]
Then the package contents had a single file called content – which is incorrect.
The way I fixed this was inside the .csproj file I changed the type of the app.config.transform from Content to None. I then changed my .nuspec file to have the following:-
[sourcecode language=”xml”] <files><file src="App.config.transform" target="Content" />
</files>
[/sourcecode]
This fixed my issue with the contents of my nuget package, just incase anyone runs into the same issue.
[…] Issue I ran into when using Nuget/SlowCheetah (Gregor Suttie) […]
Hi Gregor,
I tried the above but I still get the same error. I’m using Slow Cheetah 2.5.14.
What do you see inside you nuget package?
it doesnt create the package in TeamCity and get the below message
[pack] Cannot add part to the package. Part names cannot be derived from another part name by appending segments to it.
[14:22:09][pack] Process exited with code 1
Are you adding lots of files? – how you creating the .nuspec file?