gpt4 book ai didi

MSBUILD 在命令行创建 _PublishedWebsites,但不在 CI 服务器上

转载 作者:行者123 更新时间:2023-12-03 22:10:39 24 4
gpt4 key购买 nike

我在命令行和 CruiseControl.NET 上使用 MSBUILD 时遇到了一些问题,因为结果不同,我不明白为什么会这样。

在我本地机器上的命令行上调用 MSBUILD 时,项目被构建,输出目录包含一堆 DLL 和 PDB 文件以及一个名为 _PublishedWebsites 的子目录,其中包含我的解决方案中的两个 Web 应用程序(一个 ASP.NET MVC 应用程序和一个WCF 网络服务)。

到现在为止还挺好。

在 CI 服务器上,未创建此文件夹。

两者使用的是同一个 msbuild 项目文件,所以我看不出有什么区别。经过几个小时的谷歌搜索,我现在完全不知所措。

我假设我的本地机器上的环境中有一些东西在 CI 服务器上不存在的地方设置了默认值。

是否有任何特定选项我必须在某处设置以明确告诉 MSBUILD 创建一个包含已发布 Web 应用程序的文件夹?

更新 CCNET.config(部分)

<cruisecontrol>
<!-- Other projects here -->
<project name="My-Project Nightly Build">
<workingDirectory>C:\CruiseControl\My-Project-Nightly</workingDirectory>
<artifactDirectory>C:\CruiseControlArtifacts\My-Project-Nightly</artifactDirectory>

<sourcecontrol type="multi">
<sourceControls>
<vsts>
<executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable>
<project>$/Brand Web/</project>
<autoGetSource>true</autoGetSource>
<applyLabel>true</applyLabel>
<cleanCopy>true</cleanCopy>
<deleteWorkspace>true</deleteWorkspace>
<server>http://company-tfs:8080/tfs/Projects</server>
<workingDirectory>C:\CruiseControl\My-Project-Nightly\Brand Web\</workingDirectory>
<workspace>Brand-Nightly</workspace>
</vsts>

<vsts>
<executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable>
<project>$/Brand/Main</project>
<autoGetSource>true</autoGetSource>
<applyLabel>true</applyLabel>
<cleanCopy>false</cleanCopy>
<server>http://company-tfs:8080/tfs/Projects</server>
<workingDirectory>C:\CruiseControl\My-Project-Nightly\Brand\Main</workingDirectory>
<workspace>Brand-Nightly</workspace>
</vsts>
<vsts>
<executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable>
<project>$/Generic</project>
<autoGetSource>true</autoGetSource>
<applyLabel>true</applyLabel>
<cleanCopy>false</cleanCopy>
<server>http://company-tfs:8080/tfs/Projects</server>
<workingDirectory>C:\CruiseControl\My-Project-Nightly\Generic</workingDirectory>
<workspace>Brand-Nightly</workspace>
</vsts>

<vsts>
<project>$/ComponentA</project>
<executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable>
<autoGetSource>true</autoGetSource>
<applyLabel>true</applyLabel>
<cleanCopy>false</cleanCopy>
<server>http://company-tfs:8080/tfs/Projects</server>
<workingDirectory>C:\CruiseControl\My-Project-Nightly\ComponentA</workingDirectory>
<workspace>Brand-Nightly</workspace>
</vsts>

<vsts>
<project>$/Third Party Libraries</project>
<executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable>
<autoGetSource>true</autoGetSource>
<applyLabel>true</applyLabel>
<cleanCopy>false</cleanCopy>
<server>http://company-tfs:8080/tfs/Projects</server>
<workingDirectory>C:\CruiseControl\My-Project-Nightly\Third Party Libraries</workingDirectory>
<workspace>Brand-Nightly</workspace>
</vsts>
</sourceControls>
</sourcecontrol>
<labeller type="defaultlabeller">
<prefix>Brand-</prefix>
</labeller>
<triggers>
<scheduleTrigger time="02:15" buildCondition="ForceBuild" name="BrandNightlyBuild">
</scheduleTrigger>
</triggers>
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<projectFile>C:\CruiseControl\My-Project-Nightly\Brand Web\Main\Build\Nightly.build</projectFile>
<buildArgs>/p:Configuration=Debug /p:Platform=x86 /p:TargetFramework=4.0 /p:OutputPath=C:\CruiseControl\My-Project-Nightly\output\</buildArgs>
<timeout >360000</timeout>
</msbuild>
</tasks>
</project>
</cruisecontrol>

最佳答案

我们是这样做的。我们创建了两个配置文件。

第一个配置文件

<msbuild>
<executable>
C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe
</executable>
<workingDirectory>
Project dorecotry
</workingDirectory>
<projectFile>
Path to second config file
</projectFile>
<timeout>600</timeout>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>

第二个配置文件将发布代码。

第二个配置文件
<Project
xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"
name = "AspNetPreCompile"
DefaultTargets = "PrecompileWeb">
<Target Name = "PrecompileWeb">
<AspNetCompiler
VirtualPath = "DeployTemp"
PhysicalPath = "Path of project file"
TargetPath = "Path of published code"
Force = "true"
Debug = "true"
Updateable = "true"/>
</Target>
</Project>

请查看 blog

关于MSBUILD 在命令行创建 _PublishedWebsites,但不在 CI 服务器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6611405/

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