[英]Adding Nuget Package Transformations from project file
I am trying to add Nuget Package transformations which I want to create from project file. 我正在尝试添加要从项目文件创建的Nuget包转换。
I tried few things like creating a content folder and adding it to my project as explained in https://docs.nuget.org/create/transforming-configuration-files-using-dottransform-files but was not able to add keys to project config files after package installation. 我尝试了一些操作,例如创建内容文件夹并将其添加到我的项目中,如https://docs.nuget.org/create/transforming-configuration-files-using-dottransform-files中所述,但无法为项目添加键软件包安装后的配置文件。
Workaround it to create a folder structure as explained in the above url. 解决该问题,以创建上述网址中说明的文件夹结构。 So I created a folders like content for transform files, lib for dlls/assemblies and it is working.
因此,我创建了一个文件夹,例如用于转换文件的内容,用于dll /程序集的lib,并且该文件夹正在运行。 But I think that this is more manual process.
但是我认为这是更手动的过程。
Is there a way to create nuget package transformations using project file? 有没有一种方法可以使用项目文件创建nuget包转换?
Just add to your root files for transformations like: 只需将其添加到根文件中即可进行转换,例如:
On update NuGet (from 2.6 version) will automatically transform your config files. 更新后,NuGet(2.6版本)将自动转换您的配置文件。 You can even add XSD schema transformations.
您甚至可以添加XSD模式转换。
Do not forget to mark *.transform files as Content and Do not copy in file properties. 不要忘记将* .transform文件标记为“ 内容”,并且不要在文件属性中进行复制 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.