AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Publish Profile is lacking reference information

Open tbenbrahim opened this issue 1 year ago • 1 comments

Description

I could not find any reference information in this article. Particularly, I am looking for the valid properties in PropertyGroup, if I were to write a publishing profile by hand, and not relying on VS.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles?view=aspnetcore-8.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/host-and-deploy/visual-studio-publish-profiles.md

Document ID

2db330b4-e830-715f-0a15-e406f85e1d3b

Article author

@tdykstra

tbenbrahim avatar Jun 01 '24 19:06 tbenbrahim

Here's what CoPilot suggests. I'll look for a definitive link, but maybe this list will help: Common Properties

  • PublishUrl Specifies the URL or file path to which the project will be published.
  • PublishProvider Defines the provider used for publishing, such as FileSystem, MSDeploy, or FTP.
  • PublishMethod Determines the method of publishing, e.g., MSDeploy, FTP, FileSystem.
  • SiteUrlToLaunchAfterPublish URL to launch after publishing the project.
  • LastUsedBuildConfiguration Specifies the build configuration used for the last publish, such as Release or Debug.
  • LastUsedPlatform Indicates the platform used for the last publish, such as AnyCPU, x86, or x64.
  • LaunchSiteAfterPublish Boolean property to determine if the site should be launched after publish (True or False).
  • ExcludeApp_Data Boolean property to exclude the App_Data folder from the publish (True or False).
  • EnableMSDeployAppOffline Boolean property to enable app offline mode during publishing with MSDeploy (True or False).
  • MSDeployServiceURL URL of the MSDeploy service.
  • DeployIisAppPath IIS application path where the application will be deployed.
  • UserName Username for the deployment.
  • Password Password for the deployment. (Note ` Storing passwords in plain text is not secure; use secure methods where possible.)
  • AllowUntrustedCertificate Boolean property to allow the use of untrusted certificates (True or False).
  • _DestinationType Specifies the type of the publish destination, e.g., AzureWebSite, AzureApiApp, AzureFunctionApp.
  • Configuration Build configuration to use for publishing, e.g., Release, Debug.
  • TargetFramework Target framework to use for publishing, e.g., netcoreapp3.1, net5.0.
  • RuntimeIdentifier Runtime identifier to use for publishing, e.g., win-x64, linux-x64.
  • SelfContained Boolean property to specify if the application should be published as self-contained (True or False).
  • Web Application Specific Properties:
  • WebPublishMethod Specifies the method used for web publishing, e.g., MSDeploy, FileSystem, FTP.
  • _PublishWebProject Boolean property to specify if the web project should be published (True or False).
  • MSDeployPublishMethod Method used by MSDeploy, e.g., WMSVC, RemoteAgent, InProc.
  • _MSDeployUseChecksum Boolean property to specify if checksums should be used during MSDeploy (True or False).
  • DeployOnBuild Boolean property to specify if the project should be deployed on build (True or False).
  • WebPublishPipelineTransform Specifies the web.config transform to apply during publishing.
  • Database Project Specific Properties:
  • DeployDatabaseProject Boolean property to specify if a database project should be deployed (True or False).
  • SqlPublishProfilePath Path to the SQL publish profile to use.
  • TargetDatabaseName Name of the target database.
  • TargetConnectionString Connection string for the target database.
  • BackupDatabaseBeforeDeploy Boolean property to specify if the database should be backed up before deployment (True or False).

Here is an example of a .pubxml file illustrating some of these properties `

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http `//schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishUrl>ftp `//ftp.example.com/website/</PublishUrl>
    <PublishProvider>FTP</PublishProvider>
    <PublishMethod>FTP</PublishMethod>
    <SiteUrlToLaunchAfterPublish>http `//www.example.com</SiteUrlToLaunchAfterPublish>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>AnyCPU</LastUsedPlatform>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <EnableMSDeployAppOffline>True</EnableMSDeployAppOffline>
    <MSDeployServiceURL>https `//msdeploy.example.com</MSDeployServiceURL>
    <DeployIisAppPath>Default Web Site/MyApp</DeployIisAppPath>
    <UserName>ftpuser</UserName>
    <Password>ftppassword</Password>
    <AllowUntrustedCertificate>False</AllowUntrustedCertificate>
    <DeployOnBuild>True</DeployOnBuild>
    <Configuration>Release</Configuration>
    <TargetFramework>net5.0</TargetFramework>
    <SelfContained>False</SelfContained>
  </PropertyGroup>
</Project>

Rick-Anderson avatar Jun 04 '24 00:06 Rick-Anderson