0

I have an ASP.NET Core app which I can publish using web deploy and pre-configured publishing profile via Visual Studio 2017. Now I need to configure CI and trying to achieve the same from the command line so I installed [.NET Core SDK][1] and followed this guide

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

Unfortunately, it gives the following error:

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.

How can I fix the dotnet build line?

Mando
  • 11,414
  • 17
  • 86
  • 167

1 Answers1

1

If your publish profile uses MSDeploy, it cannot be built via the .NET Core based build tools (dotnet build).

See the related GitHub issue https://github.com/aspnet/websdk/issues/166

The workaround is to use msbuild /p:Configuration=Release … from a VS 2017 installation instead of dotnet build.

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
  • I saw this discussion but also notice this: `We have also fixed the task to run on core. So, you should be able to run the below command once the new websdk is released.` so I assumed that it's already fixed. Is it an issue for the web deploy only? I can totally switch my publishing profile to FTP... – Mando Aug 07 '17 at 10:22
  • I think the comment was about `WebDeployPackage` and not `MSDeploy`. AFAIK the package should allow you to deploy the resulting zip file using `msdeploy.exe` or the IIS GUI. – Martin Ullrich Aug 07 '17 at 10:54
  • I've created an FTP deploy and was able to pass this step without errors, but, unfortunately, new files are not being copied to ftp server with Build Succeeded output. The command is below: `dotnet build /p:DeployOnBuild=true /p:PublishProfile=myprofile-ftp` – Mando Aug 08 '17 at 05:03
  • I suggest opening an issue on the linked websdk repo about that – Martin Ullrich Aug 08 '17 at 07:56