Core: app.config not getting transformed after install and uninstall of nuget package

Created on 6 Feb 2019  路  9Comments  路  Source: dotnet/core

Issue Title

app.config not getting transformed after install and uninstall of nuget package

General

I am having sdk project which is published as nuget package. My package name is Printer. This project has two config file App.config.xdt.install and App.config.xdt.uninstall. I want these file should modify the project original App.config who is going to consume this package.

I have another project which is .net framework project where Printer package will get consume. Once Printer get's install the App.config for this project is not getting modified.

Most helpful comment

Is this something that happens with packages.config, but not PackageReference?

Yes, Running the transform is only supported with packages.config. This feature is not available with PackageReference. Both NuGet and Websdk uses the same Xml document transformation technology.

https://www.nuget.org/packages/Microsoft.Web.Xdt/

You can use the Xdt to run your own transforms. This specific issue should go to NuGet/Home

All 9 comments

@nguerrera @dsplaisted do you know where to route this question / bug report? Is it by design?

@nkolev92 @rrelyea I am not familiar with this NuGet feature. Is this something that happens with packages.config, but not PackageReference? Should we move this to NuGet/Home?

cc @vijayrkn as I think there is some support for web.config transforms in web sdk.

Is this something that happens with packages.config, but not PackageReference?

Yes, Running the transform is only supported with packages.config. This feature is not available with PackageReference. Both NuGet and Websdk uses the same Xml document transformation technology.

https://www.nuget.org/packages/Microsoft.Web.Xdt/

You can use the Xdt to run your own transforms. This specific issue should go to NuGet/Home

@vijayrkn ok can I tranform the xml with package reference then? Where can I write the logic to tranform the xml using xdt? considering that NuGet doesn't support the tranformation in package reference. I am using package reference.

Nuget 5.0p3 just shipped support for making build assets transitive.
Using targets, it is possible to do xdt transforms.

May have example if you work with us at nuget/home

OK, closing as dupe of https://github.com/NuGet/Home/issues/5954
If it is incorrect, please file a new issue on NuGet/Home where it seems to belong. Or let me know if I missed something. Thanks!

@rrelyea, is your comment about https://github.com/NuGet/Home/issues/5954 related to capabilities of Nuget 5.0p3 or an alternative solution regardless of 5.0p3?

I have tried to implement https://github.com/NuGet/Home/issues/5954 but the solution provided does not seem to work for our situation and are looking for insight and / or other solutions. Any more info on 5.0p3 that could help us?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Luis-DdlFG picture Luis-DdlFG  路  3Comments

ffes picture ffes  路  3Comments

ugurcemozturk picture ugurcemozturk  路  3Comments

steevcoco picture steevcoco  路  4Comments

mmacneil picture mmacneil  路  3Comments