Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2010 Web配置转换_Visual Studio 2010_Visual Studio_Command Line_Web Config - Fatal编程技术网

Visual studio 2010 Web配置转换

Visual studio 2010 Web配置转换,visual-studio-2010,visual-studio,command-line,web-config,Visual Studio 2010,Visual Studio,Command Line,Web Config,这里有一种使用独立Web配置转换工具的方法,可以使用Visual Studio的配置管理器用于实现多个部署环境的相同修改。在本例中,我正在将用于部署的连接字符串转换为云平台。(例如,出色的UhuruCloud。) 我需要的是,我试图执行VS配置转换,但不需要一键部署支持。我的云主机提供了一个用于管理部署的插件,因此我无法使用VisualStudio的一键式部署器为您运行它,而不显示它是如何执行的。但是VS可以方便地创建转换文件,所以我想利用它 使用Visual Studio创建转换模板。 1.在

这里有一种使用独立Web配置转换工具的方法,可以使用Visual Studio的配置管理器用于实现多个部署环境的相同修改。在本例中,我正在将用于部署的连接字符串转换为云平台。(例如,出色的UhuruCloud。)

我需要的是,我试图执行VS配置转换,但不需要一键部署支持。我的云主机提供了一个用于管理部署的插件,因此我无法使用VisualStudio的一键式部署器为您运行它,而不显示它是如何执行的。但是VS可以方便地创建转换文件,所以我想利用它

使用Visual Studio创建转换模板。
1.在VS中,选择Build-configurationmanager-New。。。例如,将其命名为UhuruCloud。
2.在解决方案资源管理器中,右键单击Web.Config文件并选择“添加配置转换”
3.编辑转换的结果Web.UhuruCloud.config

使用独立配置转换独立工具。

该工具的语法如下所示:

ctt.exe s:source.config t:transform.config d:destination.config  
ctt.exe s:source.config t:transform.config d:destination.config  
使用独立配置转换独立工具。

该工具的语法如下所示:

ctt.exe s:source.config t:transform.config d:destination.config  
ctt.exe s:source.config t:transform.config d:destination.config  
这只是最基本的用法。分发版中还提供了其他很好的示例。对我来说,有一个快速的批处理脚本使调用更容易是很方便的。尤其是在试图找到正确的路径时

File: ctt_run.bat
@ECHO off
rem ... Use the Config Transform standalone Tool (CTT),  
rem ... from http://ctt.codeplex.com/Wikipage?ProjectName=ctt
rem ... Basic CTT syntax is "ctt.exe s:source.config t:transf.config d:dest.config"
rem ... Set the (S)ource, (T)ransformTemplate, and (D)estination files here.
SET S=C:\tfs-hill\MvcITunes1\MvcITunes1\Web.config
SET T=C:\tfs-hill\MvcITunes1\MvcITunes1\Web.UhuruCloud.config
SET D=Web.New.config
@ECHO on
C:\Common\ctt.exe s:%S% t:%T% d:%D%  
就这样。(我的示例编写转换后的文件Web.New.config。)

我希望这对尝试执行VS Config转换但不需要一键部署支持的人有所帮助。

我想没有人创建了cSharp包装类,以便可以从代码中调用此.exe并返回成功或失败消息?