gpt4 book ai didi

visual-studio-2012 - 针对不同环境进行 web.config 转换时出错

转载 作者:行者123 更新时间:2023-12-04 01:21:37 24 4
gpt4 key购买 nike

我试图将我的应用程序部署到不同的环境中,然后我开始遵循以下方法:
Deploying an ASP.NET Web Application to a Hosting Provider using Visual Studio or Visual Web Developer: Web.Config File Transformations - 3 of 12

很完美,直到我点击 预览转换 ,我收到此错误:

Microsoft Visual Studio

Could not load file or assembly 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.



(我只创建了一个转换 Web.DebugQA.config ,当然还有默认的,调试和发布)

我的 Web.DebugQA.config 看起来像这样:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
</system.web>
<appSettings>
<add key="EnvironmentName" value="QADev" xdt:Transform="SetAttributes(value)"
xdt:Locator="Match(key)" />
</appSettings>
</configuration>

但后来我安装了这个插件:

SlowCheetah - XML Transforms

我解决了我的预览转换错误,但是当我尝试使用 QADev 转换发布时,我收到了这个错误:

The "ImportParametersFile" task failed unexpectedly.

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Web.Publishing.Tasks.ImportParametersFile.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



我正在使用 Visual Studio Pro 2012。

最佳答案

我通过从控制面板 --> 程序和功能修复“Microsoft ASP.NET and Web Tools 2013.1 - Visual Studio 2012”解决了这个问题。

路径 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web 中缺少文件 Microsoft.Web.XmlTransform.dll。

关于visual-studio-2012 - 针对不同环境进行 web.config 转换时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14776659/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com