cal5barton
cal5barton

Reputation: 1616

Net Standard Library - Add files to nuget content folder on 'dotnet pack'

Is there an automated way to include a config transform file in the nuget package that is created when using the dotnet pack command?

Upvotes: 1

Views: 1607

Answers (1)

cal5barton
cal5barton

Reputation: 1616

I was able to do this by adding the xdt transform files in the class library project and then editing the csproj file to have this ItemGroup.

 <ItemGroup>
    <Content Include="app.config.uninstall.xdt" />
    <Content Include="app.config.install.xdt" />
  </ItemGroup>

When doing a dotnet pack this automatically adds them to the content folder of the nuget package.

Upvotes: 1

Related Questions