【发布时间】:2011-05-12 18:13:05
【问题描述】:
我正在尝试使用 Team Build 2010 发布网站,但我没有看到任何简单的选项。因此,我尝试创建一个自定义活动,该活动使用我的参数调用代理中的进程(“aspnet_compiler.exe”)并发布我的网站。
我可以删除文件夹、创建文件夹、编译和构建项目......
但是当我调用它时,这个过程并没有在代理上启动......有什么问题?
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
// string text = context.GetValue(this.Text);
Process proc = new Process();
proc.EnableRaisingEvents = true;
proc.StartInfo.WorkingDirectory = @"C:\Windows\Microsoft.NET\Framework\v2.0.50727";
proc.StartInfo.FileName = "aspnet_compiler.exe";
proc.StartInfo.Arguments = "-p "+context.GetValue(this.SourcesDirectory) +
" -v / " + PublishDirectory;
proc.Start();
proc.WaitForExit();
while (!proc.HasExited)
{
}
context.SetValue(Result,proc.StandardOutput.ReadToEnd());
}
还有其他方式来构建/发布网站吗?我的代码有什么问题?
【问题讨论】:
-
我在 aspnet_compiler 上使用 invokeprocess 时遇到了同样的问题。除了 aspnet_compiler 之外,我可以使用 invokeprocess 进行任何工作。这很奇怪。
标签: msbuild web build tfsbuild