Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create a WebDeploy package for ASP.Net Core application #8261

Closed
mgrosperrin opened this issue May 15, 2017 · 4 comments
Closed

Unable to create a WebDeploy package for ASP.Net Core application #8261

mgrosperrin opened this issue May 15, 2017 · 4 comments

Comments

@mgrosperrin
Copy link

Steps to reproduce

In VS 2017.2 (26430.6), create a new ASP.NET Core Web Application (.NET Core ou .NET Framework).
Add a publish profile with IIS as target and Web Deploy as method (see Release.pubxml in the attached ZIP file).
Run the following command:
dotnet build WebApplicationDeploy.sln /nologo /p:PublishProfile=Release /p:PackageLocation="C:\Some\Path\package" /p:OutDir="C:\Some\Path\out" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" /p:DesktopBuildPackageLocation="C:\Some\Path\package\package.zip"

Expected behavior

A Web Deploy package is created at C:\Some\Path\package with a ZIP file, a cmd file that will run MSDeply.exe, a *.SetParameters.xml file with the parameters and their values to apply, a *.SourceManifest.xml file (as with an "classic" ASP.NET Web Application).

Actual behavior

The application is correctly build, but the package is not created with the following error:

WebApplication.Full -> C:\Some\Path\out\WebApplication.Full.exe
C:\Program Files\dotnet\sdk\1.0.4\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(160,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 <UsingTask> 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. [C:\Some\Path\WebApplicationDeploy\WebApplication.Full\WebApplication.Full.csproj]

Build FAILED.

C:\Program Files\dotnet\sdk\1.0.4\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(160,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 <UsingTask> 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. [C:\Some\Path\WebApplicationDeploy\WebApplication.Full\WebApplication.Full.csproj]
    0 Warning(s)
    1 Error(s)

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.4)

Product Information:
 Version:            1.0.4
 Commit SHA-1 hash:  af1e6684fd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.4

WebDeploy.zip

@davidfowl
Copy link
Member

/cc @vijayrkn

@vijayrkn
Copy link
Contributor

If you are using the 2.0 version of cli, then you can use the below command on a windows machine and it would work. MsDeploy is not cross plat yet, so this cant be run on a non-windows machine.

dotnet build WebApplicationDeploy.sln /nologo /p:PublishProfile=Release /p:PackageLocation="C:\Some\Path\package" /p:OutDir="C:\Some\Path\out" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" /p:DesktopBuildPackageLocation="C:\Some\Path\package\package.zip"

if you are using 1.0.4 version of the cli, then you need to use the msbuild version of the command (The ability to call dotnet build was added in 2.0 cli).

msbuild WebApplicationDeploy.sln /nologo /p:PublishProfile=Release /p:PackageLocation="C:\Some\Path\package" /p:OutDir="C:\Some\Path\out" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" /p:DesktopBuildPackageLocation="C:\Some\Path\package\package.zip"

This is the repo that has the publish features - https://github.com/aspnet/websdk

@livarcocc
Copy link
Contributor

Closing this, since it does not seem like a bug in the CLI.

@mgrosperrin
Copy link
Author

Hi,

thanks. I have been able to generate the package by running msbuild.
I will use the aspnet/websdk repo for subsequent issues

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants