2012-11-01 58 views
3

我有一個包含asp.net C#項目,4.0框架的VS 2010解決方案。我們使用Teamcity 7.1.1(構建24074)作爲CI和部署服務器。Teamcity:VS 2010解決方案轉換爲VS 2012後無法部署解決方案

我們升級到Visual Studio 2012並轉換此解決方案,並且在生成服務器上安裝了Microsoft Visual Studio 2012 Shell (Integrated) Redistributable Package,以便生成包括[...] \ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ web應用\ Microsoft.WebApplication.targets。

轉換到2012年後,我注意到部署不再工作,工件沒有創建(但Teamcity也不抱怨!)。我只得到這對構建日誌:

[...] 
[17:11:58][Providers\Providers.csproj.teamcity] GetCopyToOutputDirectoryItems 
[17:11:58][Providers\Providers.csproj.teamcity] _CopyOutOfDateSourceItemsToOutputDirectoryAlways 
[17:11:58][_CopyOutOfDateSourceItemsToOutputDirectoryAlways] Copy 
[17:11:58][Copy] Copying file from "C:\TeamCity\buildAgent\work\c52628138e1ee4d4\Providers\NLog.config" to "bin\NLog.config". 
[17:11:58][Providers\Providers.csproj.teamcity] CopyFilesToOutputDirectory 
[17:11:58][CopyFilesToOutputDirectory] Copy 
[17:11:58][Copy] Copying file from "obj\Release\Providers.dll" to "bin\Providers.dll". 
[17:11:58][CopyFilesToOutputDirectory] Providers.csproj -> C:\TeamCity\buildAgent\work\c52628138e1ee4d4\Providers\bin\Providers.dll 
[17:11:58][CopyFilesToOutputDirectory] Copy 
[17:11:58][Copy] Copying file from "obj\Release\Providers.pdb" to "bin\Providers.pdb". 

==> [17:11:58]Process exited with code 0 

[17:11:58]Publishing internal artifacts 
[17:11:58][Publishing internal artifacts] Sending build.finish.properties.gz file 
[17:11:58]Publishing artifacts 
[17:11:58][Publishing artifacts] Collecting files to publish: [Providers\obj\Release\Package] 

==> [17:11:58][Publishing artifacts] Artifacts path Providers/obj/Release/Package not found 

[17:11:58]Build finished 

到解決方案所做的唯一變化是在的.sln和.csproj的文件(由Visual Studio)。如果我恢復到以前的版本,團隊城市的構建和部署沒有問題。 對項目文件的更改與explained in this post相同,我嘗試了建議的解決方案(將VisualStudioVersion = 11.0傳遞給MSBuild),但它不起作用。

如果我使用解決方案資源管理器中的發佈鏈接從Visual Studio進行部署,它也可以按預期方式工作。我將在VS 2012中創建一個基礎項目的新解決方案,並測試它是否從Teamcity部署。

還有其他想法嗎?

---更新---

但願,這不是解決辦法:我做了相反的建議on the above post,我設置的MSBuild參數VisualStudioVersion = 10.0和它的作品! 因此,爲了部署一個VS 2012項目,我不得不將它視爲VS 2010項目......你在做什麼不同?我應該做什麼才能在沒有作弊團隊的情況下進行部署?

---更新---

我加入我的TeamCity配置的一些快照。 Teamcity passes the system and environment variables as build parameters to MSBuild

General Settings

Build Steps

MSBuild

Configuration Parameters

+0

在VS 2012中測試了新的解決方案(2010年沒有轉換)=>相同的結果,沒有創建工件。沒有來自Teamcity的錯誤。 – qbantek

+0

在論壇上爲每個建議在構建服務器上安裝了Microsoft Visual Studio 2012的團隊資源管理器:無效。我沒有做的唯一的事情就是在構建服務器(!)上安裝VS 2012,應該嗎? – qbantek

+0

你將什麼命令行發送到msbuild? –

回答

3

更新

爲了澄清的問題是,Web發佈管道的目標($(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets)不作爲VS 2012集成外殼版本的一部分安裝。

該問題可以通過安裝完整版本的VS 2012來解決,或者可能通過在VS Shell頂部安裝Azure SDK來解決。

+0

沒有產生工件,不在_PublishedWebsites上,不在我能看到的任何其他子文件夾上。如果我比較日誌(我可以在這裏發佈它們,如果這有助於找到一個解決方案),我可以看到,teamcity應該收集文件的所有部分,轉換配置並將它們打包成zip文件丟失。 – qbantek

+1

不,我有C:\ Program Files文件(x86)\ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ WebApplications \ Microsoft.WebApplication.targets而不是C:\ Program Files文件(x86)\ MSBuild \ Microsoft \ VisualStudio \ v11。 0 \ Web \ Microsoft.Web.Publishing.targets這是否意味着我必須在構建服務器中安裝VS 2012?我一直在試圖避免這種情況:/ – qbantek

+0

我打賭這就是你的問題,因爲網絡發佈目標包含所有發佈代碼。您可能會在VS Shell上安裝Azure SDK(如果它允許) –

相關問題