问题标签 [xdt-transform]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
web-config - 如何 xdt:locator match() 节点的文本?
我想将该InsertIfMissing
函数与节点的text()
. 我尝试了以下方法:
但看起来 xdt 无法识别该text()
功能。
我怎样才能让它工作?
xml - 如何使用 XMLNS 属性转换元素
我正在尝试转换包含xmlns
属性的另一个元素的子元素,但似乎我的转换被忽略,直到我删除xmlns
.
所以假设我有:
我试图摆脱targets
元素:
但这似乎不起作用,但是如果我删除xmlns
并且xmlns:xsi
属性转换按预期工作。
我做错了什么?
.net - 用于查找和替换值的 XML 文档转换
我有一个 xml 文档,其中包含一个 sql 查询。假设它看起来像这样:
当它通过 octopack 运行并部署(通过 octopus deploy)到我的服务器上时,它看起来像这样:
(换行符被转换为

)
在进行此更改以将其转换回来后,我是否可以运行 xml 转换?(或至少删除

)
注意:我的实际查询是一个复杂的合并语句,所以我宁愿不要将它放在多个地方。
asp.net - 如何转换替换 web 配置中的依赖程序集?
因此,当有人将我的 nuget 包添加到他们的代码中时,我试图替换一个dependentAssembly。
我要更改的程序集是:
因此,我使用这个 xml 文件和帮助:Web.config transforms - the missing manual
但我收到错误消息:将转换应用于项目中的“web.config”时发生错误:“blabla”的限定名称无效。
注意到当我将“替换”更改为“删除”时,它正在删除完整的dependentAssembly,但不知何故,它再次将相同的dependentAssembly 添加到 web.config 中。也许是因为在 web.config 转换之后添加了 Common.Logging.Core 依赖项?
也许这就是替换不起作用的原因?
c# - XDT 变换 - 变换变换
我正在创建一个 nuget 包,其中安装包的部分结果是修改我的 web.release.config。
我使用 web.release.config.install.xdt 将元素插入到这个文件中没有问题,但是我需要在我插入的元素上保留 xdt:Transform 和 xdt:Locator 属性,因为这些转换需要在该应用程序是为部署而构建的。
因此,例如在安装 nuget 包时,我想看到:
显示在 web.release.config 中,包括 xdt:Transform 和 xdt:Locator 属性。
是否有可能做到这一点?
xdt-transform - Web.config 部分搜索和替换
我在 C# 应用程序中有 App.config 文件。我想使用 xdt 转换将所有与“.UAT”匹配的键部分替换为“.PROD”。
这是我想要的输出
到目前为止,我已经使用CustomTransform进行了尝试,但它只替换了一个元素而不是所有元素。我怎样才能得到它来替换所有元素
nuget - NuGet 包转换配置转换文件
有没有办法让 NuGet 包转换配置转换文件?例如,当我希望我的 NuGet 包编辑web.config
文件时,我会创建一个web.config.install.xdt
文件。但是,如果我希望我的 NuGet 包编辑web.config.debug
文件怎么办?
我尝试制作一个web.config.debug.install.xdt
文件,但遇到了一个问题:我无法让转换插入本身就是 xdt 转换属性的属性。就像是:
(我尝试更改 xdt 的命名空间,但这也无济于事。)
xml - 用于 c# Windows Store / Metro / win-store 应用程序的 Slowcheetah XML 转换
我已经从扩展库安装了 SlowCheetah,然后从 nuget(然后从 nuget 卸载并重新安装)。
有用 ! 几乎 ;)
那就是它正在转换相关文件并将它们复制到 bin/[nameofconfig eg Debug / Release]/ 文件夹
但是,在本地运行应用程序时,使用的文件是在例如
D:\Projects[项目名称]\bin\Debug\ AppX
并且这个文件仍然是原始的未转换文件。
当我按下 F5 时,最简单的方法是什么, 因为扩展描述声称它应该(对于 win 商店应用程序)。
我猜 .csproj 中的复制文件任务可以解决问题 - 有人成功完成了吗?
c# - 如何在 app.config 上应用 xdt 转换以安装/更新 nuget 包?
我最近更新了我的一个 nuget 包,因此它现在需要一个应用程序设置出现在消费项目中。我想将 app.config 转换添加到包中,以便任何使用我的包的新版本的人都将使用一些默认值填充此应用程序设置。为此,我按照这篇文章创建了 app.config.install.xdt 文件。
我还根据这个 stackoverflow 帖子在我的 nuspec 中添加了一行
但是,当我在消费者中安装/更新这个包时,我没有看到这个应用程序设置出现在消费者的 app.config 中。我还缺少其他步骤吗?
asp.net - Web.config transformation locator condition or xpath not working with multiple attributes
I'm using Microsoft's XDT library to transform my web.config files and discovered that Locator is not working as expected. Using the example below, I would expect that both the attributes are set and the converter node is inserted in all three appenders, but only the attributes are updated in all three. The converter node is only inserted into the first appender. How do I get it to insert into all three log4net appender nodes?
I've tried switching to XPath, but it only throws errors. A working example would be nice, because every example I've followed so far seems to fail with an error.
Test site: https://webconfigtransformationtester.apphb.com/
For example:
Web.config
Web.Debug.config
Results: