我创建了一个具有以下转换的Nuget 配置转换文件:
<?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 文件中时会出现问题。它将所有内容连接成一行,而不是干净地间隔,如下所示:
<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>
对于那些使用我的包裹的人来说,这不是很容易阅读。有什么我想念的吗?也许适当的回车?