question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I publish ASP.NET mvc project from linux using dotnet publish and publish profile?

See original GitHub issue
- dotnet publish WebProj.csproj /p:PublishProfile=<publish_profile>

(this according to docs is cross platform)

When i execute this in windows platform, it gets executed successfully and it publishes to desired server, but when I execute it in linux machine, it publishes locally in bin folder but not publish in server.

Publish Method: WebDeploy

Following is the profile

 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <PropertyGroup>
   <WebPublishMethod>MSDeploy</WebPublishMethod>
   <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
   <LastUsedPlatform>Any CPU</LastUsedPlatform>
   <SiteUrlToLaunchAfterPublish />
   <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
   <ExcludeApp_Data>False</ExcludeApp_Data>
   <TargetFramework>netcoreapp2.2</TargetFramework>
   <ProjectGuid>1e96b425-2c23-42ed-a8b0-1a87b562da28</ProjectGuid>
   <SelfContained>false</SelfContained>
   <_IsPortable>true</_IsPortable>
   <MSDeployServiceURL>----------</MSDeployServiceURL>
   <DeployIisAppPath>--------</DeployIisAppPath>
   <RemoteSitePhysicalPath />
   <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
   <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
   <EnableMSDeployBackup>True</EnableMSDeployBackup>
   <UserName>Administrator</UserName>
   <Password>XXXXXXX</Password>
   <_SavePWD>True</_SavePWD>
 </PropertyGroup>
</Project>

I also tried using FTP method, that published locally both in windows and linux. (Both methods work in visual studio publish option)

dotnet --info output:

Windows machine: .NET Core SDK (reflecting any global.json):
Version: 2.2.301
Commit: 70d6be0814


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


Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51


.NET Core SDKs installed:
2.1.701 [C:\Program Files\dotnet\sdk]
2.2.301 [C:\Program Files\dotnet\sdk]


.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Linux Machine .NET Core SDK (reflecting any global.json): Version: 2.2.300 Commit: 73efd5bd87

Runtime Environment: OS Name: ubuntu OS Version: 18.10 OS Platform: Linux RID: ubuntu.18.10-x64 Base Path: /usr/share/dotnet/sdk/2.2.300/

Host (useful for support): Version: 2.2.5 Commit: 0a3c9209c0

.NET Core SDKs installed: 2.2.300 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vijayrkncommented, Jul 15, 2019

@peterhuene Agreed. Please move this to WebSdk and we will add a message indicating Web Deploy is windows only.

0reactions
peterhuenecommented, Jul 15, 2019

This issue was moved to aspnet/websdk#781

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio publish profiles (.pubxml) for ASP.NET Core ...
Learn how to create publish profiles in Visual Studio and use them for managing ASP.NET Core app deployments to various targets.
Read more >
dotnet publish command - .NET CLI
The dotnet publish command publishes a .NET project or solution to a directory.
Read more >
NET 5 MVC - Publish project from linux using dotnet CLI ...
I've downloaded .publishsettings file from server admin panel, but dunno how to actually use "dotnet publish" command proper. I know it might be ......
Read more >
How do I publish ASP.NET mvc project from linux using ...
dotnet publish WebProj.csproj /p:PublishProfile= (this according to docs is cross platform) When i execute this in windows platform, ...
Read more >
How To Deploy .Net Core Application On Linux
Step 1 - Publish your .Net Core application · Right Click on your project · Click on publish · Now create a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found