TeamCity构建失败 [英] TeamCity Build Failure
问题描述
我今天已经尝试了很多事情,以使我的构建可以在Teamcity中工作,但无济于事.
I have tried many things today to get my build to work in Teamcity but to no avail.
这是我的设置.
我在TeamCity中有2个构建配置
I have 2 build configurations in TeamCity
-
Build Solution
-
Build Deployment Package Debug
Build Solution
Build Deployment Package Debug
Build Solution
由SVN签入触发,并生成解决方案文件.此配置工作正常.
Build Solution
is triggered by an SVN checkin and builds the solution file. This configuration works fine.
Build Deployment Package Debug
具有Build Solution
作为其依赖项,并且具有两个(MSBuild)构建步骤.该解决方案包含两个网站:一个前端网站和一个管理员网站.一个构建步骤构建前端站点,另一个构建管理站点.最终结果是将合并后的结果放入一个zip文件中,以便部署到部署服务器(我还不了解这一点).
Build Deployment Package Debug
has Build Solution
as its dependency and has two (MSBuild) build steps. The solution contains two websites: a front end one and an admin one. One build step builds the front end site and the other the admin site. The end result is that it puts the combined results into a zip file for deployment to the deployment server (I've not got to this bit yet).
我遇到的问题是Build Deployment Package Debug
配置无法尝试构建第一个站点.这是错误:
The problem that I have is that the Build Deployment Package Debug
configuration fails trying to build the first site. This is the error:
[18:40:25]Step 1/2: Web (MSBuild) (29s)
[18:40:28][Step 1/2] x.Web\x.Web.csproj.teamcity: Build target: Build (27s)
[18:40:50][x.Web\x.Web.csproj.teamcity] MvcBuildViews (4s)
[18:40:50][MvcBuildViews] AspNetCompiler (4s)
[18:40:55][AspNetCompiler] C:\BuildAgent\work\252ec59002ecc2d\x.Web\obj\debug\csautoparameterize\original\web.config(39, 0): error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
[18:40:55][x.Web\x.Web.csproj.teamcity] Project x.Web\x.Web.csproj.teamcity failed.
[18:40:55][Step 1/2] Step Web (MSBuild) failed
这里是构建参数->系统属性
Here are Build Paramters -> System Properties
Name Value
system._PackageTempDir c:\deploypackage
system.Configuration Debug
system.CreatePackageOnPublish True
system.DeployIisAppPath Debug
system.DeployOnBuild True
system.PackageLocation c:\buildshares\Debug\Debug.zip
推荐答案
这就是我要解决的问题
我已经在我的项目文件中有了它
I already had this in my project file
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
但是我也需要添加它
<Target Name="AfterBuild">
<RemoveDir Directories="$(BaseIntermediateOutputPath)" />
</Target>
这样做可以解决问题.
Doing this fixed the issue.
我希望这对将来在TeamCity工作的人有所帮助.
I hope this helps someone else who is working on TeamCity in the future.
这篇关于TeamCity构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!