Reputation: 2516
I have a nuget package that has .xdt transforms for a app.config file. The xdt files are included in the netstandard 2.0 project that builds the nuget package. Their build action is set to content/do not copy. When I install the package in a .net framework project, the xdt transforms work corectly, but when I install the package in a netstandard 2.0 project, the xdt files do not transform the config file, but instead are added to the project with a build action of C# Compiler. Does nuget not support xdt transforms on netstandard projects?
Upvotes: 0
Views: 658
Reputation: 100581
You are right, xdt transforms aren't supported in PackageReference
environment. This includes both sdk-based projects as well as classic .net framework projects using PackageReference
instead of packages.config
. You can follow this GitHub issue for more details. There is also a sample package that shows how to use build-time logic to apply transforms instead to work in all environments.
Also note that .NET Standard and .NET Core projects don't have an app.config
file that a transform could apply to. This is only relevant for .NET Framework / classic Web Applications. (with maybe an exception for IIS settings for ASP.NET Core apps but they don't affect the app itself, only IIS hosting environment).
Upvotes: 1