2016-05-23 80 views
4

我在構建服務器上沒有Visual Studio。 After migrating from DNX (RC1) to .NET Core CLI (RC2) my build on TeamCity broke無法在構建服務器上發佈ASP.NET Core 1.0 RC2應用程序

確保我已經從我的電腦複製的MSBuild目標,以構建服務器後:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet 

我能來構建解決方案。

問題是:我無法發佈它!

當我運行:MSBuild.exe Solution.sln /p:DeployOnBuild=true /p:publishprofile=local它將失敗:

C:\ Program Files文件(x86)的\的MSBuild \微軟\ VisualStudio的\ v14.0 \ DOTNET的\ Microsoft.DotNet.Publishing.targets(406, 5):錯誤:發佈期間發生錯誤。 [d:\ path \ project.xproj] C:\ Program Files(x86)\ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ DotNet \ Microsoft.DotNet.Publishing.targets(406,5):error:Can bind argument參數'路徑',因爲它是一個空字符串。 [d:\路徑\ project.xproj]

我已經重新創建發佈輪廓與Visual Studio(產生的PowerShell腳本是一個比與RC1不同)

的發表作品罰款本地,我已經安裝了Visual Studio。

的問題是:

什麼我需要添加到構建服務器,能夠與/p:DeployOnBuild=true /p:publishprofile=運行的MSBuild,而無需安裝Visual Studio

感謝

回答

0

我並不標誌着以此爲答案,因爲我仍然希望能爲的答案,而是要幫助別人誰卡住了像我這樣的:

我做了什麼至今:

project.json有:

"publishOptions": { 
    "include": [ 
     "appsettings.json", 
     "hosting.json", 
     "web.config" 
    ] 
    }, 
    "scripts": { 
    "postpublish": [ 
     "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:project.Bla%" 
    ] 
    }, 

構建步驟:

  1. DOTNET的解決方案目錄恢復
  2. MSBuild的解決方案
  3. DOTNET發佈具體項目目錄

e.g:

d:\project\Project.Bla>dotnet publish -c Release 
Publishing Project.Bla for .NETFramework,Version=v4.5.2/win7-x64 
Project Project.Bla (.NETFramework,Version=v4.5.2) was previously compiled. Skipping compilation. 
Project Project.Ble (.NETFramework,Version=v4.5.2) was previously compiled. Skipping compilation. 
... 
Configuring the following project for use with IIS: 'd:\project\Project.Bla\bin\Release\net452\win7-x64\publish' 
Updating web.config at 'd:\project\Project.Bla\bin\Release\net452\win7-x64\publish\web.config' 
Configuring project completed successfully 
publish: Published to d:\project\Project.Bla\bin\Release\net452\win7-x64\publish 
Published 1/1 projects successfully 
相關問題