Nuget Config.Transform格式设置问题 [英] Nuget Config.Transform Formatting Issue
问题描述
我已经创建了 Nuget配置转换文件具有以下转换:
I have created a Nuget config transform file that has the following transformation:
<?xml version="1.0">
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IMyService" />
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://mydomain/MySvc/MySvc.svc"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IMyService"
contract="MyNamespace.MyService" name="NetTcpBinding_IMyService">
<identity>
<userPrincipalName value="admin@mydomain.com" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
当它合并到应用程序的app.config或web.config文件中时,会发生问题.与其保持整齐的间隔,不如将所有内容按以下方式合并为一行:
The problem occurs when it merges into an application's app.config or web.config file. Instead of being cleanly spaced it joins everything into one line as follows:
<system.serviceModel><bindings><netTcpBinding><binding name="NetTcpBinding_IMyService" /></netTcpBinding></bindings><client><endpoint address="net.tcp://mydomain/MySvc/MySvc.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IMyService" contract="MyNamespace.MyService" name="NetTcpBinding_IMyService"><identity><userPrincipalName value="admin@mydomain.com" /> </identity></endpoint></client></system.serviceModel>
对于使用我的包裹的人来说,这不是很容易理解.有什么我想念的吗?正确的回车也许吗?
This is not very readable to those consuming my package. Is there something I am missing? Proper carriage returns perhaps?
推荐答案
NuGet的原始Web.config转换中存在格式限制.从v2.6开始,添加了XDT转换,但没有这些限制.有关如何使用的信息,请参见 docs 包中任何XML文件的.install.xdt
和.uninstall.xdt
文件.一旦我开始使用XDT,格式化问题就消失了.
There are formatting limitations in the original Web.config transforms of NuGet. As of v2.6, XDT transforms have been added which don't have these limitations. See the docs on how to use the .install.xdt
and .uninstall.xdt
files for any XML files in your package. Once I started using XDT, formatting issues went away.
这篇关于Nuget Config.Transform格式设置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!