我有一个asp.net核心项目,可以使用VS正确构建,但不会在msbuild下构建.
它没有找到所有常见的库(系统等)
我正在使用teamcity,部分构建过程是一个nuget恢复.
我尝试执行与teamcity相同的步骤,但是手动使用msbuild,它失败了,没有找到libs.
我添加了一个dotnet还原步骤然后它工作了.
那么,nuget还原和dotnet还原之间有什么区别?
我们使用TeamCity作为CI服务器,我刚刚开始"TestFixtureSetUp Failed"
在测试失败窗口中看到.
知道如何调试这个问题吗?测试在我的工作站上运行良好(VS2008中的R#test runner).
我正在使用teamcity 8.xx版本.我配置了我的Teamcity以进行持续部署.我需要一个功能分支部署.我看到这个文档" http://confluence.jetbrains.com/display/TCD8/Working+with+Feature+Branches ".
我正在尝试在我的Teamcity上实施此文档.我有个问题.
我的部署配置使用"OctoPack"(nuget).我的nuget包需要构建计数和分支名称.示例:1.0.0.356-feature-1.
我试试这个版本,
%build.number% - %teamcity.build.vcs.branch.VCS_ROOT_ID%----> 1.0.0.356-refs/head/feature-1
这个版本不支持nuget版本控制.nuget不比较"/".
我需要这个,
%build.number% - %teamcity.build.vcs.SHORT_BRANCH_NAME.VCS_ROOT_ID%---> 1.0.0.356-feature-1
我怎么能够 ?
谢谢
我正在尝试设置TeamCity来构建我的项目,但是我的psake buildscript失败了,其原因被缩小到无法找到git可执行文件,这应该是在路径上.当我启动PowerShell并自己执行该操作时,一切正常.
Path环境变量的内容(如"Windows环境变量"对话框中的"系统变量"列表以及注册表中所示HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment\Path
)是
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Git\cmd
Run Code Online (Sandbox Code Playgroud)
但是TeamCity说它的env.Path就是
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Windows\System32\WindowsPowerShell\v1.0
Run Code Online (Sandbox Code Playgroud)
我重新启动了计算机(多次),这无济于事.
为什么TeamCity构建代理的PATH变量与系统默认变量不同,我该如何解决?
teamcity continuous-integration environment-variables psake teamcity-6
我正在尝试设置一个运行自定义命令行脚本的TeamCity构建过程.该脚本使用变量,因此需要百分号(例如%x
).但是TeamCity对其属性使用百分号(例如%build.number%
),因此脚本中的百分号会在运行时被删除.
如果脚本包含以下内容:
for /d %x in ("c:\*") do @echo "%x"
Run Code Online (Sandbox Code Playgroud)
这就是它实际运行的内容:
for /d x in ("\*") do @echo "x"
Run Code Online (Sandbox Code Playgroud)
如何编写我的脚本以便它可以包含变量?
我在Windows 7上安装了构建代理,并始终将代理显示为"已断开连接".日志teamcity-agent.txt显示以下信息
If this is the first time this agent registered on the server make sure it is authorized by administrator in the server web UI.
[2012-09-05 02:56:14,416] INFO - jetbrains.buildServer.AGENT - Agent registration finished.
[2012-09-05 02:56:14,418] INFO - jetbrains.buildServer.AGENT - Stop command was not performed. No build to stop with reason: BuildInterruptReason.AGENT_SHUTDOWN
[2012-09-05 02:56:14,418] INFO - jetbrains.buildServer.AGENT - Starting agent shutdown sequence, reason: Restart agent, failed to download upgrade from server
[2012-09-05 02:56:14,424] INFO - jetbrains.buildServer.AGENT - Host configuration …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的解决方案中的一个Web项目部署到服务器.我在TeamCity上使用msbuild就像这样:
msbuild MySolution.sln /t:WebSite:Rebuild /p:DeployOnBuild=True /p:PublishProfile=Prod ...
Run Code Online (Sandbox Code Playgroud)
但是,当我运行它时,msbuild仍然尝试构建我的WebService
项目,即使我的WebSite
项目不依赖它(但它确实依赖于Services
项目也在解决方案中).如何只发布一个项目,又称公正WebSite
?
我也尝试使用构建项目文件
msbuild WebSite/WebSite.csproj /p:DeployOnBuild=True ...
Run Code Online (Sandbox Code Playgroud)
但它然后抱怨它无法恢复包:
[07:47:17]WebSite\WebSite.csproj.teamcity: Build target: Build
[07:47:17][WebSite\WebSite.csproj.teamcity] RestorePackages
[07:47:17][RestorePackages] Exec
[07:47:17][Exec] C:\TeamCity\buildAgent\work\cab8a3d752df3a51\.nuget\NuGet.targets(90, 15): error MSB4064: The "LogStandardErrorAsError" parameter is not supported by the "Exec" task. Verify the parameter exists on the task, and it is a settable public instance property.
[07:47:17][Exec] C:\TeamCity\buildAgent\work\cab8a3d752df3a51\.nuget\NuGet.targets(89, 9): error MSB4063: The "Exec" task could not be initialized with its input parameters.
[07:47:17][WebSite\WebSite.csproj.teamcity] Project WebSite\WebSite.csproj.teamcity failed. …
Run Code Online (Sandbox Code Playgroud) 我们正在迁移到.NET 4,并且对实现新的按设计合同功能非常感兴趣.
我们知道Code Contract引擎需要安装Code Contract addin
和VS Ultimate或Premium(用于静态检查).
这是我的问题:
我最近开始使用NuGet来管理外部包.现在我只需要它用于NLog.当我在VS 2012中构建项目时,一切正常.但是,我正在尝试将TeamCity作为CI服务器(我对CI很新)并且它给了我以下错误:
[Csc] SomeNamespace\SomeClass.cs(10, 7): error CS0246:
The type or namespace name 'NLog' could not be found
(are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
(在我使用NLog的地方重复此错误)
现在我没有在SVN中包含'packages /'文件夹,因为我认为最好不要包含二进制文件,让TeamCity中的MSBuild自行下载.然而,显然没有这样做.我在SVN中包含'packages.xml'文件.我可以检查什么是出错的?
更新 感谢@DavidBrabant,我被推向了正确的方向.但是,我现在在TeamCity中收到以下错误:
Package restore is disabled by default. To give consent, open the Visual Studio Options dialog,
click on Package Manager node and check 'Allow NuGet to download missing packages during build.'
Run Code Online (Sandbox Code Playgroud)
但是我不是Visual Studio而是TeamCity,所以我不知道如何设置'同意'为真!我试图在NuGet.targets文件中将RestorePackages设置为'true':
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
Run Code Online (Sandbox Code Playgroud)
但这没用.
更新2 为了使其工作,我还设置了以下属性NuGet.targets:
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'true' ">false</RequireRestoreConsent>
Run Code Online (Sandbox Code Playgroud)
这使得构建成功运行!
我有一个VS解决方案,作为TeamCity Build的一部分,我们从私有NuGet提要(myget)和公共提要(nuget.org)恢复包.大多数软件包都可以恢复正常,但它依赖于下面的WebApi和Mono.Security.这都在Visual Studio中本地工作.
[restore] NuGet command: C:\TeamCity\buildAgent\plugins\nuget-agent\bin\JetBrains.TeamCity.NuGetRunner.exe C:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe restore C:\TeamCity\buildAgent\work\953bd084b49f7d88\DataFinch.Web.sln -Source https://www.myget.org/F/datafinch/auth/<hidden>/api/v2 -Source https://api.nuget.org/v3/index.json
[11:41:35][restore] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script473789219385667038.cmd
[11:41:35][restore] in directory: C:\TeamCity\buildAgent\work\953bd084b49f7d88
[11:41:35][restore] JetBrains TeamCity NuGet Runner 8.0.37059.9
[11:41:35][restore] Registered additional extensions from paths: C:\TeamCity\buildAgent\plugins\nuget-agent\bin\plugins-2.8
[11:41:35][restore] Starting NuGet.exe 2.8.50926.602 from C:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe
[11:41:43][restore] Unable to find version '5.2.3' of package 'Microsoft.AspNet.WebApi.Client'.
[11:41:43][restore] Unable to find version '5.2.3' of package 'Microsoft.AspNet.WebApi.Core'.
[11:41:43][restore] Unable to find version '3.2.3.0' of package 'Mono.Security'.
[11:41:43][restore] Unable to find version '6.0.4' of package 'Newtonsoft.Json'.
[11:41:43][restore] Process exited with …
Run Code Online (Sandbox Code Playgroud)