我嘗試使用下面的命令來建立我的解決方案,但是,這是給我一個錯誤說MSBuild target package not found
的MSBuild建立和創建部署包
「C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ msbuild.exe「 」C:\ Users \ FullPath \ SolutoinName.sln「/T:Build; package /p:Configuration = DEBUG/p:OutputPath =」obj \ DEBUG「 /p :DeployIisAppPath =「/ bidmc-defaul」/p:VisualStudioVersion=10.0
我已經試過MSBuild target package not found但沒有幫助的話,我從目標刪除包和運行的命令,這是成功的
然後,我跑到下面的命令來創建一個包拉鍊
「C :\ Program Files(x86)\ IIS \ Microsoft Web Deploy \ msdeploy.exe「 -verb:sync -source:package =」C:\ Users \ Full Path \ Website \ obj \ Debug_PublishedWebsites \ defaul_Package \ myPackage.zip「 -dest:auto,computerName = localhost -allowUntrusted = true
現在這個說object of type package and path cannot be created, the zip package could not be loaded, could not find part of the path
更新
修復我的第一個命令創建的軟件包。我給我的解決方案名稱SolutoinName.sln,我用解決方案myproject.csproj中的主項目替換它,並帶有相應的路徑。這解決了我的第一個錯誤。
現在第二個錯誤已經改爲「applicatoin池,你是 嘗試使用已要求4.5 managedRuntimeVersion屬性設置爲V4.0的 應用」
我應該如何解決這個問題,只需在生成機器上安裝.NET 4.5?
只要有人遇到這個VisualStudio 2017(C#5.0 +),msbuild v14不會創建發佈包,但在visual studio目錄中發現msbuild v15(而不是msbuild)將創建包..花了我2天的時間來解決這個新的TeamCity服務器。隻影響Web應用程序,雖然這使得它更難以點。根本沒有提供任何錯誤或警告。 – ppumkin
@ppumkin我掙扎了好幾天,但無法從MVC(.net framework 4.6.1,VS 2017)項目構建包(或發佈)。是否有可能獲得用於打包項目的完整命令行參數/開關? – TheVillageIdiot