0

我有一個ASP.NET應用程序的核心,我可以發佈使用網絡部署和預配置發佈配置文件通過Visual Studio的2017年。現在,我需要配置CI並努力實現在命令行一樣的,所以我安裝[.NET Core SDK][1]跟着​​3210無法發佈與「CreateManifestFile」任務ASP.NET核心應用程序無法加載

dotnet build -c release /p:DeployOnBuild=true /p:PublishProfile=publish-profile-name 

不幸的是,它提供了以下錯誤:

C:\Program Files\dotnet\sdk\1.0.4\Sdks\Microsoft.NET.Sdk.Publish\build\netstanda rd1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(227,5): error MSB4062: The "CreateManifestFile" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\1.0.4\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0 ....\tools\netcoreapp1.0\Microsoft.NETCore.Sdk.Publish.Tasks.dll. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

我怎樣才能解決dotnet build線?

回答

1

如果您發佈配置文件使用MSDeploy,它不能被通過.NET核心基於構建工具(dotnet build)建。

看到相關的GitHub的問題https://github.com/aspnet/websdk/issues/166

的解決方法是使用msbuild /p:Configuration=Release …從2017年VS安裝,而不是dotnet build

+0

我看到這個討論,但也注意到這一點:'我們也有固定的核心運行任務。所以,一旦新的websdk發佈,你應該能夠運行下面的命令。「所以我認爲它已經修復了。這僅僅是Web部署的問題嗎?我完全可以切換我的發佈配置文件到FTP ...... –

+0

我覺得評論是關於'WebDeployPackage'而不是'MSDeploy'。 AFAIK該軟件包應該允許您使用'msdeploy.exe'或IIS GUI來部署生成的zip文件。 –

+0

我創建了一個FTP部署,並能夠通過這一步沒有錯誤,但不幸的是,新的文件不會被複制到FTP進行構建成功輸出服務器。命令如下:'dotnet build/p:DeployOnBuild = true/p:PublishProfile = myprofile-ftp' –

相關問題