diff --git a/eng/Tools.props b/eng/Tools.props index 73585747..e8bca617 100644 --- a/eng/Tools.props +++ b/eng/Tools.props @@ -1,7 +1,6 @@ - diff --git a/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.AllFilesInProjectFolder.targets b/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.AllFilesInProjectFolder.targets new file mode 100644 index 00000000..87f143a6 --- /dev/null +++ b/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.AllFilesInProjectFolder.targets @@ -0,0 +1,181 @@ + + + + + + + + + + + true + + + + + + + $(PublishPipelineCollectFilesCore); + CollectFilesFromProjectFolder; + + <_CollectFiles_IncludeIgnorableFile Condition="'$(_CollectFiles_IncludeIgnorableFile)'==''">False + + + False + True + + + + + + + + + + + + + + + + + + + + + + + <_KnownProjectItems Include="@(EmbeddedResource)" /> + <_KnownProjectItems Include="@(None)" /> + <_KnownProjectItems Include="@(Content)" /> + <_KnownProjectItems Include="@(Compile)" /> + + + + <_ProjectBaseIntermediateOutputPath Include="$(BaseIntermediateOutputPath)"/> + + + + + + + <_ExcludeRelativePathFromProjectFolder>^[^\\]*\.out$ + + + + + + + + + + + + + + + + $(OnBeforeCollectFilesFromProjectFolder_ExcludeSccFiles); + $(CollectFilesFromProjectFolder_ExcludeSccFilesDependsOn); + SetExcludeFromProjectFolder; + + + + + + <_ExcludeRelativePathFromProjectFolder>$(_ExcludeRelativePathFromProjectFolder);[^\\]*\.scc$;[^\\]*\.vssscc$;[^\\]*\.vspscc$ + + + + + + + + + + + + + $(OnBeforeCollectFilesFromProjectFolder); + $(CollectFilesFromProjectFolderDependsOn); + SetExcludeFromProjectFolder; + CollectFilesFromProjectFolder_ExcludeSccFiles; + + + + + + + + + + + + + + + + + + + + + %(_KnownProjectItems.Identity) + CollectFilesFromProjectFolder.KonwnProjectItems + AllFilesInProjectFolder + + + %(_KnownProjectItems.Link) + CollectFilesFromProjectFolder.KonwnProjectItems + AllFilesInProjectFolder + $(ExcludeLinkFilesInProject) + Link + + + + %(_AllFilesUnderProjectFolderExceptKnownProjectItems.Identity) + CollectFilesFromProjectFolder.ExceptKonwnProjectItems + AllFilesInProjectFolder + + + + + + + + + true + + + + + diff --git a/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.AllFilesInTheProject.targets b/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.AllFilesInTheProject.targets new file mode 100644 index 00000000..6456112b --- /dev/null +++ b/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.AllFilesInTheProject.targets @@ -0,0 +1,242 @@ + + + + + true + + + + + + + False + + + + + + + + $(PublishPipelineCollectFilesCore); + CollectFilesFromCompile; + CollectFilesFromEmbeddedResource; + CollectFilesFromNone; + CollectFilesFromBaseApplicationManifest; + CollectFilesFromProjectFile; + + + + + + + + + + + $(OnBeforeCollectFilesFromCompile); + $(CollectFilesFromCompileDependsOn); + + + + + + + + + + + + %(Compile.Identity) + CollectFilesFromCompile + ProjectNotRunRequired + + + %(Compile.Link) + CollectFilesFromCompile + ProjectNotRunRequired + $(ExcludeLinkFilesInProject) + Link + + + + + + + + + + + $(OnBeforeCollectFilesFromEmbeddedResource); + $(CollectFilesFromEmbeddedResourceDependsOn); + + + + + + + + + + + %(EmbeddedResource.Identity) + CollectFilesFromEmbeddedResource + ProjectNotRunRequired + + + %(EmbeddedResource.Link) + CollectFilesFromEmbeddedResource + ProjectNotRunRequired + $(ExcludeLinkFilesInProject) + Link + + + + + + + + + + + $(OnBeforeCollectFilesFromNone); + $(CollectFilesFromNoneDependsOn); + + + + + + + + + + %(None.Identity) + CollectFilesFromNone + ProjectNotRunRequired + + + %(None.Link) + CollectFilesFromNone + ProjectNotRunRequired + $(ExcludeLinkFilesInProject) + Link + + + + + + + + + + + + $(OnBeforeCollectFilesFromBaseApplicationManifest); + $(CollectFilesFromBaseApplicationManifestDependsOn); + + + + + + + + + + + + %(BaseApplicationManifest.Identity) + CollectFilesFromBaseApplicationManifest + ProjectNotRunRequired + + + %(BaseApplicationManifest.Link) + CollectFilesFromBaseApplicationManifest + ProjectNotRunRequired + $(ExcludeLinkFilesInProject) + Link + + + + + + + + + + + + $(OnBeforeCollectFilesFromProjectFile); + $(CollectFilesFromProjectFileDependsOn); + + + + + + + + + + + $(MSBuildProjectFile) + CollectFilesFromProjectFile + ProjectNotRunRequired + + + $(MSBuildProjectFile).user + CollectFilesFromProjectFile + ProjectNotRunRequired + + + + + + + + true + + + + diff --git a/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.OnlyFilesToRunTheApp.targets b/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.OnlyFilesToRunTheApp.targets new file mode 100644 index 00000000..84667d52 --- /dev/null +++ b/eng/msbuild/web/Web/CollectFiles/Microsoft.Web.Publishing.OnlyFilesToRunTheApp.targets @@ -0,0 +1,445 @@ + + + + + + + + + true + + + + + + $(PublishPipelineCollectFilesCore); + CollectFilesFromIntermediateAssembly; + CollectFilesFromContent; + CollectFilesFromAddModules; + CollectFilesFrom_SGenDllCreated; + CollectFilesFromIntermediateSatelliteAssembliesWithTargetPath; + CollectFilesFromReference; + CollectFilesFromAllExtraReferenceFiles; + CollectFilesFrom_SourceItemsToCopyToOutputDirectory; + CollectFilesFromDocFileItem; + CollectFilesFrom_WebApplicationSilverlightXapFiles; + CollectFilesFrom_binDeployableAssemblies; + + True + + + + + + + + + $(OnBeforeCollectFilesFromIntermediateAssembly); + $(CollectFilesFromIntermediateAssemblyDependsOn); + + + + + + + + + + + + bin\%(FileName)%(Extension) + CollectFilesFromIntermediateAssembly + Run + + + + + + bin\%(FileName).pdb + CollectFilesFromIntermediateAssembly + Debug + + + + + + + + + + + + $(OnBeforeCollectFilesFromContent); + $(CollectFilesFromContentDependsOn); + + + + + + + + + + %(Content.Identity) + CollectFilesFromContent + Run + + + %(Content.Link) + CollectFilesFromContent + Run + $(ExcludeLinkFilesInProject) + Link + + + + + + + + + + + + $(OnBeforeCollectFilesFromAddModulesDependsOn); + $(CollectFilesFromAddModulesDependsOn); + + + + + + + + + + bin\%(FileName)%(Extension) + CollectFilesFromAddModules + Run + + + + + + + + + + + $(OnBeforeCollectFilesFrom_SGenDllCreated); + $(CollectFilesFrom_SGenDllCreatedDependsOn); + + + + + + + + + + bin\$(_SGenDllName) + CollectFilesFrom_SGenDllCreated + Run + + + + + + + + + + + $(OnBeforeCollectFilesFromIntermediateSatelliteAssembliesWithTargetPath); + $(CollectFilesFromIntermediateSatelliteAssembliesWithTargetPathDependsOn); + + + + + + + + + bin\%(IntermediateSatelliteAssembliesWithTargetPath.TargetPath) + CollectFilesFromIntermediateSatelliteAssembliesWithTargetPath + Run + + + + + + + + + + + + $(OnBeforeCollectFilesFromReference); + $(CollectFilesFromReferenceDependsOn); + ResolveProjectReferences; + ResolveAssemblyReferences; + + + + + + + + + + bin\%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(FileName)%(Extension) + CollectFilesFromReference + Run + + + + + + bin\%(FileName)%(Extension) + CollectFilesFromReference + Run + + + + + + + + + + + $(OnBeforeCollectFilesFromAllExtraReferenceFiles); + $(CollectFilesFromAllExtraReferenceFilesDependsOn); + + + + + + + + + + bin\%(FileName)%(Extension) + CollectFilesFromAllExtraReferenceFiles + Run + + + + + + + + + + + + + $(OnBeforeCollectFilesFrom_SourceItemsToCopyToOutputDirectory); + $(CollectFilesFrom_SourceItemsToCopyToOutputDirectoryDependsOn); + + + + + + + + + <_TempSourceItemsToCopyToOutputDirectory Include="@(_SourceItemsToCopyToOutputDirectoryAlways); @(_SourceItemsToCopyToOutputDirectory)" /> + + + + + + bin\%(_TempSourceItemsToCopyToOutputDirectory.TargetPath) + CollectFilesFrom_SourceItemsToCopyToOutputDirectory + Run + + + + + + + + + + + + $(OnBeforeCollectFilesFromDocFileItem); + $(CollectFilesFromDocFileItemDependsOn); + + + + + + + + + + bin\%(FileName)%(Extension) + CollectFilesFromDocFileItem + Run + + + + + + + + + + + $(OnBeforeCollectFilesFrom_WebApplicationSilverlightXapFiles); + $(CollectFilesFrom_WebApplicationSilverlightXapFilesDependsOn); + + + + + + + + + + + + + + %(_WebApplicationSilverlightXapFiles.Identity) + CollectFilesFrom_WebApplicationSilverlightXapFiles + Run + + + + + + + + + + + $(OnBeforeCollectFilesFrom_binDeployableAssemblies); + $(CollectFilesFrom_binDeployableAssembliesDependsOn); + _CopyBinDeployableAssemblies; + + + + + + + + + + + + + + bin\%(RecursiveDir)%(FileName)%(Extension) + CollectFilesFrom_binDeployableAssemblies_NoDestinationRelPath + Run + + + + bin\%(_binDeployableAssemblies_None.DestinationRelPath)%(FileName)%(Extension) + CollectFilesFrom_binDeployableAssemblies_WithDestinationRelPath + Run + + + + + + + + true + + + + diff --git a/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FPSE.targets b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FPSE.targets new file mode 100644 index 00000000..2093b505 --- /dev/null +++ b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FPSE.targets @@ -0,0 +1,59 @@ + + + + + + + + + <_WPPWebPublishMethodSupports>$(_WPPWebPublishMethodSupports);WebFPSEPublish + + + + + + + + + $(OnBeforeWebFPSEPublish); + $(WebFPSEPublishDependsOn); + + + + + + + + + + + + + + + + + true + + + + diff --git a/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FTP.targets b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FTP.targets new file mode 100644 index 00000000..9fc08695 --- /dev/null +++ b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FTP.targets @@ -0,0 +1,60 @@ + + + + + + + + + <_WPPWebPublishMethodSupports>$(_WPPWebPublishMethodSupports);WebFTPPublish + + + + + + + + + + $(OnBeforeWebFTPPublish); + $(WebFTPPublishDependsOn); + + + + + + + + + + + + + + + + true + + + + + diff --git a/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FileSystem.targets b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FileSystem.targets new file mode 100644 index 00000000..337c54ab --- /dev/null +++ b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.FileSystem.targets @@ -0,0 +1,116 @@ + + + + + + + + + + <_WPPWebPublishMethodSupports>$(_WPPWebPublishMethodSupports);WebFileSystemPublish + + + + + + + + + + $(OnBeforeWebFileSystemPublish); + $(WebFileSystemPublishDependsOn); + + + $(WebFileSystemPublishDependsOn); + PipelinePreDeployCopyAllFilesToOneFolder; + + + + + + + <_DoWebFileSystemPublishDeleteExtraFiles>False + <_DoWebFileSystemPublishDeleteExtraFiles Condition= "'$(DeleteExistingFiles)' == 'True'" >True + <_HttpHeader>http:// + <_DoWebFileSystemPublish>False + <_DoWebFileSystemPublish Condition="'$(PublishUrl)'!='' And '$(PublishUrl.StartsWith($(_HttpHeader), StringComparison.OrdinalIgnoreCase))' == 'False' And '$([System.IO.Path]::GetFullPath($(PublishUrl)))' != ''">True + + + + + + + + + + + + + + + + + + %(_AllFilesUnder_WPPAllFilesInSingleFolder.Identity) + WebFileSystemPublish + AllFilesInFolder + + + + + + + <_AllExtraFilesUnderPublishUrl Include="$(PublishUrl)\**" /> + <_AllExtraFilesUnderPublishUrl + Remove="@(FilesForFileCopy->'$(PublishUrl)\%(DestinationRelativePath)')" /> + + + + + + + + + + + + + + + + + + true + + + + diff --git a/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.MsDeploy.targets b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.MsDeploy.targets new file mode 100644 index 00000000..d3a85726 --- /dev/null +++ b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.MsDeploy.targets @@ -0,0 +1,49 @@ + + + + + + + + true + + + + + + + + Microsoft.Web.Publishing.MSDeploy.Common.targets + + + + + True + + $(PipelineDeployPhaseDependsOn); + PipelineMsdeploySpecificTransformPhase; + + + + + + + + true + + + + diff --git a/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.Package.targets b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.Package.targets new file mode 100644 index 00000000..17f7652c --- /dev/null +++ b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.Deploy.Package.targets @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + true + + + + + Microsoft.Web.Publishing.MSDeploy.Common.targets + + + + + True + + $(PipelineDeployPhaseDependsOn); + PipelineMsdeploySpecificTransformPhase; + + + + + + + + + + true + + + + diff --git a/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.MsDeploy.Common.targets b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.MsDeploy.Common.targets new file mode 100644 index 00000000..f958c498 --- /dev/null +++ b/eng/msbuild/web/Web/Deploy/Microsoft.Web.Publishing.MsDeploy.Common.targets @@ -0,0 +1,1192 @@ + + + + + + + + + + + + + + true + + + + + + True + + + + True + InsertEFCodeFirstDeploy + $(_WPPDefaultIntermediateOutputPath)$(InsertEFCodeFirstDeployWebCofigIntermediateOutput) + + + + + + + True + + GetMSDeployInstalledVersionPath; + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + $(ParseSQLScriptForMSDeployParametersDependsOn); + GetMSDeployInstalledVersionPath; + ProcessPublishDatabaseSettings; + + + + + <_DatabasesToPackageForSQL Include="@(_DatabasesToPackage)" + Condition="$(EnableSqlScriptVariableParameterize) + And '%(_DatabasesToPackage.SourceProvider)' == 'DbFullSql' + And '%(_DatabasesToPackage.SourcePath)' != '' + And Exists('%(_DatabasesToPackage.SourcePath)') + And '$([System.IO.Path]::GetExtension($([System.String]::new(%(_DatabasesToPackage.SourcePath)))))' == '.sql'"> + + + + + + + + + + + + + + + + + + + + + + True + + $(HandleEFCodeFirstDataMigrationDependsOn); + GetMSDeployInstalledVersionPath; + ProcessPublishDatabaseSettings; + + + + + + <_DatabasesToPackageForEFCodeFirst Include="@(_DatabasesToPackage)" + Condition="'%(_DatabasesToPackage.SourceProvider)' == 'DbCodeFirst' + And '%(_DatabasesToPackage.SourcePath)' == 'DBMigration'"> + + + + + + + + + + + + HandleEFCodeFirstDataMigration; + ProfileTransformWebConfig; + + + $(PreInsertEFCodeFirstDeployWebCofigBeforeTarget); + AutoParameterizationWebConfigConnectionStrings; + PreAutoParameterizationWebConfigConnectionStrings; + + + + + + <_WebConfigsToInsertEFCodeFirstDeployContext Include="@(FilesForPackagingFromProject)" + Condition="'%(FilesForPackagingFromProject.Filename)%(FilesForPackagingFromProject.Extension)'=='$(ProjectConfigFileName)' + And !%(FilesForPackagingFromProject.Exclude) + And '%(DestinationRelativePath)' == '$(ProjectConfigFileName)'"> + $(InsertEFCodeFirstDeployWebCofigLocation)\original + $(InsertEFCodeFirstDeployWebCofigLocation)\transformed\%(DestinationRelativePath) + $([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)\%(DestinationRelativePath))) + + <_WebConfigsToInsertEFCodeFirstDeployContextOuputFiles Include="@(_WebConfigsToInsertEFCodeFirstDeployContext->'%(TransformOutputFile)')"> + + + + + <_WebConfigsToInsertEFCodeFirstDeployContextOuputDirectories>@(_WebConfigsToInsertEFCodeFirstDeployContextOuputFiles->'%(RootDir)%(Directory)') + <_WebConfigsToInsertEFCodeFirstDeployContextOuput>@(_WebConfigsToInsertEFCodeFirstDeployContext->'%(TransformOutputFile)'); + + + + <_WebConfigsToInsertEFCodeFirstDeployContextOuputDirectories Include="$(_WebConfigsToInsertEFCodeFirstDeployContextOuputDirectories)" /> + + + + + + + + + + + + + + + + + + + + + + + $(_PublishLocalizedString_EFCodeFirstConnectionStringParameterDescription) + + + + + + + + + + + %(_DatabasesToPackageForEFCodeFirst.DestinationPath) + %(_DatabasesToPackageForEFCodeFirst.DestinationGroup) $(_EscapedDeployParameterEFCodeFirstConnectionStringDescription) + True + False + + + + + <_InsertEFCodeFirstDeployContextNames Include="@(_DatabasesToPackageForEFCodeFirst)"> + + <add + name="%(_DatabasesToPackageForEFCodeFirst.DestinationGroup)_DatabasePublish" + connectionString="%(_DatabasesToPackageForEFCodeFirst.DestinationGroup)_DatabasePublish.ConnetionString" + providerName="$(InsertAdditionalWebConfigConnectionStringProviderName)" + xdt:Transform="InsertIfMissing" + xdt:Locator="Match(name)" + xdt:SupressWarnings="True" + /> + + + <context type="%(_DatabasesToPackageForEFCodeFirst.SourceDbContext)" + xdt:Transform="InsertIfMissing" + xdt:Locator="Match(type)" + xdt:SupressWarnings="true" + > + <databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[%(_DatabasesToPackageForEFCodeFirst.SourceDbContext)], [%(_DatabasesToPackageForEFCodeFirst.SourceMigrationConfiguration)]], EntityFramework, PublicKeyToken=b77a5c561934e089"> + <parameters> + <parameter value="%(_DatabasesToPackageForEFCodeFirst.DestinationGroup)_DatabasePublish" /> + </parameters> + </databaseInitializer> + </context> + + + + + + + + <_WebConfigsToInsertEFCodeFirstDeployContext_Transform><?xml version="1.0"?> + <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> + <connectionStrings xdt:Transform="InsertIfMissing" xdt:SupressWarnings="True"> + @(_InsertEFCodeFirstDeployContextNames->'%(TransformXMLFragement_CSInsert)', '') + </connectionStrings> + <entityFramework xdt:Transform="InsertIfMissing" xdt:SupressWarnings="true"> + <contexts xdt:Transform="InsertIfMissing" xdt:SupressWarnings="true"> + @(_InsertEFCodeFirstDeployContextNames->'%(TransformXMLFragement_Deploy)', '') + </contexts> + </entityFramework> + </configuration> + + + + + + + + + + + + + + HandleEFCodeFirstDataMigration; + ProfileTransformWebConfig; + PreInsertEFCodeFirstDeployWebCofig; + + + + + + + + + + + + <_WebConfigToInsertEFCodeFirstDeployContext_Identity>%(_WebConfigsToInsertEFCodeFirstDeployContext.Identity) + <_WebConfigToInsertEFCodeFirstDeployContext_TransformOutputFile>%(_WebConfigsToInsertEFCodeFirstDeployContext.TransformOutputFile) + <_WebConfigsToInsertEFCodeFirstDeployContext_TransformScope>%(_WebConfigsToInsertEFCodeFirstDeployContext.TransformScope) + + + + + + + + + + + + + + + HandleEFCodeFirstDataMigration; + ProfileTransformWebConfig; + PreInsertEFCodeFirstDeployWebCofig; + InsertEFCodeFirstDeployWebCofigCore; + + + + + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforeInsertEFCodeFirstDeployWebCofig); + $(InsertEFCodeFirstDeployWebCofigDependsOn); + TransformWebConfig; + HandleEFCodeFirstDataMigration; + ProfileTransformWebConfig; + PreInsertEFCodeFirstDeployWebCofig; + InsertEFCodeFirstDeployWebCofigCore; + PostInsertEFCodeFirstDeployWebCofig; + + + $(InsertEFCodeFirstDeployWebCofigBeforeTargets); + PreAutoParameterizationWebConfigConnectionStrings; + AutoParameterizationWebConfigConnectionStrings; + PipelineMsdeploySpecificTransformPhase; + + + + + + + + + <_DbDacFxDestinationPathesToPublish Include="@(_DatabasesToPackage->'%(DestinationPath)')" Condition="'%(_DatabasesToPackage.SourceProvider)' == 'dbDacFx'" /> + + + + + + + + + + + + + + + True + + $(CollectDatabasesToPublishDependsOn); + GetMSDeployInstalledVersionPath; + ProcessPublishDatabaseSettings; + _CheckDBProvidersAreAvailableAtServer; + ParseSQLScriptForMSDeployParameters; + HandleEFCodeFirstDataMigration; + InsertEFCodeFirstDeployWebCofig; + + + + + + + + + + + + + + + $(BeforeAddDeclareParametersItemsForDatabaseScript); + CollectDatabasesToPublish; + + + + + + + + + + + + + + + + + + + + <_VsPublish_DatabaseToPackage_DeclareParameters Include="@(_DatabasesToPackage->'$(DeployParameterPrefix)%(DestinationGroup)-Deployment Connection String')" + Condition="'%(_DatabasesToPackage.Identity)' !='' And '%(_DatabasesToPackage.SourceProvider)' != 'DbCodeFirst' "> + ProviderPath + %(_DatabasesToPackage.SourceProvider) + ^%(_DatabasesToPackage.SourcePath_RegExExcaped)$ + $(DeployParameterIISAppConnectionStringDescription) + %(_DatabasesToPackage.DestinationPath) + %(_DatabasesToPackage.DestinationPath) + $(MsDeployDatabaseTag) + + + + <_VsPublish_DatabaseToPackage_DeclareParameters Include="@(_DatabasesToPackage_SqlVariables->'$(DeployParameterPrefix)Sql script variable %24(%(Identity)) in %(DestinationGroup) scripts')" + Condition="$(EnableSqlScriptVariableParameterize) And '%(_DatabasesToPackage_SqlVariables.Identity)' !=''"> + $(MsDeploySqlCommandVariableKind) + ^%(_DatabasesToPackage_SqlVariables.SourcePath_RegExExcaped)$ + %(_DatabasesToPackage_SqlVariables.Identity) + $(DeployParameterSqlScriptVariablesDescription) + %(_DatabasesToPackage_SqlVariables.Value) + %(_DatabasesToPackage_SqlVariables.Value) + sql + + + + <_VsPublish_DatabaseToPackage_DeclareParameters Include="@(_DatabasesToPackage_SqlVariables->'$(DeployParameterPrefix)Sql script variable %24(%(Identity)) in %(DestinationGroup) scripts')" + Condition="$(EnableSqlScriptVariableParameterize) and '%(_DatabasesToPackage_SqlVariables.Identity)' !='' and ('%(_DatabasesToPackage_SqlVariables.Value)' == '') and ('%(_DatabasesToPackage_SqlVariables.IsDeclared)' == 'true') "> + parameterValidation + AllowEmpty + + + + $(VsSQLDatabaseScriptParametersPriority) + + + + + + + + + + + + + $(WriteItemsToSourceManifestDependsOn); + AddDatabasesToSourceManifest; + + + + + + + + + $(BeforeAddDatabasesToSourceManifest); + CollectDatabasesToPublish; + + + $(AddDatabasesToSourceManifestAfterTargets); + AddIisSettingAndFileContentsToSourceManifest; + + + + + + + + + + + + + + + + + + + + GetMSDeployInstalledVersionPath; + GenerateMsDeployManifestSettings; + GenerateMsdeployManifestFiles; + + + $(GenerateSampleDeployScriptAfterTargets); + PackageUsingManifest; + + + + + + + + + + + + + manifest + @(_MSDeploySourceManifest->'%(FileName)%(Extension)') + package + @(_MSDeployPackageFile->'%(FileName)%(Extension)') + archiveDir + @(_MSDeployArchiveDir->'%(FileName)%(Extension)') + %25RootPath%25$(GenerateSampleDeployScriptSourceFileName) + %25_Destination%25 + + @(_MSDeploySampleParametersValue->'%25RootPath%25%(FileName)%(Extension)') + <_ScriptGenerateSampleDeployScriptReadMeLocation>%25RootPath%25$(GenerateSampleDeployScriptReadMeFileName) + <_MSdeployFwdLink>http://go.microsoft.com/?linkid=9278654 + <_SampleDeployCmdFwdLink>http://go.microsoft.com/fwlink/?LinkID=183544 + + + + <_MsDeployDeclareParametersNotExclude Include="@(MsDeployDeclareParameters)" Condition="'%(ExcludeFromSetParameter)' != true and '%(MsDeployDeclareParameters.Identity)' !=''" /> + + + + + + + + + + + + + + $(GenerateSampleDeployScriptSourceRoot) + $(DeployEncryptKey) + + + + $(GenerateSampleDeployScriptDestinationRoot) + $(DeployEncryptKey) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + diff --git a/eng/msbuild/web/Web/Microsoft.DNX.Publishing.targets b/eng/msbuild/web/Web/Microsoft.DNX.Publishing.targets new file mode 100644 index 00000000..0aa067bd --- /dev/null +++ b/eng/msbuild/web/Web/Microsoft.DNX.Publishing.targets @@ -0,0 +1,459 @@ + + + + + + + true + + + + + + + + $(MSBuildThisFileDirectory) + $(MSBuildThisFileDirectory)..\DNX\ + + + + + + + + + + + + $(MSBuildProjectDirectory)\Properties\PublishProfiles\ + $([System.IO.Path]::GetFileNameWithoutExtension($(PublishProfile))) + $(PublishProfileRootFolder)$(PublishProfileName).pubxml + + + + + + + $([System.IO.Path]::GetTempPath())PublishTemp + $(PublishOutputPathNoTrailingSlash)\ + + + + + + + + + + + + + + + + + + + + $(GatherAllFilesToPublishDependsOn); + GetRuntimeToolingPathTarget + + + + + + + + $(MSBuildProjectDirectory) + + + wwwroot + + $(WebRoot) + + + true + true + $(LastUsedBuildConfiguration) + + + $(Configuration) + Release + + + + + + + + + + + + + + + + + + + + + + + $(FileSystemPublishDependsOn); + GatherAllFilesToPublish; + + + + + + + + + + + + + $(DockerPublishDependsOn); + GatherAllFilesToPublish; + + + + + + + + + + + + $(MSDeployPublishDependsOn); + GatherAllFilesToPublish; + GenerateSkipRuleForAppData + + + + + + + + + + + + + + + + + + + + + + + $(PublishOutputPath)$(WebRoot) + + + $(DeployIisAppPath) + $(MsDeployServiceUrl) + $(UserName) + $(Password) + False + Basic + + + + + contentLibExtension + 2 + DoNotDeleteRule + <_EnableRuleList>$(MsDeployDoNotDeleteRule) + + false + false + + + <_MSDeployUserAgentSource Condition=" '$(BuildingInsideVisualStudio)' != 'true'">$(VisualStudioVersion):CmdLine + <_MSDeployUserAgentSource Condition=" '$(BuildingInsideVisualStudio)' == 'true'">$(VisualStudioVersion):PublishDialog + <_MSDeployUserAgent>VS$(_MSDeployUserAgentSource) + + + + + + + + + + + + $(PackagePublishDependsOn); + FileSystemPublish + + + + + + + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\Web\Powershell\1.0.1\default-publish.ps1)) + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\Web\Powershell\1.0.1\package.pubxml)) + + + + + + + + + + $(DefaultPublishDependsOn); + FileSystemPublish + + + + + + + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\Web\Powershell\1.0.1\default-publish.ps1)) + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\Web\Powershell\1.0.1\FileSystem.pubxml)) + + + + + + + + + + + + + + + + + + $([System.String]::Copy('$(WebPublishProfileFile)').Replace('.pubxml','-publish.ps1')) + + $([System.IO.File]::ReadAllText($(PowerShellScriptFile))) + + + + + + + + + $(%(_PublishProperties.Identity)) + + + + + + + + + + + + + + + + + dirPath + $(_Escaped_PublishOutputPath)\\App_Data$ + Source + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + \ No newline at end of file diff --git a/eng/msbuild/web/Web/Microsoft.Web.Publishing.Tasks.dll b/eng/msbuild/web/Web/Microsoft.Web.Publishing.Tasks.dll new file mode 100644 index 00000000..af77f24b Binary files /dev/null and b/eng/msbuild/web/Web/Microsoft.Web.Publishing.Tasks.dll differ diff --git a/eng/msbuild/web/Web/Microsoft.Web.Publishing.targets b/eng/msbuild/web/Web/Microsoft.Web.Publishing.targets new file mode 100644 index 00000000..1e2935b6 --- /dev/null +++ b/eng/msbuild/web/Web/Microsoft.Web.Publishing.targets @@ -0,0 +1,4802 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + <_WPPVersion>2.0 + <_WPPSupports>IISExpress;AspNetCompileMerge + <_WPPWebPublishMethodSupports>WebMSDeployPublish;WebPackagePublish + + + + <_WPPSupports Include="$(_WPPSupports)" /> + + + + + + <_IISApplicationPool Include="Clr4IntegratedAppPool"> + ASP.NET v4.0 + + <_IISApplicationPool Include="Clr4ClassicAppPool"> + ASP.NET v4.0 Classic + + <_IISApplicationPool Include="Clr2IntegratedAppPool"> + DefaultAppPool + + <_IISApplicationPool Include="Clr2ClassicAppPool"> + Classic .NET AppPool + + + + + + + + + + obj\ + $(BaseIntermediateOutputPath)\ + + + + $(BaseIntermediateOutputPath)$(Configuration)\ + $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\ + $(IntermediateOutputPath)\ + + + + + + + $(MSBuildProjectDirectory) + $(WebPublishPipelineProjectDirectory) + + $(MSBuildProjectName) + $(MSBuildProjectFile) + $([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(WebPublishPipelineProjectDirectory), $(WebPublishPipelineProjectFile))))) + False + $(WebPublishPipeLineProjectFullPath) + <_WPPDefaultIntermediateOutputPathPathRoot Condition="'$(WebPublishPipelineProjectDirectory)' != '$(MSBuildProjectDirectory)'">$(MSBuildProjectDirectory)\ + False + True + <_LocalDBVersionToUseForSqlExpress Condition="'$(_LocalDBVersionToUseForSqlExpress)' == ''">11.0 + <_PublishProfileSet>False + True + + + <_WPPDefaultIntermediateOutputPath>$(IntermediateOutputPath) + <_WPPDefaultIntermediateOutputPath Condition="'$([System.IO.Path]::IsPathRooted($(IntermediateOutputPath)))' == 'False'">$(_WPPDefaultIntermediateOutputPathPathRoot)$(IntermediateOutputPath) + <_WPPDefaultIntermediateOutputFullPath>$([System.IO.Path]::GetFullPath($(_WPPDefaultIntermediateOutputPath))) + + + + + <_PublishProfileExtension>$([System.IO.Path]::GetExtension($(PublishProfile))) + <_PublishProfileDirectory>$([System.IO.Path]::GetDirectoryName($(PublishProfile))) + <_PublishProfileName>$([System.IO.Path]::GetFileNameWithoutExtension($(PublishProfile))) + <_PublishProfileSet>True + WebPublish + + + + $(WebPublishPipelineProjectDirectory)\$(AppDesignerFolder)\PublishProfiles + $(WebPublishPipelineProjectDirectory)\My Project\PublishProfiles + $(WebPublishPipelineProjectDirectory)\Properties\PublishProfiles + $(WebPublishPipelineProjectDirectory)\__profiles + + + + $(_PublishProfileName) + + + + $(PublishProfileRootFolder)\$(PublishProfileName).pubxml + $(WebPublishPipelineProjectDirectory)\App_Data\PublishProfiles\$(PublishProfileName).pubxml + + + + $(PublishProfile) + $(WebPublishPipelineProjectDirectory)\$(PublishProfile) + $(PublishProfileRootFolder)\$(PublishProfile) + + + + $([System.IO.Path]::GetFileNameWithoutExtension($(WebPublishProfileFile))) + <_PublishProfileName>$(PublishProfileName) + + + + <_WebPublishProfileFileWillBeImported>false + <_WebPublishProfileFileWillBeImported Condition="'$(EnableWebPublishProfileFile)'=='true' And '$(WebPublishProfileFile)' != '' And Exists($(WebPublishProfileFile))">true + + + + + + $([System.IO.Path]::ChangeExtension($(WebPublishProfileFile), '.wpp.targets')) + $([System.IO.Path]::ChangeExtension($(WebPublishProfileFile), '.parameters.xml')) + + + + + + + + + + $(WebPublishPipelineProjectDirectory)\*.wpp.targets + $(WebPublishPipelineProjectDirectory)\..\wpp.deploysettings.targets + + + + + + + + + <_WPPCleanTargets> + $(_WPPCleanTargets); + CleanWebsitesPackage; + CleanWebsitesWPPAllFilesInSingleFolder; + CleanWebPublishPipelineIntermediateOutput; + + + $(CleanDependsOn); + $(_WPPCleanTargets); + + + + + + OnlyFilesToRunTheApp + + + + + AllFilesInProjectFolder + $(WebPublishPipelineProjectDirectory) + $(AlternativeProjectDirectory) + + + + + True + + True + False + + + true + + False + $(ExcludeApp_Data) + False + + + True + False + + + <_CleanWPPIfNeedTo Condition="'$(_CleanWPPIfNeedTo)' == '' And '$(CleanWPPAllFilesInSingleFolder)'!=''">$(CleanWPPAllFilesInSingleFolder) + False + + False + + True + + True + False + True + True + True + True + True + False + + False + + True + False + CSAutoParameterize + $(_WPPDefaultIntermediateOutputPath)$(AutoParameterizationWebConfigConnectionStringsIntermediateOutput) + + <_WPPLastBuildInfoIntermediateOutput Condition="'$(_WPPLastBuildInfoIntermediateOutput)'==''">_WPPLastBuildInfo.txt + <_WPPLastBuildInfoLocation Condition="'$(_WPPLastBuildInfoLocation)'==''">$(_WPPDefaultIntermediateOutputPath)$(_WPPLastBuildInfoIntermediateOutput) + + True + InsertAdditionalCS + $(_WPPDefaultIntermediateOutputPath)$(InsertAdditionalWebCofigConnectionStringsIntermediateOutput) + System.Data.SqlClient + True + + + + + + + Database + $(_WPPDefaultIntermediateOutputPath)$(DatabaseDeployIntermediateRelativePath) + <_WebConfigsToAutoParmeterizeCsTransformOutputParametersFile>$(AutoParameterizationWebConfigConnectionStringsLocation).parameters.xml + + + Package + $(DeployDefaultTarget) + 2 + False + $(DeployOnBuildDefault) + false + false + false + + + False + + + + + + <_MSDeployUserAgentSource Condition=" '$(BuildingInsideVisualStudio)' != 'true'">$(VisualStudioVersion):CmdLine + <_MSDeployUserAgentSource Condition=" '$(BuildingInsideVisualStudio)' == 'true'">$(VisualStudioVersion):PublishDialog + <_MSDeployUserAgent>VS$(_MSDeployUserAgentSource) + + + + + False + + + + + True + False + + <_DeployOnBuild>$(DeployOnBuild) + + <_DeployOnBuild Condition="'$(BuildingInsideVisualStudio)' == 'true'">False + + + + PrepareForRun; + + + + False + True + False + + + + $(PipelineDependsOn); + BeforeBuild; + BuildOnlySettings; + ResolveReferences; + PrepareResourceNames; + ComputeIntermediateSatelliteAssemblies; + GetCopyToOutputDirectoryItems; + _SGenCheckForOutputs; + + + + $(PipelineDependsOn); + Build; + + + + $(PipelineDependsOn); + AfterBuild; + + + + + + + + Web.config + <_ProjectConfigFileExtension>$([System.IO.Path]::GetExtension($(ProjectConfigFileName))) + <_ProjectConfigFilePrefix>$([System.IO.Path]::GetFileNameWithoutExtension($(ProjectConfigFileName))) + + + $(_ProjectConfigFilePrefix).$(Configuration)$(_ProjectConfigFileExtension) + true + False + False + TransformWebConfig + $(_WPPDefaultIntermediateOutputPath)$(TransformWebConfigIntermediateOutput) + <_WebConfigTransformOutputParametersFile>$(TransformWebConfigIntermediateLocation).parameters.xml + + $(_ProjectConfigFilePrefix).$(PublishProfileName)$(_ProjectConfigFileExtension) + + + False + False + true + False + False + ProfileTransformWebConfig + $(_WPPDefaultIntermediateOutputPath)$(ProfileTransformWebConfigIntermediateOutput) + <_ProfileWebConfigTransformOutputParametersFile>$(ProfileTransformWebConfigIntermediateLocation).parameters.xml + + True + + + + + + + + True + False + $(WebProjectOutputDirInsideProjectDefault) + True + False + + + + + + + + $(OutDir)_PublishedWebsites\$(WebPublishPipelineProjectName)_Package + $(_WPPDefaultIntermediateOutputPath)Package + $(WebPublishPipelineProjectName).zip + Default Web Site + _deploy + $(WebPublishPipelineProjectName) + $(DefaultMSDeployDestinationSite)/$(DefaultMSDeployDestinationApplicationName)$(DefaultMsDeployAltSuffix) + $(DefaultMSDeployDestinationApplicationName)$(DefaultMsDeployAltSuffix) + + + + + + + True + + $(DesktopBuildPackageLocation) + $(PackageLocation) + $(PackageFileName)\$(DefaultPackageFileName) + $(DefaultPackageOutputDir)\$(DefaultPackageFileName) + $(PackageLocation) + $(DefaultPackageOutputDir) + $(_WPPDefaultIntermediateOutputPath)Package + + true + True + True + False + $(TargetFrameworkVersion) + + + + + True + $(DefaultPackageOutputDir)\Log + False + + Info + <_CreatePackage Condition="'$(_CreatePackage)'==''" >True + <_UseDefaultLinkExtensionValue>False + <_UseDefaultLinkExtensionValue Condition="'$(PackageEnableLinks)'=='' and '$(PackageDisableLinks)'==''">True + + AppPoolExtension;ContentExtension;CertificateExtension + AppPoolExtension + ContentExtension;CertificateExtension + $(MSBuildProjectDirectory)\Parameters.xml + $(WebPublishPipelineProjectDirectory)\Parameters.xml + False + $(WebPublishPipelineProjectName) + $(DeployParameterPrefix)IIS Web Application Name + $(DeployParameterPrefix)IIS Web Application Pool Name + $(DeployParameterPrefix)Add write permission to App_Data Folder + $(DeployParameterPrefix)Web Application Physical Path + + True + + + + + + + SqlConnectionString + SqlCommandVariable + + + :Connect;:!!;:Exit;:Help;:r;:Quit; + True + + + MultipleActiveResultSets;App; + + + False + <_PackageTempDir Condition ="'$(_PackageTempDir)' == '' ">$(PackageTempRootDir)\PackageTmp + $(_PackageTempDir) + False + + + + True + + + False + + + + + + + + + + + + + + + + $(WebPublishPipelineProjectDirectory)$(DefaultMsDeployAltSuffix) + + <_DestinationIisAppPhysicalPath>$(DeployIisAppPhysicalPath) + <_DestinationIisAppPhysicalPath Condition="'$(_DestinationIisAppPhysicalPath)'==''">$(DefaultDeployIisAppPhysicalPath) + + + + $(PackageEnableLinks) + $(PackageDisableLinks) + + False + + + + + + -100 + -80 + -70 + -60 + -55 + -50 + -40 + 60 + 100 + + + + + + + <_MSDeployPackageFile Include="$(PackageFileName)" /> + <_MSDeployArchiveDir Include="$(PackageArchiveRootDir)\Archive" /> + <_MSDeployPackageLocation Condition="$(PackageAsSingleFile)" Include="$(PackageFileName)" /> + <_MSDeployPackageLocation Condition="!$(PackageAsSingleFile)" Include="@(_MSDeployArchiveDir)" /> + + + + @(_MSDeployPackageLocation->'%(RootDir)%(Directory)%(FileName).deploy.cmd') + + @(_MSDeployPackageLocation->'%(RootDir)%(Directory)%(FileName).SourceManifest.xml') + $(UseMsdeployExe) + @(_MSDeployPackageLocation->'%(RootDir)%(Directory)%(FileName).Package.Parameters.xml') + @(_MSDeployPackageLocation->'%(RootDir)%(Directory)%(FileName).Publish.Parameters.xml') + @(_MSDeployPackageLocation->'%(RootDir)%(Directory)%(FileName).deploy.cmd') + @(_MSDeployPackageLocation->'%(FileName).deploy-readme.txt') + @(_MSDeployPackageLocation->'%(RootDir)%(Directory)%(FileName).deploy-readme.txt') + @(_MSDeployPackageLocation->'%(RootDir)%(Directory)%(FileName).SetParameters.xml') + $(GenerateSampleParametersValueLocationDefault) + @(_MSDeployPackageLocation->'%(FileName).SetParameters.xml') + + + + + + Unknown + + + Unknown + + + + + + + + + + False + Unknown + Run + Default + + + + + + + + False + Unknown + Run + Default + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unknown + + + + + + + + + + + + + + + + + + + $(MSBuildThisFileDirectory)\CollectFiles\$(FilesToIncludeForPublish).targets + $(MSBuildThisFileDirectory)\CollectFiles\Microsoft.Web.Publishing.$(FilesToIncludeForPublish).targets + + + + + + + + $(MSBuildThisFileDirectory)\Deploy\$(WebPublishMethod).targets + $(MSBuildThisFileDirectory)\Deploy\Microsoft.Web.Publishing.Deploy.$(WebPublishMethod).targets + + + + + + + False + True + + + + Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets + + + + + + + + + + + Deploy\Microsoft.Web.Publishing.MSDeploy.Common.targets + + + + + + + + + + + + + + + + + + + + ExcludeApp_Data + + + + + + + + + + + + + + + + + + ExcludeGeneratedDebugSymbol + + + + + + + @(ExcludeXmlAssemblyFilesDependsOn); + + + + + + ExcludeXmlAssemblyFiles + + + + + + + <_EnableCleanOnBuildForMvcViews Condition=" '$(_EnableCleanOnBuildForMvcViews)'=='' ">true + + + + <_PublishTempFolderNamesToCleanup Include="Database;TransformWebConfig;CSAutoParameterize;InsertAdditionalCS;ProfileTransformWebConfig;Package" /> + + + + + + + + + + + true + $(ExcludeFilesByExtensionDependsOn); + .tt;.settings + + + + + + + + <_ExtToExclude>%(WebPublishExtnsionsToExcludeItem.Identity) + + + + + + + ExcludeFilesByExtension + + + + + + + + + + $(ExcludeFilesFromPackageDependsOn); + ExcludeApp_Data; + ExcludeGeneratedDebugSymbol; + ExcludeXmlAssemblyFiles; + ExcludeFilesByExtension; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + %(_ImportedMSDeployDeclareParameters.DefaultValue) + $(UserParametersFileParametersPriority) + + + + + + + + + + + %(_ImportedProfileMSDeployDeclareParameters.DefaultValue) + $(UserProfileParametersFileParametersPriority) + + + + + + + + + + + + + + + %(MSDeployParameterValue.ParameterValue) + %(MSDeployParameterValue.ParameterValue) + %(MSDeployParameterValue.Description) + %(MSDeployParameterValue.ParameterPriority) + + + + + %(MSDeployParameterValue.ParameterValue) + %(MSDeployParameterValue.Description) + %(MSDeployParameterValue.ParameterPriority) + + + + + + + + $(ValidateGlobalSettingsDependsOn); + GetProjectWebProperties; + + + + + + + + + + + + + + + + $(ValidateGlobalPackageSettingDependsOn); + GetProjectWebProperties; + ValidateGlobalSettings; + + + + + + + + + + + + <_CheckPackageLocation Condition="$(PackageAsSingleFile)">$(PackageFileName) + <_CheckPackageLocation Condition="!$(PackageAsSingleFile)">$(PackageArchiveRootDir) + <_CheckPackageLocationArchiveDir Condition="!$(PackageAsSingleFile)">$(PackageArchiveRootDir)\Archive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_CleanWPPIfNeedToDependsOn> + $(_CleanWPPIfNeedToDependsOn); + ValidateGlobalSettings; + + + + + <_IsSameWPPBuildInfoAsLastBuildInfo>True + <_IsSameWPPBuildInfoAsLastBuildInfo Condition="!Exists($(_WPPLastBuildInfoLocation))">False + + + + + <_WPPCurrentBuildInfo>$(_WPPCurrentBuildInfo);PlatformName=$(PlatformName);Configuration=$(Configuration);WPPAllFilesInSingleFolder=$([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)));WebPublishProfileFile=$(WebPublishProfileFile) + + + + <_WPPCurrentBuildInfoItems Include="$(_WPPCurrentBuildInfo)" /> + + + + + + + + <_IsSameWPPBuildInfoAsLastBuildInfo Condition="'@(_WPPLastBuildInfo)' != '@(_WPPCurrentBuildInfoItems)'" >False + + + + + + + <_WPPLastBuildInfoLocationDirectory>$([System.IO.Path]::GetDirectoryName($(_WPPLastBuildInfoLocation))) + + + + + + + + + + + + + $(OnBeforePipelineCollectFilesPhase); + _CleanWPPIfNeedTo; + + + $(OnAfterPipelineCollectFilesPhase); + ExcludeFilesFromPackage; + ImportParametersFiles; + + + $(OnBeforePipelineCollectFilesPhase); + $(PipelineCollectFilesPhaseDependsOn); + WPPCopyWebApplicaitonPipelineCircularDependencyError; + ProcessItemToExcludeFromDeployment; + GetProjectWebProperties; + ValidateGlobalSettings; + ValidateGlobalPackageSetting; + $(PipelineDependsOn); + $(PublishPipelineCollectFilesCore); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(TransformWebConfigBeforeTargets); + MarkWebConfigAssistFilesAsExclude; + + + $(OnBeforeTransformWebConfig); + $(TransformWebConfigDependsOn); + PreTransformWebConfig; + TransformWebConfigCore; + ParameterizeTransformWebConfigCore; + PostTransformWebConfig; + + + + + + + + + + + + + + + $(OnBeforeCollectWebConfigsToTransform); + $(CollectWebConfigsToTransformDependsOn); + PipelineCollectFilesPhase; + + + + + + + + $([System.String]::new($(WebPublishPipelineProjectDirectory)\$([System.IO.Path]::GetDirectoryName($([System.String]::new(%(DestinationRelativePath)))))).TrimEnd('\'))\$(ProjectConfigTransformFileName) + $(TransformWebConfigIntermediateLocation)\original + $(TransformWebConfigIntermediateLocation)\assist + $(TransformWebConfigIntermediateLocation)\transformed\%(DestinationRelativePath) + $([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)\%(DestinationRelativePath))) + + <_WebConfigsToTransformOuputs Include="@(WebConfigsToTransform->'%(TransformOutputFile)')" /> + + + + + + + + + + + CollectWebConfigsToTransform; + + + + + + + + <_TempNoTransformWebConfigToTransform Include="@(WebConfigsToTransform)" + Condition="!Exists(%(TransformFile))" /> + + + + + + <_WebConfigsToTransformOuputsDirectories>@(_WebConfigsToTransformOuputs->'%(RootDir)%(Directory)') + + + + <_WebConfigsToTransformOuputsDirectories Include="$(_WebConfigsToTransformOuputsDirectories)" /> + + + + <_MessageArguments>@(WebConfigsToTransform->'%(DestinationRelativePath)', ', ') + + + + + + + + <_WebConfigTransformOutput>@(WebConfigsToTransform->'%(TransformOutputFile)') + <_WebConfigTransformOutput Condition="$(UseParameterizeToTransformWebConfig)">$(_WebConfigTransformOutput);$(_WebConfigTransformOutputParametersFile) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreTransformWebConfig; + + + + + + + + + + + + + + + + PreTransformWebConfig; + + + + + + + + + + + + + + + + + + + + + + + + + TransformWebConfigCore; + ParameterizeTransformWebConfigCore; + + + + + + + + + + + + + + + + + + + + + + %(_ImportParameterizeTransformWebConfig.DefaultValue) + $(UserWebConfigParametersPriority) + + + + + + + + + + + + + + $(OnBeforeMarkWebConfigAssistFilesAsExclude); + $(MarkWebConfigAssistFilesAsExcludeDependsOn); + + + + + + + <_AllProjectConfigsInFiles Include="@(FilesForPackagingFromProject)" + Condition="'%(FilesForPackagingFromProject.Filename)%(FilesForPackagingFromProject.Extension)'=='$(ProjectConfigFileName)'" /> + + + + + + + + + + + + + + True + + + + + + + + + + + + $(ProfileTransformWebConfigBeforeTargets); + MarkWebConfigAssistFilesAsExclude; + + + $(ProfileTransformWebConfigAfterTargets); + TransformWebConfig; + + + $(OnBeforeProfileTransformWebConfig); + $(ProfileTransformWebConfigDependsOn); + PreProfileTransformWebConfig; + ProfileTransformWebConfigCore; + ParameterizeProfileTransformWebConfigCore; + PostProfileTransformWebConfig; + + + + + + + + + + + + + + + $(OnBeforeCollectFilesForProfileTransformWebConfigs); + $(CollectFilesForProfileTransformWebConfigsDependsOn); + PipelineCollectFilesPhase; + + + + + + + + + $(WebPublishPipelineProjectDirectory)\$([System.IO.Path]::GetDirectoryName($([System.String]::new(%(DestinationRelativePath)))))\$(ProjectProfileTransformFileName) + $(ProfileTransformWebConfigIntermediateLocation)\original + $(ProfileTransformWebConfigIntermediateLocation)\assist + $(ProfileTransformWebConfigIntermediateLocation)\transformed\%(DestinationRelativePath) + $([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)\%(DestinationRelativePath))) + + <_ProfileWebConfigsToTransformOuputs Include="@(ProfileWebConfigsToTransform->'%(TransformOutputFile)')" /> + + + + + + + + + + CollectFilesForProfileTransformWebConfigs; + + + + + + + + + <_TempNoTrnasformFileForProfileWebConfigsToTransform Include="@(ProfileWebConfigsToTransform)" + Condition="!Exists(%(TransformFile))" /> + + + + + + + <_ProfileWebConfigsToTransformOuputsDirectories>@(_ProfileWebConfigsToTransformOuputs->'%(RootDir)%(Directory)') + + + + <_ProfileWebConfigsToTransformOuputsDirectories Include="$(_ProfileWebConfigsToTransformOuputsDirectories)" /> + + + + + <_MessageArguments>@(ProfileWebConfigsToTransform->'%(DestinationRelativePath)', ', ') + + + + + + + + <_ProfileWebConfigTransformOutput>@(ProfileWebConfigsToTransform->'%(TransformOutputFile)') + <_ProfileWebConfigTransformOutput Condition="$(UseParameterizeToProfileTransformWebConfig)">$(_ProfileWebConfigTransformOutput);$(_ProfileWebConfigTransformOutputParametersFile) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreProfileTransformWebConfig; + + + + + + + + + + + + + + PreProfileTransformWebConfig; + + + + + + + + + + + + + + + + + + + + + + + + ProfileTransformWebConfigCore; + ParameterizeProfileTransformWebConfigCore; + + + + + + + + + + + + + + + + + + + + + + + %(_ImportParameterizeProfileTransformWebConfig.DefaultValue) + $(UserWebConfigParametersPriority) + + + + + + + + + + + + + ProfileTransformWebConfig; + + + + + + <_WebConfigsToInsertAdditionalCS Include="@(FilesForPackagingFromProject)" + Condition="$(InsertAdditionalWebConfigConnectionStringOnlyInRoot) + And '%(FilesForPackagingFromProject.Filename)%(FilesForPackagingFromProject.Extension)'=='$(ProjectConfigFileName)' + And !%(FilesForPackagingFromProject.Exclude) + And '%(DestinationRelativePath)' == '$(ProjectConfigFileName)'"> + $(InsertAdditionalWebCofigConnectionStringsLocation)\original + $(InsertAdditionalWebCofigConnectionStringsLocation)\assist + $(InsertAdditionalWebCofigConnectionStringsLocation)\transformed\%(DestinationRelativePath) + $([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)\%(DestinationRelativePath))) + + <_WebConfigsToInsertAdditionalCS Include="@(FilesForPackagingFromProject)" + Condition="!$(InsertAdditionalWebConfigConnectionStringOnlyInRoot) + And '%(FilesForPackagingFromProject.Filename)%(FilesForPackagingFromProject.Extension)'=='$(ProjectConfigFileName)' + And !%(FilesForPackagingFromProject.Exclude)"> + $(InsertAdditionalWebCofigConnectionStringsLocation)\original + $(InsertAdditionalWebCofigConnectionStringsLocation)\assist + $(InsertAdditionalWebCofigConnectionStringsLocation)\transformed\%(DestinationRelativePath) + $([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)\%(DestinationRelativePath))) + + <_WebConfigsToInsertAdditionalCSOuputFiles Include="@(_WebConfigsToInsertAdditionalCS->'%(TransformOutputFile)')"> + + + + + <_WebConfigsToInsertAdditionalCSOuputDirectories>@(_WebConfigsToInsertAdditionalCSOuputFiles->'%(RootDir)%(Directory)') + <_WebConfigsToInsertAdditionalCSOuput>@(_WebConfigsToInsertAdditionalCS->'%(TransformOutputFile)'); + + + + <_WebConfigsToInsertAdditionalCSOuputDirectories Include="$(_WebConfigsToInsertAdditionalCSOuputDirectories)" /> + + + + + + + + + + + + + + + + <_InsertAdditionalConnectionStringNamesPrepare Include="@(_ConnectionStringsToInsert)"> + %(_ConnectionStringsToInsert.Identity) + %(_ConnectionStringsToInsert.Identity)_ConnectionString + + <_InsertAdditionalConnectionStringNames Include="@(_InsertAdditionalConnectionStringNamesPrepare)"> + + <add + name="%(_InsertAdditionalConnectionStringNamesPrepare.ConnectionStringName)" + connectionString="%(_InsertAdditionalConnectionStringNamesPrepare.ConnectionString)" + providerName="$(InsertAdditionalWebConfigConnectionStringProviderName)" + xdt:Transform="InsertIfMissing" + xdt:Locator="Match(name)" + xdt:SupressWarnings="True" + /> + + + + + + + + <_WebConfigsToInsertAdditionalCS_Transform><?xml version="1.0"?> + <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> + <connectionStrings xdt:Transform="InsertIfMissing" xdt:SupressWarnings="True"> + @(_InsertAdditionalConnectionStringNames->'%(TransformXMLFragement)', '') + </connectionStrings> + </configuration> + + + + + + + + + + + + + + + + + + + + + + <_WebConfigToInsertAdditionalCS_Identity>%(_WebConfigsToInsertAdditionalCS.Identity) + <_WebConfigToInsertAdditionalCS_TransformOutputFile>%(_WebConfigsToInsertAdditionalCS.TransformOutputFile) + <_WebConfigsToInsertAdditionalCS_TransformScope>%(_WebConfigsToInsertAdditionalCS.TransformScope) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforeInsertAdditionalWebCofigConnectionStrings); + $(InsertAdditionalWebCofigConnectionStringsDependsOn); + TransformWebConfig; + ProfileTransformWebConfig; + PreInsertAdditionalWebCofigConnectionStrings; + InsertAdditionalWebCofigConnectionStringsCore; + PostInsertAdditionalWebCofigConnectionStrings; + + + $(InsertAdditionalWebCofigConnectionStringsBeforeTargets); + PreAutoParameterizationWebConfigConnectionStrings; + AutoParameterizationWebConfigConnectionStrings; + + + + + + + + + + + + PipelineTransformPhase; + + + + + + <_WebConfigsToAutoParmeterizeCS Include="@(FilesForPackagingFromProject)" + Condition="'%(FilesForPackagingFromProject.Filename)%(FilesForPackagingFromProject.Extension)'=='$(ProjectConfigFileName)' And !%(FilesForPackagingFromProject.Exclude)"> + $(AutoParameterizationWebConfigConnectionStringsLocation)\original + $(AutoParameterizationWebConfigConnectionStringsLocation)\assist + $(AutoParameterizationWebConfigConnectionStringsLocation)\transformed\%(DestinationRelativePath) + $([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)\%(DestinationRelativePath))) + + <_WebConfigsToAutoParmeterizeCSOuputFiles Include="@(_WebConfigsToAutoParmeterizeCS->'%(TransformOutputFile)')"> + + + + + <_WebConfigsToAutoParmeterizeCSOuputDirectories>@(_WebConfigsToAutoParmeterizeCSOuputFiles->'%(RootDir)%(Directory)') + <_WebConfigsToAutoParmeterizeCSOuput>@(_WebConfigsToAutoParmeterizeCS->'%(TransformOutputFile)');$(_WebConfigsToAutoParmeterizeCsTransformOutputParametersFile) + + + + <_WebConfigsToAutoParmeterizeCSOuputDirectories Include="$(_WebConfigsToAutoParmeterizeCSOuputDirectories)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(DeployParameterPrefix)%24(name)-$(ProjectConfigFileName) Connection String + %24(name) $(_PublishLocalizedString_WebConfigConnectionStringParameterDescription) + + + + + + + + + + + + + + + + + + + + + + + + + <_AutoParameterizeCSTransform>$(_AutoParameterizeCSTransformWithDefaultValue) + <_AutoParameterizeCSTransform Condition="$(AutoParameterizationWebConfigCSNoDefaultValue)">$(_AutoParameterizeCSTransformNoDefaultValue) + <_AutoParameterizeCSUseXPath Condition="'$(_AutoParameterizeCSUseXPath)'==''">True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %(_ImportAutoParameterizeCSTransformWebConfig.DefaultValue) + $(VsWebConfigAutoCsParametersPriority) + + + + + + + + + + + + $(OnBeforeAutoParameterizationWebConfigConnectionStrings); + $(AutoParameterizationWebConfigConnectionStringsDependsOn); + PipelineTransformPhase; + PreAutoParameterizationWebConfigConnectionStrings; + AutoParameterizationWebConfigConnectionStringsCore; + PostAutoParameterizationWebConfigConnectionStrings; + + + + + + + + + + + + True + + + $(OnBeforePipelineTransformPhase); + $(PipelineTransformPhaseDependsOn); + PipeLineCollectFilesPhase; + TransformWebConfig; + ProfileTransformWebConfig; + InsertAdditionalWebCofigConnectionStrings; + MarkWebConfigAssistFilesAsExclude; + + + + + + + + + + + + + + + + + + + + + + $(PipelineMsdeploySpecificTransformPhaseBeforeTargets); + CopyAllFilesToSingleFolderForMsdeploy; + PipelineCopyAllFilesToOneFolderForMsdeploy; + PipelineDeployPhase; + + + $(OnBeforePipelineMsdeploySpecificTransformPhase); + $(PipelineMsdeploySpecificTransformPhaseDependsOn); + InsertAdditionalWebCofigConnectionStrings; + PreAutoParameterizationWebConfigConnectionStrings; + AutoParameterizationWebConfigConnectionStrings; + + + + + + + + + + + + + + + + + + + + + + <_WPPCopyWebApplicationDependsOn> + $(OnBefore_WPPCopyWebApplication); + $(_WPPCopyWebApplicationDependsOn); + CleanWebProjectOutputDir; + PipelineTransformPhase; + + + + + + <_AllExtraFilesUnderProjectOuputFolder Include="$(WebProjectOutputDir)\**" /> + <_AllExtraFilesUnderProjectOuputFolder + Remove="@(FilesForPackagingFromProject->'$(WebProjectOutputDir)\%(DestinationRelativePath)')" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforePipelinePreDeployCopyAllFilesToOneFolder); + $(PipelinePreDeployCopyAllFilesToOneFolderDependsOn); + PipelineTransformPhase; + CopyAllFilesToSingleFolderForPackage; + + + + + + + + + + + + + + + $(OnBeforeCopyAllFilesToSingleFolderForMsdeploy); + CleanWebsitesWPPAllFilesInSingleFolder; + + + $(OnBeforeCopyAllFilesToSingleFolderForMsdeploy); + $(CopyAllFilesToSingleFolderForMsdeployDependsOn); + + + + + + + <_AllExtraFilesUnderTempFolder Include="$(WPPAllFilesInSingleFolder)\**" /> + <_AllExtraFilesUnderTempFolder + Remove="@(FilesForPackagingFromProject->'$(WPPAllFilesInSingleFolder)\%(DestinationRelativePath)')" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + $(OnBeforePipelineCopyAllFilesToOneFolderForMsdeploy); + $(PipelineCopyAllFilesToOneFolderForMsdeployDependsOn); + PipelineTransformPhase; + CopyAllFilesToSingleFolderForMsdeploy; + + + + + + + + + + + + + + + + + + + + + + _CheckPublishToolsUpToDate + + + + + + + $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Inetstp@MajorVersion) + 0 + + + + + + + + + <_DeploymentUseIis Condition="'$(_DeploymentUseIis)'=='' And $(IncludeIisSettings)">$(UseIis) + <_DeploymentUseIis Condition="'$(_DeploymentUseIis)'==''">False + <_DeploymentAsIisApp>$(DeployAsIisApp) + <_DeploymentAsIisApp Condition="$(_DeploymentUseIis)">False + $(UseIis) + False + <_DeploymentUseIISExpressHint>$(UseIISExpress) + <_DeploymentUseIISExpressHint Condition="'$(_DeploymentUseIISExpressHint)'==''">False + + + + + + + + + + + + + + + + + + + + + + + <_Destination_IisServer_IisAppPoolName Condition="'@(_IISApplicationPoolFound)'!=''">%(_IISApplicationPoolFound.DestinationIISApplicationPool) + <_Destination_IisServer_IisAppPoolName Condition="'$(_Destination_IisServer_IisAppPoolName)'==''">$(IisServer_IisAppPoolName) + + + + <_IsRootWebsite>False + <_IsRootWebsite Condition="('$(IisUrl_SiteRelativePath)' == '/')">True + $(DefaultDeployIisRootAppPath) + $(IisServer_IisMajorVersion) + $(LocalIisVersion) + + + + + + + + + + + + + + + + + + + + + + + <_MSDeployInstalledVersionPath Include="@(_MSDeployInstalledVersionPathFromRegistry)"> + $([MSBuild]::GetRegistryValue('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\%(_MSDeployInstalledVersionPathFromRegistry.Identity)', 'InstallPath')) + $([MSBuild]::GetRegistryValue('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\%(_MSDeployInstalledVersionPathFromRegistry.Identity)', 'Version')) + + <_MSDeployInstalledVersions Include="@(_MSDeployInstalledVersionPath)" Condition="'%(_MSDeployInstalledVersionPath.InstallPath)'!='' And '%(_MSDeployInstalledVersionPath.DllVersionString)'!=''" > + $([System.Version]::New(%(_MSDeployInstalledVersionPath.DllVersionString)).Major).$([System.Version]::New(%(_MSDeployInstalledVersionPath.DllVersionString)).Minor) + + + + + + + + + <_MSDeployInstalledVersions Remove="@(_NeedtoRemove_MSDeployInstalledVersions)" /> + + + + + + + + <_DefaultMSDeployMaxVersion>0 + <_DefaultMSDeployMaxVersion Condition="'%(_MSDeployInstalledVersions.Identity)' != ''">$([System.Math]::Max($([System.Convert]::ToUInt32('$(_DefaultMSDeployMaxVersion)')),$([System.Convert]::ToUInt32('%(_MSDeployInstalledVersions.Identity)')))) + + + + + + <_SelectedMSDeployMaxVersion Include="@(_MSDeployInstalledVersions)" + Condition="'%(_MSDeployInstalledVersions.Identity)' =='$(_DefaultMSDeployMaxVersion)' " /> + + + + + <_SelectedMSDeployPath Include="@(_MSDeployInstalledVersions)" + Condition="'%(_MSDeployInstalledVersions.InstallPath)' =='$(MSDeployPath)' " /> + + + <_MSDeployVersionsToTry>@(_SelectedMSDeployPath->'%(DllVersion)') + + + + + <_MSDeployVersionsToTry Condition="'$(_MSDeployVersionsToTry)' == ''">@(_SelectedMSDeployMaxVersion->'%(DllVersion)') + @(_SelectedMSDeployMaxVersion->'%(InstallPath)') + + + + + + + + + + + + + + PipelineCopyAllFilesToOneFolderForMsdeploy; + ImportPublishingParameterValues; + PipelineMsdeploySpecificTransformPhase; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_PackageFileLocation Include="$(PackageFileName)" /> + + + + <_PackageRoot Condition="$(PackageAsSingleFile)">@(_PackageFileLocation->'%(RootDir)%(Directory)') + <_PackageRoot Condition="!$(PackageAsSingleFile)">$(PackageArchiveRootDir) + + + + + + + + + $(OnBeforeCopyAllFilesToSingleFolderForPackage); + CleanWebsitesWPPAllFilesInSingleFolder; + + + $(OnBeforeCopyAllFilesToSingleFolderForPackage); + $(CopyAllFilesToSingleFolderForPackageDependsOn); + + + + + + + <_AllExtraFilesUnderTempFolder Include="$(WPPAllFilesInSingleFolder)\**" /> + <_AllExtraFilesUnderTempFolder + Remove="@(FilesForPackagingFromProject->'$(WPPAllFilesInSingleFolder)\%(DestinationRelativePath)')" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + $(BeforeAddIis7ToSourceManifest); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + + + + + + + + + + $(_MSDeployIisUrlSource_AppHostConfigPath) + + + + + + + + + + + + + + + + + $(BeforeAddDeclareParametersItemsForIis7); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + + + + + + + + + + ProviderPath + AppHostConfig + ^$(_EscapeRegEx_MSDeployIisUrlSource_AppHostConfigPath)$ + $(DeployParameterIISAppNameDescription) + $(_MSDeployIisAppPathIIS7) + $(_MSDeployIisAppPathIIS7) + IisApp + $(VsIisAppParametersPriority) + + + + DeploymentObjectAttribute + application + application[@applicationPool='$(IisServer_IisAppPoolName)']/@applicationPool + $(DeployParameterIISAppPoolNameDescription) + $(_Destination_IisServer_IisAppPoolName) + $(_Destination_IisServer_IisAppPoolName) + + $(VsIisAppParametersPriority) + + + + + + + + + + + + + + + + + + $(BeforeAddIis6ToSourceManifest); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + + + + + + + + + + + $(_MSDeployIisUrlSource_MetakeyPath) + + + + + + + + + + + + + + + + $(BeforeAddDeclareParametersItemsForIis6); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + + + + + + + + + + + + + + + ProviderPath + MetaKey + ^$(_EscapeRegEx_MSDeployIisUrlSource_MetakeyPathSearchPath)$ + $(DeployParameterIISAppNameDescription) + $(_MSDeployIisAppPathIIS6) + $(_MSDeployIisAppPathIIS6) + IisApp + $(VsIisAppParametersPriority) + + + + DeploymentObjectAttribute + metaProperty + metaProperty[@name='AppPoolId' and @value='$(IisServer_IisAppPoolName)']/@value + $(DeployParameterIISAppPoolNameDescription) + $(_Destination_IisServer_IisAppPoolName) + $(_Destination_IisServer_IisAppPoolName) + + $(VsIisAppParametersPriority) + + + + + + + + + + + + + + + + + + + $(BeforeAddIisSettingAndFileContentsToSourceManifest); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + AddContentPathToSourceManifest; + + + + + + + + + + + + + + + + + $(BeforeAddContentPathToSourceManifest); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + AddIis7ToSourceManifest; + AddIis6ToSourceManifest + + + + + + + + + + + + + <_DeployManagedRuntimeVersion Condition="'$(DeployManagedRuntimeVersionNumeric)' != '' And ($(DeployManagedRuntimeVersionNumeric) >= '4.0') ">$(DeployManagedRuntimeVersion) + + <_DeployManagedRuntimeVersion Condition="'$(DeployManagedRuntimeVersionNumeric)' == '' And '$(DeployManagedRuntimeVersion)'!=''">$(DeployManagedRuntimeVersion) + + + + + + $(_MSDeployDirPath_FullPath) + $(_DeployManagedRuntimeVersion) + $(DeployEnable32bitAppOnWin64) + $(DeployManagedPipelineMode) + managedRuntimeVersion;enable32bitAppOnWin64;managedPipelineMode + + + + $(_MSDeployDirPath_FullPath) + + + + + $(_MSDeployDirPath_FullPath) + Directory + setAclResourceType + + + + + $(_MSDeployDirPath_FullPath) + anonymousAuthenticationUser + Directory + setAclUser;setAclResourceType + + + + + $(_MSDeployDirPath_FullPath)\App_Data + Write + Directory + setAclResourceType;setAclAccess + + + + + + + + + + + + + + + + + $(BeforeAddIisAndContentDeclareParametersItems); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + AddDeclareParametersItemsForContentPath; + + + + + + + + + + + + + + + + + $(BeforeAddDeclareParametersItemsForContentPath); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + AddDeclareParametersItemsForIis7; + AddDeclareParametersItemsForIis6; + + + + + + + + <_DestinationContentPath>$(_DestinationIisAppPhysicalPath) + + <_DestinationContentPath Condition="($(DestinationUseIis) or $(_DeploymentAsIisApp)) And ($(DestinationIisVersion) < '7') And ('$(_MSDeployIisAppPathIIS6)'!= '') " >$(_MSDeployIisAppPathIIS6) + + <_DestinationContentPath Condition="($(DestinationUseIis) or $(_DeploymentAsIisApp)) And ($(DestinationIisVersion) >= '7') And ('$(_MSDeployIisAppPathIIS7)' !='')">$(_MSDeployIisAppPathIIS7) + + <_MsDeployParameterNameForContentPath>$(DeployParameterIISAppName) + <_MsDeployParameterNameForContentPath Condition="$(_DeploymentUseIis) And (!$(DestinationUseIis))">$(DeployParameterIISAppPhysicalPath) + <_MsDeployParameterTagForContentPath>PhysicalPath + <_MsDeployParameterTagForContentPath Condition="$(_DeploymentAsIisApp)">IisApp + <_MsDeployParameterDefaultValueForContentPath>$(_DestinationContentPath) + <_MsDeployParameterExcludeSetParameterForContentPath>False + <_MsDeployParameterPhysicalFolderForSetAcl>{$(_MsDeployParameterNameForContentPath)} + <_MsDeployParameterPhysicalFolderAppDataForSetAcl>{$(_MsDeployParameterNameForContentPath)}/App_Data + + + + + + + + + + + + + + + + + ProviderPath + IisApp + ^$(_EscapeRegEx_MSDeployDirPath)$ + $(DeployParameterIISAppNameDescription) + $(_MsDeployParameterDefaultValueForContentPath) + $(_DestinationContentPath) + $(_MsDeployParameterTagForContentPath) + $(VsIisAppParametersPriority) + $(_MsDeployParameterExcludeSetParameterForContentPath) + + + + ProviderPath + contentPath + ^$(_EscapeRegEx_MSDeployDirPath)$ + $(DeployParameterIISAppPhysicalPathDescription) + $(_MsDeployParameterDefaultValueForContentPath) + $(_DestinationContentPath) + $(_MsDeployParameterTagForContentPath) + $(VsContentPathParametersPriority) + $(_MsDeployParameterExcludeSetParameterForContentPath) + + + + + + + + ProviderPath + setAcl + ^$(_EscapeRegEx_MSDeployDirPath)$ + $(DeployParameterIISAppPhysicalPathDescription) + $(_MsDeployParameterDefaultValueForContentPath) + $(_DestinationContentPath) + + $(_MsDeployParameterExcludeSetParameterForContentPath) + $(VsSetAclPriority) + + + + ProviderPath + setAcl + ^$(_EscapeRegEx_MSDeployDirPath)\\App_Data$ + Add write permission to App_Data folder + {$(_MsDeployParameterNameForContentPath)}/App_Data + $(_DestinationContentPath)/App_Data + Hidden + $(VsSetAclPriority) + True + + + + + + + + + + + + + + + + + + + + + + $(BeforeWriteItemsToSourceManifest); + $(WriteItemsToSourceManifestDependsOn); + AddIisSettingAndFileContentsToSourceManifest; + + + + + + + + + + + + + + + + + + + + + + + $(BeforeAddDeclareParametersItems); + AddIisAndContentDeclareParametersItems; + AddDeclareParametersItemsForDatabaseScript; + + + + + <_PublishDefaultVDirectoryPath>$(RemoteSitePhysicalPath) + <_PublishDefaultVDirectoryPath Condition="'$(_PublishDefaultVDirectoryPath)'==''">$(_DestinationIisAppPhysicalPath) + + + + + + + + <_MSBuildReplaceRuleItemMSBuildProjectDirectory Include="$(WebPublishPipelineProjectDirectory)" /> + + + + + + + + + DestinationVirtualDirectory + .* + ^$(_EscapeRegExMSBuildProjectDirectory)$ + $(DeployParameterIISAppPhysicalPathDescription) + $(_DestinationIisAppPhysicalPath) + + $(_PublishDefaultVDirectoryPath) + PhysicalPath + $(VsDestinationVDirParametersPriority) + + + + + + + + + + + + + <_GatherParamsDependsOn> + $(_GatherParamsDependsOn); + GetProjectWebProperties; + ImportParametersFiles; + TransformWebConfig; + ProfileTransformWebConfig; + AutoParameterizationWebConfigConnectionStrings; + AddDeclareParametersItems; + ImportPublishingParameterValues; + + + + + + + + + + + + + + + + + + + + + + <_MSDeployDirPath Include="$(WPPAllFilesInSingleFolder)" /> + + + + + + + + + + + + + + + + + + + <_MSDeployDirPath_FullPath>@(_MSDeployDirPath->'%(FullPath)') + <_MSDeployIisAppPathIIS7>$(DeployIisAppPath) + <_MSDeployIisAppPathIIS6>$(DeployIisAppPath) + <_MSDeployIisAppPathIIS7 Condition="'$(_MSDeployIisAppPathIIS7)'==''">$(DefaultDeployIisAppPath) + <_MSDeployIisAppPathIIS6 Condition="'$(_MSDeployIisAppPathIIS6)'==''">$(DefaultDeployIisAppPath) + + + + <_MSDeploySourceManifest Include="$(PackageSourceManifest)" /> + <_MSDeployParametersFile Include="$(PackageParametersFile)" /> + <_MSDeploySampleParametersValue Condition="$(GenerateSampleDeployScript)" Include="$(GenerateSampleParametersValueLocation)" /> + <_MSDeployGenerateSampleDeployScriptReadMeLocation Condition="$(GenerateSampleDeployScript)" Include="$(GenerateSampleDeployScriptReadMeLocation)" /> + + + + + + + GenerateMsDeployManifestSettings; + + + + + + + + + + + + + + + + + + + + + + + + + + + + GenerateMsDeployManifestSettings; + CleanWebsitesPackageCore; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GenerateMsDeployManifestSettings; + + + + + + + + + + + + + + + + + + $(OnAfterGenerateMsdeployManifestFiles); + AddDeclareParametersItems; + CheckAndCleanMSDeployPackageIfNeeded; + + + $(GenerateMsdeployManifestFilesDependsOn); + PipelineCopyAllFilesToOneFolderForMsdeploy; + GenerateMsDeployManifestSettings; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dirPath + $(_Escaped_WPPAllFilesInSingleFolder)\\App_Data$ + Source + + + + + dirPath + $(_Escaped_DestinationContentPath)\\App_Data$ + Destination + + + + + + + + + + + + $(OnBeforePackageUsingManifest); + $(PackageUsingManifestDependsOn); + GetMSDeployInstalledVersionPath; + GenerateMsDeployManifestSettings; + GenerateMsdeployManifestFiles; + GenerateSkipRuleForAppData; + + + + + + + + manifest + @(_MSDeploySourceManifest->'%(FullPath)') + + archiveDir + @(_MSDeployArchiveDir->'%(FullPath)') + package + @(_MSDeployPackageFile->'%(FullPath)') + True + + + + + + + + + $(PackageSourceRoot) + $(DeployEncryptKey) + $(IisServer_WebServerAppHostConfigDirectory) + $(IisServer_WebServerManifest) + $(IisServer_WebServerDirectory) + + + + $(PackageDestinationRoot) + $(DeployEncryptKey) + False + + + + + + + + + + + + + + + + <_VsPackageParametersFile> + <_VsPackageParametersFile Condition="$(UseDeclareParametersXMLInMsDeploy)">$(PackageParametersFile) + + + + <_Package_MsDeployDeclareParameters Include="@(MsDeployDeclareParameters)" Condition="!$(UseDeclareParametersXMLInMsDeploy)" /> + + + + + + + + + + + + + + + + + + + + + + + GetMSDeployInstalledVersionPath; + GenerateMsDeployManifestSettings; + GenerateMsdeployManifestFiles; + Package; + + + + + + + + + + + manifest + @(_MSDeploySourceManifest->'%(FullPath)') + package + @(_MSDeployPackageFile->'%(FullPath)') + archiveDir + @(_MSDeployArchiveDir->'%(FullPath)') + + auto + + + + + + + + $(TestDeployPackageToLocalSourceRoot) + $(DeployEncryptKey) + + + + $(TestDeployPackageToLocalDestinationRoot) + $(DeployEncryptKey) + False + + + + + + + + + + + + + + + + + + + true + Basic + + WMSVC + + GetProjectWebProperties; + ValidateGlobalSettings; + + + + + + <_UseWMSVC>false + <_UseWMSVC Condition="'$(MSDeployPublishMethod)'=='WMSVC'">true + <_UseRemoteAgent>false + <_UseRemoteAgent Condition="'$(MSDeployPublishMethod)'=='RemoteAgent'">true + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LinkExtensioninfo.xml + HttpCertConfigExtension;CertificateExtension;FrameworkConfigExtension + ContentExtension + + + + + + + + + false + + GenerateGlobalPublishSetting; + _CheckAzureNet46Support; + ValidateGlobalPackageSetting; + GenerateMsDeployManifestSettings; + GenerateMsdeployManifestFiles; + GenerateSkipRuleForAppData; + ImportPublishingParameterValues; + PipelineMsdeploySpecificTransformPhase; + Package; + + + + + + + + + + + + manifest + @(_MSDeploySourceManifest->'%(FullPath)') + package + @(_MSDeployPackageFile->'%(FullPath)') + archiveDir + @(_MSDeployArchiveDir->'%(FullPath)') + + + auto + + + + DoNotDeleteRule + + + + <_MSDeploySourceWebServerAppHostConfigDirectory>$(IisServer_WebServerAppHostConfigDirectory) + <_MSDeploySourceWebServerManifest>$(IisServer_WebServerManifest) + <_MSDeploySourceWebServerDirectory>$(IisServer_WebServerDirectory) + + + + + + + + + + + + <_PublishMsDeployServiceUrl>$(MsDeployServiceUrl) + <_PublishMsDeployServiceUrl Condition="('$(MSDeployPublishMethod)'=='INPROC')"> + + + + iisApp + contentPath + + + + + + $(MSDeployPublishSourceRoot) + $(DeployEncryptKey) + $(_MSDeploySourceWebServerAppHostConfigDirectory) + $(_MSDeploySourceWebServerManifest) + $(_MSDeploySourceWebServerDirectory) + + + + $(MSDeployPublishDestinationRoot) + $(_PublishMsDeployServiceUrl) + $(UserName) + $(Password) + $(DeployEncryptKey) + False + $(AuthType) + $(_MSDeployDestinationWebServerAppHostConfigDirectory) + $(_MSDeployDestinationWebServerManifest) + $(_MSDeployDestinationWebServerDirectory) + + + + + + + WebConfigEncryptProvider + $(MSDeployWebConfigEncryptProvider) + + + + + + + + + false + + + + + + + + + + + + <_VsPublishParametersFile> + <_VsPublishParametersFile Condition="$(UseDeclareParametersXMLInMsDeploy) and '$(_VsPublishParametersFile)'==''">$(PublishParametersFile) + + + + + + <_VsPublish_MsDeployDeclareParameters Include="@(MsDeployDeclareParameters)" Condition="!$(UseDeclareParametersXMLInMsDeploy) And !$(CreatePackageOnPublish)" /> + + + + + + + + <_EnableRuleList>$(MsDeployDoNotDeleteRule) + <_EnableRuleList Condition="'$(_EnableRuleList)'=='' and '$(EnableMSDeployAppOffline)'=='true'">AppOffline + <_EnableRuleList Condition="'$(_EnableRuleList)'!='' and '$(EnableMSDeployAppOffline)'=='true'">$(_EnableRuleList);AppOffline + <_EnableRuleList Condition="'$(_EnableRuleList)'=='' and '$(MSDeployEnableWebConfigEncryptRule)'=='true'">EncryptWebConfig + <_EnableRuleList Condition="'$(_EnableRuleList)'!='' and '$(MSDeployEnableWebConfigEncryptRule)'=='true'">$(_EnableRuleList);EncryptWebConfig + + + + + + + + + + + $(OnBeforeValidatePublishProfileSettings); + $(ValidatePublishProfileSettingsDependsOn); + + + + + + + + + + + + + + + + + + + + + + + + MSDeployPublish; + + + + + + + + + + + + Package; + + + + + + + + + + + + $(WebPublishDependsOn); + ValidatePublishProfileSettings; + + + $(WebPublishDependsOn); + Web$(WebPublishMethod)Publish; + + + + + + + + + + + + $(OnBeforePipelineDeployPhase); + $(PipelineDeployPhaseDependsOn); + $(DeployTarget); + + + $(PipelineDeployPhaseAfterTargets); + + + + + + + + + + + + + + + + + + $(DbDacFxPreviewDependsOn); + GetMSDeployInstalledVersionPath; + + + $(DbDacFxPreviewDependsOn); + LocalDbDacFxPreview; + + + $(DbDacFxPreviewDependsOn); + RemoteDbDacFxPreview; + + + + + + + + + + + + $(DbFullSqlPreviewDependsOn); + GetMSDeployInstalledVersionPath; + + + + + + + <_MsDeployDbFullSqlPreviewSourceNoPath Remove="@(_MsDeployDbFullSqlPreviewSourceNoPath)" /> + + + + + + + + <_MsDeployDbFullSqlPreviewSource Remove="@(_MsDeployDbFullSqlPreviewSource)" /> + <_MsDeployDbFullSqlPreviewSource Include="@(_MsDeployDbFullSqlPreviewSourceNoPath)"> + $(_MsDeployDBFullSqlPreviewSourceConnectionString) + + + <_MsDeployDbFullSqlPreviewDestination Remove="@(_MsDeployDbFullSqlPreviewDestination)" /> + <_MsDeployDbFullSqlPreviewDestination Include="DbFullSql"> + $(_MsDeployDbFullSqlPreviewOutputPath) + + + + + + + + + + + + + + + + $(ValidateDbDacFxPreviewSettingsDependsOn); + GetMSDeployInstalledVersionPath; + + + + + + + + + + + + + + + + + + + + + + + + + $(LocalDbDacFxPreviewDependsOn); + GetMSDeployInstalledVersionPath; + ValidateDbDacFxPreviewSettings; + + + + + + + <_MsDeployDbDacFxPreviewPreSourceOptions Remove="@(_MsDeployDbDacFxPreviewPreSourceOptions)" /> + <_MsDeployDbDacFxPreviewPreSourceOptions Include="DbDacFx"> + False + includeData + + + + + + + + + + <_MsDeployDbDacFxPreviewSource Remove="@(_MsDeployDbDacFxPreviewSource)" /> + <_MsDeployDbDacFxPreviewSource Include="DbDacFx"> + $([System.IO.Path]::GetFullPath($(_MsDeployDbDacFxPreviewDacpacFile))) + + + <_MsDeployDbDacFxPreviewDestination Remove="@(_MsDeployDbDacFxPreviewDestination)" /> + <_MsDeployDbDacFxPreviewDestination Include="DbDacFx"> + $(_MsDeployDbDacFxPreviewDestinationConnectionString) + Script + + + + + + + + + + + + + + + + $(RemoteDbDacFxPreviewDependsOn); + GetMSDeployInstalledVersionPath; + GenerateGlobalPublishSetting; + ValidateDbDacFxPreviewSettings; + _DetectDbDacFxProvider; + + + + + <_PublishMsDeployServiceUrl>$(MsDeployServiceUrl) + <_PublishMsDeployServiceUrl Condition="('$(MSDeployPublishMethod)'=='INPROC')"> + + + + + <_MsDeployDbDacFxPreviewPreSourceOptions Remove="@(_MsDeployDbDacFxPreviewPreSourceOptions)" /> + <_MsDeployDbDacFxPreviewPreSourceOptions Include="DbDacFx"> + False + includeData + + + + + + + + + + + + + + + <_MsDeployRemoteDbDacFxPreviewSource Remove="@(_MsDeployRemoteDbDacFxPreviewSource)" /> + <_MsDeployRemoteDbDacFxPreviewSource Include="DbDacFx"> + $([System.IO.Path]::GetFullPath($(_MsDeployDbDacFxPreviewDacpacFile))) + + + <_MsDeployRemoteDbDacFxPreviewDestination Remove="@(_MsDeployRemoteDbDacFxPreviewDestination)" /> + <_MsDeployRemoteDbDacFxPreviewDestination Include="DbDacFx"> + $(_MsDeployDbDacFxPreviewDestinationConnectionString) + $(_PublishMsDeployServiceUrl) + $(UserName) + $(Password) + $(AuthType) + $(_MSDeployDestinationWebServerAppHostConfigDirectory) + $(_MSDeployDestinationWebServerManifest) + $(_MSDeployDestinationWebServerDirectory) + Script + + + + + + + + + + + + + + + + + + + + + + + + <_PublishMsDeployServiceUrl>$(MsDeployServiceUrl) + <_PublishMsDeployServiceUrl Condition="('$(MSDeployPublishMethod)'=='INPROC')"> + <_MSDeployPublishSourceType>dbDacFx + + + + <_MsDeploySourceProviderSetting Remove="@(_MsDeploySourceProviderSetting)" /> + <_MsDeploySourceProviderSetting Include="$(_MSDeployPublishSourceType)"> + $(_PublishMsDeployServiceUrl) + $(UserName) + $(Password) + $(AuthType) + + <_DbDacFxDestinationPathesToPublish Include="$([MSBuild]::Escape($(_MsDeployDbDacFxPreviewDestinationConnectionString)))" /> + + + + + + + + + + + + + + + + + + + + + $(WebPublishPipelineProjectDirectory)\apiapp.json + + + + + + + + true + + + \ No newline at end of file diff --git a/eng/msbuild/web/Web/Microsoft.Web.Publishing/ImportAfter/Microsoft.Web.AzureAD.Publishing.targets b/eng/msbuild/web/Web/Microsoft.Web.Publishing/ImportAfter/Microsoft.Web.AzureAD.Publishing.targets new file mode 100644 index 00000000..3076855a --- /dev/null +++ b/eng/msbuild/web/Web/Microsoft.Web.Publishing/ImportAfter/Microsoft.Web.AzureAD.Publishing.targets @@ -0,0 +1,300 @@ + + + + + + $(PipelineTransformPhaseDependsOn);_TransformWebConfigForAzureAuthentication + + + + <_WebConfigTransformFolderForAzureAuthentication>$(_WPPDefaultIntermediateOutputPath)WebConfigTransformFolderForAzureAuthentication + + + <_WebConfigsToTransformForAzureAuthentication Include="@(FilesForPackagingFromProject)" + Condition="'%(FilesForPackagingFromProject.Filename)%(FilesForPackagingFromProject.Extension)'=='$(ProjectConfigFileName)' + And !%(FilesForPackagingFromProject.Exclude) + And '%(DestinationRelativePath)' == '$(ProjectConfigFileName)'"> + $(_WebConfigTransformFolderForAzureAuthentication)\original + $(_WebConfigTransformFolderForAzureAuthentication)\assist + $(_WebConfigTransformFolderForAzureAuthentication)\transformed\%(DestinationRelativePath) + $([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)\%(DestinationRelativePath))) + + <_WebConfigsToTransformForAzureAuthenticationOuputFiles Include="@(_WebConfigsToTransformForAzureAuthentication->'%(TransformOutputFile)')"> + + + + + <_WebConfigsToTransformForAzureAuthenticationOuputDirectories>@(_WebConfigsToTransformForAzureAuthenticationOuputFiles->'%(RootDir)%(Directory)') + <_WebConfigsToTransformForAzureAuthenticationOuput>@(_WebConfigsToTransformForAzureAuthentication->'%(TransformOutputFile)'); + + + + <_WebConfigsToTransformForAzureAuthenticationOuputDirectories Include="$(_WebConfigsToTransformForAzureAuthenticationOuputDirectories)" /> + + + + + + + + + + + + + + + + $(ADAppIDUri) + + + + + false + <_RemoveCertificateValidationTransform Condition="'$(RemoveCertValidationElement)' == 'true'"><certificateValidation certificateValidationMode="None" xdt:Transform="Remove" /> + <_RemoveExistingAudienceUrisTransform Condition="'$(PreserveExistingAudienceUris)' != 'true'"><add xdt:Transform="RemoveAll" /> + + + + <_ReplaceRealmAndAudienceUriAppSetting Condition="'$(ADWebAPIBased)'!='true' And '$(ADUsesOwinOrOpenIdConnect)'!='true'"> + <appSettings> + <add key="ida:AudienceUri" + value="{% parameter='AD_AudienceUriAppSetting' xpathlocator='key' description='AD Audience Uri App Setting' defaultValue='%24(value)' tags='AD_AudienceUriAppSetting' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + <add key="ida:Realm" + value="{% parameter='AD_RealmAppSetting' xpathlocator='key' description='AD Realm App Setting' defaultValue='%24(value)' tags='AD_RealmAppSetting' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + <add key="ida:FederationMetadataLocation" + value="{% parameter='AD_MetadataUrl' xpathlocator='key' description='AD MetadataUrl App Setting' defaultValue='%24(value)' tags='AD_MetadataUrlAppSetting' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADClientID Condition="'$(ADClientAPPID)'!='' And '$(ADUsesOwinOrOpenIdConnect)'!='true'"> + <appSettings> + <add key="ida:ClientID" + value="{% parameter='AD_ClientID' xpathlocator='key' description='AD Client Application ID' defaultValue='%24(value)' tags='AD_ClientAPPID' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADClientPassword Condition="'$(ADClientPassword)'!='' And '$(ADUsesOwinOrOpenIdConnect)'!='true'"> + <appSettings> + <add key="ida:Password" + value="{% parameter='AD_ClientPassword' xpathlocator='key' description='AD Client Password' defaultValue='%24(value)' tags='AD_Password' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADWebAPIAudienceAppSetting Condition="'$(ADWebAPIBased)'=='true' And '$(ADUsesOwinOrOpenIdConnect)'!='true'"> + <appSettings> + <add key="ida:Audience" + value="{% parameter='AD_WebAPI_Audience' xpathlocator='key' description='AD Web API Audience' defaultValue='%24(value)' tags='AD_WebAPI_Audience' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADWIFArtifacts Condition="'$(ADWebAPIBased)'!='true' And '$(ADUsesOwinOrOpenIdConnect)'!='true'"> + <system.identityModel> + <identityConfiguration> + $(_RemoveCertificateValidationTransform) + <audienceUris> + $(_RemoveExistingAudienceUrisTransform) + <add + value="APPIDUri" + xdt:Transform="Insert" xdt:SupressWarnings="True" /> + </audienceUris> + + <audienceUris> + <add + value="{% token='%24(value)' parameter='AD_%24(value)' xpathlocator='value' description='AD AppIDUri' defaultValue='%24(value)' tags='ADrealmUri' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" /> + </audienceUris> + + </identityConfiguration> + </system.identityModel> + <system.identityModel.services> + <federationConfiguration> + <wsFederation + realm="{% xpathlocator='requireHttps' parameter='AD_APPIDUri' description='AD AppIDUri' defaultValue='%24(realm)' tags='ADAPPIDUri' %}" + xdt:Transform="SetTokenizedAttributes(realm)" xdt:SupressWarnings="True" /> + <wsFederation + issuer="{% xpathlocator='requireHttps' parameter='AD_Issuer' description='AD Issuer' defaultValue='%24(issuer)' tags='ADISSUER' %}" + xdt:Transform="SetTokenizedAttributes(issuer)" xdt:SupressWarnings="True" /> + </federationConfiguration> + </system.identityModel.services> + + <_ReplaceADClientIDDev14 Condition="'$(ADClientAPPID)'!='' And '$(ADUsesOwinOrOpenIdConnect)'=='true'"> + <appSettings> + <add key="ida:ClientId" + value="{% parameter='AD_ClientID' xpathlocator='key' description='AD Client Application ID' defaultValue='%24(value)' tags='AD_ClientAPPID' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADClientPasswordDev14 Condition="'$(ADClientPassword)'!='' And '$(ADUsesOwinOrOpenIdConnect)'=='true'"> + <appSettings> + <add key="ida:ClientSecret" + value="{% parameter='AD_ClientPassword' xpathlocator='key' description='AD Client Password' defaultValue='%24(value)' tags='AD_Password' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADTenantIdDev14 Condition="'$(ADTenantId)'!='' And '$(ADUsesOwinOrOpenIdConnect)'=='true'"> + <appSettings> + <add key="ida:TenantId" + value="{% parameter='AD_TenantId' xpathlocator='key' description='AD Tenant Id' defaultValue='%24(value)' tags='AD_TenantId' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADDomainDev14 Condition="'$(ADDomain)'!='' And '$(ADUsesOwinOrOpenIdConnect)'=='true'"> + <appSettings> + <add key="ida:Domain" + value="{% parameter='AD_Domain' xpathlocator='key' description='AD Domain' defaultValue='%24(value)' tags='AD_Domain' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + <_ReplaceADPostLogoutRedirectUriDev14 Condition="'$(ADPostLogoutRedirectUri)'!='' And '$(ADUsesOwinOrOpenIdConnect)'=='true'"> + <appSettings> + <add key="ida:PostLogoutRedirectUri" + value="{% parameter='AD_PostLogoutRedirectUri' xpathlocator='key' description='AD PostLogoutRedirectUri' defaultValue='%24(value)' tags='AD_PostLogoutRedirectUri' %}" + xdt:Transform="SetTokenizedAttributes(value)" xdt:SupressWarnings="True" xdt:Locator="Match(key)"/> + </appSettings> + + + + + + $(ADClientAPPID) + + + $(ADIssuer) + + + https://login.windows.net/$(ADDomain)/FederationMetadata/2007-06/FederationMetadata.xml + + + $(ADClientPassword) + + + $(ADAppIDUri) + + + $(ADAppIDUri) + + + $(ADAppIDUri) + + + $(ADTenantId) + + + $(ADDomain) + + + $(ADPostLogoutRedirectUri) + + + + + + + + + <_WebConfigsToTransformForAzureAuthentication_Identity>%(_WebConfigsToTransformForAzureAuthentication.Identity) + <_WebConfigsToTransformForAzureAuthentication_TransformOutputFile>%(_WebConfigsToTransformForAzureAuthentication.TransformOutputFile) + <_WebConfigsToTransformForAzureAuthentication_TransformScope>%(_WebConfigsToTransformForAzureAuthentication.TransformScope) + + + + + + + + <_WebConfigsToTransformForAzureAuthenticationOutputFolder>$(_WPPDefaultIntermediateOutputPath)AzureAuthentication + <_WebConfigsToTransformForAzureAuthenticationOutputParametersFile>$(_WebConfigsToTransformForAzureAuthenticationOutputFolder)\TransformForAzureAuthentication.parameters.xml + + + + + + + + + + + + + %(_ImportAutoParameterizeAzureAuthenticationWebConfig.DefaultValue) + $(VsWebConfigAutoCsParametersPriority) + + + + + + + + + + + + + + + + + + <_TransformWebConfigForAzureAuthenticationDependsOn> + _TransformWebConfigForAzureAuthenticationCore; + _PostTransformWebConfigForAzureAuthentication; + + + + + + + + + + \ No newline at end of file diff --git a/eng/msbuild/web/Web/Microsoft.Web.XmlTransform.dll b/eng/msbuild/web/Web/Microsoft.Web.XmlTransform.dll new file mode 100644 index 00000000..95914431 Binary files /dev/null and b/eng/msbuild/web/Web/Microsoft.Web.XmlTransform.dll differ diff --git a/eng/msbuild/web/Web/Microsoft.WebSite.Publishing.targets b/eng/msbuild/web/Web/Microsoft.WebSite.Publishing.targets new file mode 100644 index 00000000..36e086a9 --- /dev/null +++ b/eng/msbuild/web/Web/Microsoft.WebSite.Publishing.targets @@ -0,0 +1,530 @@ + + + + + + + + + + + + + <_WebProjectType>WebSite + $([System.IO.Path]::GetTempPath())WebSitePublish\$([System.IO.Path]::GetFileName($(MSBuildProjectDirectory)))-$(MSBuildProjectDirectory.GetHashCode()) + $(OutputPath)\ + $(OutputPath) + + $(OutDir)\ + + + + $(OutputPath)obj\ + $(BaseIntermediateOutputPath)\ + + + + $(BaseIntermediateOutputPath)$(Configuration)\ + $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\ + $(IntermediateOutputPath)\ + + + + + + + + + + + + $(OutDir) + $(IntermediateOutputPath)AspnetCompileMerge\source + <_WDPSourceWebPhysicalPath>$(SourceWebPhysicalPath) + $(IntermediateOutputPath)TempBuildDir + <_ExcludeAppOffline Condition="'$(_ExcludeAppOffline)' ==''">true + <_ExcludeWebInfo Condition="'$(_ExcludeWebInfo)' ==''">true + + + + <_SkipHiddenItems Condition="'$(_SkipHiddenItems)'==''">true + + + + + + + + + + + + True + $(SourceWebProjectPath) + + + + false + + + + + + <_WDOutputPathItem Condition="'$(WDOutDir)' != '' and !HasTrailingSlash('$(WDOutDir)')" Include="$(WDOutDir)\_PublishedWebsites\$(MSBuildProjectName)\"/> + <_WDOutputPathItem Condition="'$(WDOutDir)' != '' and HasTrailingSlash('$(WDOutDir)')" Include="$(WDOutDir)_PublishedWebsites\$(MSBuildProjectName)\"/> + <_WDOutputPathItem Condition="'$(WDOutDir)' == ''" Include="$(OutputPath)"/> + <_WDPSourceWebPathItem Include="$(_WDPSourceWebPhysicalPath)"/> + <_KeyFile Include="$(KeyFile)"/> + + + + + Any CPU + + + + $(WDOutDir)\_PublishedWebsites\$(MSBuildProjectName)\ + <_FullSourceWebDir>$(_WDPSourceWebPhysicalPath) + <_FullKeyFile Condition="'$(KeyFile)' != ''">@(_KeyFile->'%(FullPath)') + + + + + <_AspNetCompilerFixedNames Condition="'$(UseMerge)' != 'true'">$(UseFixedNames) + <_AspNetCompilerKeyContainer Condition="'$(UseMerge)' != 'true'">$(KeyContainer) + <_AspNetCompilerMetabasePath Condition="'$(UseMetabasePath)' == 'true'">$(SourceWebMetabasePath) + <_AspNetCompilerSourceWebPath Condition="'$(UseMetabasePath)' != 'true'">$(_FullSourceWebDir) + <_AspNetCompilerVirtualPath Condition="'$(UseMetabasePath)' != 'true'">$(SourceWebVirtualPath) + + + + true + + + + false + + + + $(MSBuildProjectDirectory) + $(MSBuildProjectDirectory)$(DefaultMsDeployAltSuffix) + AllFilesInProjectFolder + + True + False + $(OutputPath)\Parameters.xml + <_WDPDefaultIntermediateOutputPathPathRoot Condition="'$(_WPPDefaultIntermediateOutputPathPathRoot)' == ''">$(OutputPath)\ + + + + <_WDPDefaultIntermediateOutputPath>$(IntermediateOutputPath) + <_WDPDefaultIntermediateOutputPath Condition="!$([System.IO.path]::IsPathRooted($(IntermediateOutputPath)))">$(_WDPDefaultIntermediateOutputPathPathRoot)$(IntermediateOutputPath) + + + + + + + + + + + + $(PreTransformWebConfigDependsOn); + FixupTransformAssistFilesAsExclude; + + + + + <_AllExecutableUnderBin Include="$(SourceWebPhysicalPath)\Bin\*.dll;$(SourceWebPhysicalPath)\Bin\*.exe"/> + + + + + + <_WDP_IdentifyTransformAssistFile>web\.[^\\\.]*\.config$ + + + + + + + + + + + + + + + Web.config + + + + + + + + + $(WDTargetDir) + + + <_FullSourceWebDir>$(_FullSourceWebDir) + + + + + + + + <_WebFiles> + + False + Unknown + Run + Default + + + + + + + + + + + + + + + <_OriginalSourceWebPhysicalFullPath>$([System.IO.Path]::GetFullPath($(SourceWebPhysicalPath))) + <_OriginalSourceWebPhysicalFullPath Condition="!HasTrailingSlash('$(_OriginalSourceWebPhysicalFullPath)')">$(_OriginalSourceWebPhysicalFullPath)\ + + + + + <_WebFilesExclude Include="%(ExcludeFromBuild.Identity)"> + $([System.String]::new(%(ExcludeFromBuild.FullPath)).SubString($(_OriginalSourceWebPhysicalFullPath.Length))) + + <_WebFilesExclude Condition="'%(SourceRelativePath)'==''"> + %(Identity) + + <_WebFilesNoMetadata Remove="%(_WebFilesExclude.SourceRelativePath)" Condition="'%(_WebFilesExclude.SourceRelativePath)' != ''"/> + + + + + + + + <_WebFiles Include="$([System.IO.Path]::Combine($(_WDPSourceWebPhysicalPath), %(_WebFilesNoMetadata.Identity)))" > + %(_WebFilesNoMetadata.Identity) + + + + + + <_WebFiles Remove="@(ExcludeFromBuild)" /> + + + + + + + + + + + <_WDPAllExtraFilesUnderTempFolder Condition="'$(CopyBeforeBuildTargetPath)' != ''" Include="$(CopyBeforeBuildTargetPath)\**" /> + <_WDPAllExtraFilesUnderTempFolder + Remove="@(FilesForPackagingFromProject->'$(CopyBeforeBuildTargetPath)\%(DestinationRelativePath)')" /> + + + + + + + + + + + + <_AspNetCompilerSourceWebPath>$(CopyBeforeBuildTargetPath) + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _PrepareForBuild; + ResolveProjectReferences; + _ResolveAssemblyReferencesWithRefreshFile; + ResolveReferences; + _CopyBeforeBuild; + + _CopyBeforeBuild + + + + + + + <_WDPOutputFiles> + + False + Unknown + Run + Default + + + + + + <_TempDirFullPath>$(MSBuildProjectDirectory)\$(TempBuildDir) + + + + + + + + + + + + + + <_WDPOutputFiles Include="@(_WDPOutputFilesNoMetadata)" > + %(_WDPOutputFilesNoMetadata.Identity) + + + + + + + + + <_CopyToOutputDirDependsOn> + $(_CopyToOutputDirDependsOn); + CoreCopyToOutputDir; + CleanTempBuildDir + + + + + + + + + <_WDPAllExtraFilesUnderTargetDir Condition="'$(WDTargetDir)' != ''" Include="$(WDTargetDir)\**" /> + <_WDPAllExtraFilesUnderTargetDir + Remove="@(_WDPOutputFiles->'$(WDTargetDir)\%(DestinationRelativePath)')" /> + + + + + + + + + + + + + + + + + + + + <_BuiltProjectOutputGroupOutput Include="$(WDTargetDir)**\*.*"/> + + %(_BuiltProjectOutputGroupOutput.SubFolder)%(_BuiltProjectOutputGroupOutput.RecursiveDir)%(Filename)%(Extension) + + + + + diff --git a/eng/msbuild/web/Web/Powershell/1.0.1/default-publish.ps1 b/eng/msbuild/web/Web/Powershell/1.0.1/default-publish.ps1 new file mode 100644 index 00000000..1f720165 --- /dev/null +++ b/eng/msbuild/web/Web/Powershell/1.0.1/default-publish.ps1 @@ -0,0 +1,101 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param($publishProperties, $packOutput, $nugetUrl) + +# to learn more about this file visit http://go.microsoft.com/fwlink/?LinkId=524327 +$publishModuleVersion = '1.0.1' +function Get-VisualStudio2015InstallPath{ + [cmdletbinding()] + param() + process{ + $keysToCheck = @('hklm:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Wow6432Node\Microsoft\VWDExpress\14.0', + 'hklm:\SOFTWARE\Microsoft\VWDExpress\14.0' + ) + [string]$vsInstallPath=$null + + foreach($keyToCheck in $keysToCheck){ + if(Test-Path $keyToCheck){ + $vsInstallPath = (Get-itemproperty $keyToCheck -Name InstallDir -ErrorAction SilentlyContinue | select -ExpandProperty InstallDir -ErrorAction SilentlyContinue) + } + + if($vsInstallPath){ + break; + } + } + + $vsInstallPath + } +} + +$vsInstallPath = Get-VisualStudio2015InstallPath +$publishModulePath = "{0}Extensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath,'1.0.1' + +if(!(Test-Path $publishModulePath)){ + $publishModulePath = "{0}VWDExpressExtensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath,'1.0.1' +} + +$defaultPublishSettings = New-Object psobject -Property @{ + LocalInstallDir = $publishModulePath +} + +function Enable-PackageDownloader{ + [cmdletbinding()] + param( + $toolsDir = "$env:LOCALAPPDATA\Microsoft\Web Tools\Publish\package-downloader-$publishModuleVersion\", + $pkgDownloaderDownloadUrl = 'http://go.microsoft.com/fwlink/?LinkId=524325') # package-downloader.psm1 + process{ + if(get-module package-downloader){ + remove-module package-downloader | Out-Null + } + + if(!(get-module package-downloader)){ + if(!(Test-Path $toolsDir)){ New-Item -Path $toolsDir -ItemType Directory -WhatIf:$false } + + $expectedPath = (Join-Path ($toolsDir) 'package-downloader.psm1') + if(!(Test-Path $expectedPath)){ + 'Downloading [{0}] to [{1}]' -f $pkgDownloaderDownloadUrl,$expectedPath | Write-Verbose + (New-Object System.Net.WebClient).DownloadFile($pkgDownloaderDownloadUrl, $expectedPath) + } + + if(!$expectedPath){throw ('Unable to download package-downloader.psm1')} + + 'importing module [{0}]' -f $expectedPath | Write-Output + Import-Module $expectedPath -DisableNameChecking -Force + } + } +} + +function Enable-PublishModule{ + [cmdletbinding()] + param() + process{ + if(get-module publish-module){ + remove-module publish-module | Out-Null + } + + if(!(get-module publish-module)){ + $localpublishmodulepath = Join-Path $defaultPublishSettings.LocalInstallDir 'publish-module.psm1' + if(Test-Path $localpublishmodulepath){ + 'importing module [publish-module="{0}"] from local install dir' -f $localpublishmodulepath | Write-Verbose + Import-Module $localpublishmodulepath -DisableNameChecking -Force + $true + } + } + } +} + +try{ + + if (!(Enable-PublishModule)){ + Enable-PackageDownloader + Enable-NuGetModule -name 'publish-module' -version $publishModuleVersion -nugetUrl $nugetUrl + } + + 'Calling Publish-AspNet' | Write-Verbose + # call Publish-AspNet to perform the publish operation + Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput +} +catch{ + "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error +} \ No newline at end of file diff --git a/eng/msbuild/web/Web/Powershell/1.0.1/filesystem.pubxml b/eng/msbuild/web/Web/Powershell/1.0.1/filesystem.pubxml new file mode 100644 index 00000000..16003111 --- /dev/null +++ b/eng/msbuild/web/Web/Powershell/1.0.1/filesystem.pubxml @@ -0,0 +1,13 @@ + + + + + FileSystem + wwwroot + $(OutDir)\$(Configuration)\PublishOutput + False + + \ No newline at end of file diff --git a/eng/msbuild/web/Web/Powershell/1.0.1/package.pubxml b/eng/msbuild/web/Web/Powershell/1.0.1/package.pubxml new file mode 100644 index 00000000..cb3cab5e --- /dev/null +++ b/eng/msbuild/web/Web/Powershell/1.0.1/package.pubxml @@ -0,0 +1,13 @@ + + + + + Package + wwwroot + $(OutDir)\$(Configuration)\MSDeployPackage\$(MSBuildProjectName).zip + Default Web Site + + \ No newline at end of file diff --git a/eng/msbuild/web/Web/Powershell/1.0.1/publish-module.psm1 b/eng/msbuild/web/Web/Powershell/1.0.1/publish-module.psm1 new file mode 100644 index 00000000..ba97dc69 --- /dev/null +++ b/eng/msbuild/web/Web/Powershell/1.0.1/publish-module.psm1 @@ -0,0 +1,658 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param() + +$script:AspNetPublishHandlers = @{} + +$global:AspNetPublishSettings = New-Object -TypeName PSCustomObject @{ + MsdeployDefaultProperties = @{ + 'MSDeployUseChecksum'=$false + 'WebRoot'='wwwroot' + 'SkipExtraFilesOnServer'=$true + 'retryAttempts' = 2 + 'EnableMSDeployBackup' = $false + 'DeleteExistingFiles' = $false + 'MSDeployPackageContentFoldername'='website\' + } +} + +function Register-AspnetPublishHandler{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + $name, + [Parameter(Mandatory=$true,Position=1)] + [ScriptBlock]$handler, + [switch]$force + ) + process{ + if(!($script:AspNetPublishHandlers[$name]) -or $force ){ + 'Adding handler for [{0}]' -f $name | Write-Verbose + $script:AspNetPublishHandlers[$name] = $handler + } + elseif(!($force)){ + 'Ignoring call to Register-AspnetPublishHandler for [name={0}], because a handler with that name exists and -force was not passed.' -f $name | Write-Verbose + } + } +} + +function Get-AspnetPublishHandler{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + $name + ) + process{ + $foundHandler = $script:AspNetPublishHandlers[$name] + + if(!$foundHandler){ + throw ('AspnetPublishHandler with name "{0}" was not found' -f $name) + } + + $foundHandler + } +} + +function GetInternal-ExcludeFilesArg{ + [cmdletbinding()] + param( + $publishProperties + ) + process{ + $excludeFiles = $publishProperties['ExcludeFiles'] + foreach($exclude in $excludeFiles){ + if($exclude){ + [string]$objName = $exclude['objectname'] + + if([string]::IsNullOrEmpty($objName)){ + $objName = 'filePath' + } + + $excludePath = $exclude['absolutepath'] + + # output the result to the return list + ('-skip:objectName={0},absolutePath={1}' -f $objName, $excludePath) + } + } + } +} + +function GetInternal-ReplacementsMSDeployArgs{ + [cmdletbinding()] + param( + $publishProperties + ) + process{ + foreach($replace in ($publishProperties['Replacements'])){ + if($replace){ + $typeValue = $replace['type'] + if(!$typeValue){ $typeValue = 'TextFile' } + + $file = $replace['file'] + $match = $replace['match'] + $newValue = $replace['newValue'] + + if($file -and $match -and $newValue){ + $setParam = ('-setParam:type={0},scope={1},match={2},value={3}' -f $typeValue,$file, $match,$newValue) + 'Adding setparam [{0}]' -f $setParam | Write-Verbose + + # return it + $setParam + } + else{ + 'Skipping replacement because its missing a required value.[file="{0}",match="{1}",newValue="{2}"]' -f $file,$match,$newValue | Write-Verbose + } + } + } + } +} + +<# +.SYNOPSIS +Returns an array of msdeploy arguments that are used across different providers. +For example this wil handle useChecksum, appOffline, etc. +This will also add default properties if they are missing. +#> +function GetInternal-SharedMSDeployParametersFrom{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + $publishProperties + ) + process{ + $sharedArgs = New-Object psobject -Property @{ + ExtraArgs = @() + DestFragment = '' + } + + # add default properties if they are missing + foreach($propName in $global:AspNetPublishSettings.MsdeployDefaultProperties.Keys){ + if($publishProperties["$propName"] -eq $null){ + $defValue = $global:AspNetPublishSettings.MsdeployDefaultProperties["$propName"] + 'Adding default property to publishProperties ["{0}"="{1}"]' -f $propName,$defValue | Write-Verbose + $publishProperties["$propName"] = $defValue + } + } + + if($publishProperties['MSDeployUseChecksum'] -eq $true){ + $sharedArgs.ExtraArgs += '-usechecksum' + } + + if($publishProperties['WebPublishMethod'] -eq 'MSDeploy'){ + $offlineArgs = GetInternal-PublishAppOfflineProperties -publishProperties $publishProperties + $sharedArgs.ExtraArgs += $offlineArgs.AdditionalArguments + $sharedArgs.DestFragment += $offlineArgs.DestFragment + + if($publishProperties['SkipExtraFilesOnServer'] -eq $true){ + $sharedArgs.ExtraArgs += '-enableRule:DoNotDeleteRule' + } + } + + if($publishProperties['WebPublishMethod'] -eq 'FileSystem'){ + if($publishProperties['DeleteExistingFiles'] -eq $false){ + $sharedArgs.ExtraArgs += '-enableRule:DoNotDeleteRule' + } + } + + if($publishProperties['retryAttempts']){ + $sharedArgs.ExtraArgs += ('-retryAttempts:{0}' -f ([int]$publishProperties['retryAttempts'])) + } + + if($publishProperties['EncryptWebConfig'] -eq $true){ + $sharedArgs.ExtraArgs += '-EnableRule:EncryptWebConfig' + } + + if($publishProperties['EnableMSDeployBackup'] -eq $false){ + $sharedArgs.ExtraArgs += '-disablerule:BackupRule' + } + + # add excludes + $sharedArgs.ExtraArgs += (GetInternal-ExcludeFilesArg -publishProperties $publishProperties) + # add replacements + $sharedArgs.ExtraArgs += (GetInternal-ReplacementsMSDeployArgs -publishProperties $publishProperties) + + # return the args + $sharedArgs + } +} + +<# +.SYNOPSIS +This will publish the folder based on the properties in $publishProperties + +.EXAMPLE + Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='MSDeploy' + 'MSDeployServiceURL'='contoso.scm.azurewebsites.net:443';` + 'DeployIisAppPath'='contoso';'Username'='$contoso';'Password'="$env:PublishPwd"} + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + } + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='MSDeploy' + 'MSDeployServiceURL'='contoso.scm.azurewebsites.net:443';` +'DeployIisAppPath'='contoso';'Username'='$contoso';'Password'="$env:PublishPwd" + 'ExcludeFiles'=@( + @{'absolutepath'='wwwroot\\test.txt'}, + @{'absolutepath'='wwwroot\\_references.js'} +)} + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + 'ExcludeFiles'=@( + @{'absolutepath'='wwwroot\\test.txt'}, + @{'absolutepath'='wwwroot\\_references.js'}) + 'Replacements' = @( + @{'file'='test.txt$';'match'='REPLACEME';'newValue'='updatedValue'}) + } + +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + 'ExcludeFiles'=@( + @{'absolutepath'='wwwroot\\test.txt'}, + @{'absolutepath'='c:\\full\\path\\ok\\as\\well\\_references.js'}) + 'Replacements' = @( + @{'file'='test.txt$';'match'='REPLACEME';'newValue'='updatedValue'}) + } + +.EXAMPLE +Publish-AspNet -packOutput $packOutput -publishProperties @{ + 'WebPublishMethod'='FileSystem' + 'publishUrl'="$publishDest" + 'EnableMSDeployAppOffline'='true' + 'AppOfflineTemplate'='offline-template.html' + 'MSDeployUseChecksum'='true' +} +#> +function Publish-AspNet{ + [cmdletbinding(SupportsShouldProcess=$true)] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + process{ + if($publishProperties['WebPublishMethodOverride']){ + 'Overriding publish method from $publishProperties[''WebPublishMethodOverride''] to [{0}]' -f ($publishProperties['WebPublishMethodOverride']) | Write-Verbose + $publishProperties['WebPublishMethod'] = $publishProperties['WebPublishMethodOverride'] + } + + if(!([System.IO.Path]::IsPathRooted($packOutput))){ + $packOutput = [System.IO.Path]::GetFullPath((Join-Path $pwd $packOutput)) + } + + $pubMethod = $publishProperties['WebPublishMethod'] + 'Publishing with publish method [{0}]' -f $pubMethod | Write-Output + + # get the handler based on WebPublishMethod, and call it. + &(Get-AspnetPublishHandler -name $pubMethod) $publishProperties $packOutput + } +} + +function Publish-AspNetMSDeploy{ + [cmdletbinding(SupportsShouldProcess=$true)] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + process{ + if($publishProperties){ + $publishPwd = $publishProperties['Password'] + + <# + "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" + -source:IisApp='C:\Users\contoso\AppData\Local\Temp\AspNetPublish\WebApplication1\wwwroot' + -dest:IisApp='vramak4',ComputerName='https://contoso.scm.azurewebsites.net/msdeploy.axd',UserName='$contoso',Password='',IncludeAcls='False',AuthType='Basic' + -verb:sync + -enableRule:DoNotDeleteRule + -enableLink:contentLibExtension + -retryAttempts=2 + -userAgent="VS14.0:PublishDialog:WTE14.0.51027.0" + #> + + $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties + + # WebRoot is a required property which has a default + $webroot = $publishProperties['WebRoot'] + + $webrootOutputFolder = (get-item (Join-Path $packOutput $webroot)).FullName + $publishArgs = @() + $publishArgs += ('-source:IisApp=''{0}''' -f "$webrootOutputFolder") + $publishArgs += ('-dest:IisApp=''{0}'',ComputerName=''{1}'',UserName=''{2}'',Password=''{3}'',IncludeAcls=''False'',AuthType=''Basic''{4}' -f + $publishProperties['DeployIisAppPath'], + (Get-MSDeployFullUrlFor -msdeployServiceUrl $publishProperties['MSDeployServiceURL']), + $publishProperties['UserName'], + $publishPwd, + $sharedArgs.DestFragment) + $publishArgs += '-verb:sync' + $publishArgs += '-enableLink:contentLibExtension' + $publishArgs += $sharedArgs.ExtraArgs + + $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') + + if (! [String]::IsNullOrEmpty($publishPwd)) { + $command.Replace($publishPwd,'{PASSWORD-REMOVED-FROM-LOG}') | Print-CommandString + } + Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') + } + else{ + throw 'publishProperties is empty, cannot publish' + } + } +} + +function Escape-TextForRegularExpressions{ + [cmdletbinding()] + param( + [Parameter(Position=0,Mandatory=$true)] + [string]$text + ) + process{ + # TODO: Get code from EscapeTextForRegularExpressions task + $text.Replace('\','\\') + } +} + +function Publish-AspNetMSDeployPackage{ + [cmdletbinding(SupportsShouldProcess=$true)] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + process{ + if($publishProperties){ + $packageDestFilepah = $publishProperties['DesktopBuildPackageLocation'] + + if(!$packageDestFilepah){ + throw ('The package destination property (DesktopBuildPackageLocation) was not found in the publish properties') + } + + if(!([System.IO.Path]::IsPathRooted($packageDestFilepah))){ + $packageDestFilepah = [System.IO.Path]::GetFullPath((Join-Path $pwd $packageDestFilepah)) + } + + # if the dir doesn't exist create it + $pkgDir = ((new-object -typename System.IO.FileInfo($packageDestFilepah)).Directory) + if(!($pkgDir.Exists)) { + $pkgDir.Create() | Out-Null + } + + <# + "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" + -source:IisApp='C:\Users\contoso\AppData\Local\Temp\AspNetPublish\WebApplication1\wwwroot' + -dest:package=c:\temp\path\contosoweb.zip + -verb:sync + -enableRule:DoNotDeleteRule + -enableLink:contentLibExtension + -retryAttempts=2 + #> + + $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties + + # WebRoot is a required property which has a default + $webroot = $publishProperties['WebRoot'] + + $webrootOutputFolder = (get-item (Join-Path $packOutput $webroot)).FullName + $publishArgs = @() + $publishArgs += ('-source:IisApp=''{0}''' -f "$webrootOutputFolder") + $publishArgs += ('-dest:package=''{0}''' -f $packageDestFilepah) + $publishArgs += '-verb:sync' + $publishArgs += '-enableLink:contentLibExtension' + $packageContentFolder = $publishProperties['MSDeployPackageContentFoldername'] + if(!$packageContentFolder){ $packageContentFolder = 'website' } + $publishArgs += ('-replace:match=''{0}'',replace=''{1}''' -f (Escape-TextForRegularExpressions $packOutput), $packageContentFolder ) + $publishArgs += $sharedArgs.ExtraArgs + + $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') + $command | Print-CommandString + Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') + } + else{ + throw 'publishProperties is empty, cannot publish' + } + } +} + +<# +.SYNOPSIS +If the passed in $publishProperties has values for appOffline the +needed arguments will be in the return object. If there is no such configuraion +then nothing is returned. +#> +function GetInternal-PublishAppOfflineProperties{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0)] + $publishProperties + ) + process{ + $extraArg = ''; + $destFragment = '' + if($publishProperties['EnableMSDeployAppOffline'] -eq $true){ + $extraArg = '-enablerule:AppOffline' + + $appOfflineTemplate = $publishProperties['AppOfflineTemplate'] + if($appOfflineTemplate){ + $destFragment = (',appOfflineTemplate="{0}"' -f $appOfflineTemplate) + } + } + # return an object with both the properties that need to be in the command. + New-Object psobject -Property @{ + AdditionalArguments = $extraArg + DestFragment = $destFragment + } + } +} + +function Publish-AspNetFileSystem{ + [cmdletbinding(SupportsShouldProcess=$true)] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + process{ + $pubOut = $publishProperties['publishUrl'] + + if([string]::IsNullOrWhiteSpace($pubOut)){ + throw ('publishUrl is a required property for FileSystem publish but it was empty.') + } + + # if it's a relative path then update it to a full path + if(!([System.IO.Path]::IsPathRooted($pubOut))){ + $pubOut = [System.IO.Path]::GetFullPath((Join-Path $pwd $pubOut)) + $publishProperties['publishUrl'] = "$pubOut" + } + + 'Publishing files to {0}' -f $pubOut | Write-Output + + # we use msdeploy.exe because it supports incremental publish/skips/replacements/etc + # msdeploy.exe -verb:sync -source:contentPath='C:\srcpath' -dest:contentPath='c:\destpath' + + $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties + + $publishArgs = @() + $publishArgs += ('-source:contentPath=''{0}''' -f "$packOutput") + $publishArgs += ('-dest:contentPath=''{0}''{1}' -f "$pubOut",$sharedArgs.DestFragment) + $publishArgs += '-verb:sync' + $publishArgs += $sharedArgs.ExtraArgs + + $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') + $command | Print-CommandString + Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') + } +} + + +function Print-CommandString{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] + $command + ) + process{ + 'Executing command [{0}]' -f $command | Write-Output + } +} + +function Execute-CommandString{ + [cmdletbinding()] + param( + [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] + [string[]]$command, + + [switch] + $useInvokeExpression, + + [switch] + $ignoreErrors + ) + process{ + foreach($cmdToExec in $command){ + 'Executing command [{0}]' -f $cmdToExec | Write-Verbose + if($useInvokeExpression){ + try { + Invoke-Expression -Command $cmdToExec + } + catch { + if(-not $ignoreErrors){ + $msg = ('The command [{0}] exited with exception [{1}]' -f $cmdToExec, $_.ToString()) + throw $msg + } + } + } + else { + cmd.exe /D /C $cmdToExec + + if(-not $ignoreErrors -and ($LASTEXITCODE -ne 0)){ + $msg = ('The command [{0}] exited with code [{1}]' -f $cmdToExec, $LASTEXITCODE) + throw $msg + } + } + } + } +} + +function Execute-Command { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + [String]$exePath, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + [String]$arguments + ) + process{ + $psi = New-Object -TypeName System.Diagnostics.ProcessStartInfo + $psi.CreateNoWindow = $true + $psi.UseShellExecute = $false + $psi.RedirectStandardOutput = $true + $psi.RedirectStandardError=$true + $psi.FileName = $exePath + $psi.Arguments = $arguments + + $process = New-Object -TypeName System.Diagnostics.Process + $process.StartInfo = $psi + $process.EnableRaisingEvents=$true + + # Register the event handler for error + $stdErrEvent = Register-ObjectEvent -InputObject $process -EventName 'ErrorDataReceived' -Action { + if (! [String]::IsNullOrEmpty($EventArgs.Data)) { + $EventArgs.Data | Write-Error + } + } + + # Starting process. + [Void]$process.Start() + $process.BeginErrorReadLine() + $output = $process.StandardOutput.ReadToEnd() + [Void]$process.WaitForExit() + $output | Write-Output + + # UnRegister the event handler for error + Unregister-Event -SourceIdentifier $stdErrEvent.Name + } +} + + +function Get-MSDeploy{ + [cmdletbinding()] + param() + process{ + $installPath = $env:msdeployinstallpath + + if(!$installPath){ + $keysToCheck = @('hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3','hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2','hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1') + + foreach($keyToCheck in $keysToCheck){ + if(Test-Path $keyToCheck){ + $installPath = (Get-itemproperty $keyToCheck -Name InstallPath -ErrorAction SilentlyContinue | select -ExpandProperty InstallPath -ErrorAction SilentlyContinue) + } + + if($installPath){ + break; + } + } + } + + if(!$installPath){ + throw "Unable to find msdeploy.exe, please install it and try again" + } + + [string]$msdInstallLoc = (join-path $installPath 'msdeploy.exe') + + "Found msdeploy.exe at [{0}]" -f $msdInstallLoc | Write-Verbose + + $msdInstallLoc + } +} + +function Get-MSDeployFullUrlFor{ + [cmdletbinding()] + param($msdeployServiceUrl) + process{ + # Convert contoso.scm.azurewebsites.net:443 to https://contoso.scm.azurewebsites.net/msdeploy.axd + # TODO: This needs to be improved, it only works with Azure Websites currently. + 'https://{0}/msdeploy.axd' -f $msdeployServiceUrl.TrimEnd(':443') + } +} + +function InternalRegister-AspNetKnownPublishHandlers{ + [cmdletbinding()] + param() + process{ + 'Registering MSDeploy handler' | Write-Verbose + Register-AspnetPublishHandler -name 'MSDeploy' -force -handler { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + + Publish-AspNetMSDeploy -publishProperties $publishProperties -packOutput $packOutput + } + + 'Registering MSDeploy package handler' | Write-Verbose + Register-AspnetPublishHandler -name 'Package' -force -handler { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + + Publish-AspNetMSDeployPackage -publishProperties $publishProperties -packOutput $packOutput + } + + 'Registering FileSystem handler' | Write-Verbose + Register-AspnetPublishHandler -name 'FileSystem' -force -handler { + [cmdletbinding()] + param( + [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + $publishProperties, + [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] + $packOutput + ) + + Publish-AspNetFileSystem -publishProperties $publishProperties -packOutput $packOutput + } + } +} + +<# +.SYNOPSIS + Used for testing purposes only. +#> +function InternalReset-AspNetPublishHandlers{ + [cmdletbinding()] + param() + process{ + $script:AspNetPublishHandlers = @{} + InternalRegister-AspNetKnownPublishHandlers + } +} + +Export-ModuleMember -function Get-*,Publish-*,Register-*,Enable-* +if($env:IsDeveloperMachine){ + # you can set the env var to expose all functions to importer. easy for development. + # this is required for executing pester test cases, it's set by build.ps1 + Export-ModuleMember -function * +} + +# register the handlers so that Publish-AspNet can be called +InternalRegister-AspNetKnownPublishHandlers \ No newline at end of file diff --git a/eng/msbuild/web/Web/Transform/Microsoft.Web.Publishing.AspNetCompileMerge.targets b/eng/msbuild/web/Web/Transform/Microsoft.Web.Publishing.AspNetCompileMerge.targets new file mode 100644 index 00000000..b150e252 --- /dev/null +++ b/eng/msbuild/web/Web/Transform/Microsoft.Web.Publishing.AspNetCompileMerge.targets @@ -0,0 +1,774 @@ + + + + + + + + + + + + + + true + + + + + True + + + + + + + + <_AspnetCompileMergePrecompiledOutput> + + False + AspNetCompilerMergePhase + Run + Default + + + + + + $(IntermediateOutputPath)AspnetCompileMerge\ + $(IntermediateOutputPath)AssemblyInfo\ + $(AspnetCompileMergeIntermediateOutputPath)Source + $(AspnetCompileMergeIntermediateOutputPath)TempBuildDir + + + + <_AspNetCompilerFixedNames Condition="'$(_AspNetCompilerFixedNames)' == ''">$(UseFixedNames) + + + + <_AspNetCompilerMetabasePath Condition ="'$(_AspNetCompilerMetabasePath)' == ''">$(SourceWebMetabasePath) + + + <_AspNetCompilerSourceWebPath Condition="'$(_AspNetCompilerSourceWebPath)' != ''">$(WebPublishPipelineProjectDirectory) + <_AspNetCompilerVirtualPath Condition="'$(_AspNetCompilerVirtualPath)' != ''">$(SourceWebVirtualPath) + + + + <_WPPCurrentBuildInfo>$(_WPPCurrentBuildInfo);PrecompileBeforePublish=$(PrecompileBeforePublish);WDPMergeOption=$(WDPMergeOption);_AspNetCompilerFixedNames=$(_AspNetCompilerFixedNames);_AspNetCompilerMetabasePath=$(_AspNetCompilerMetabasePath);Microsoft_Web_Publishing_AspNetCompileMerge_targets_Imported=$(Microsoft_Web_Publishing_AspNetCompileMerge_targets_Imported) + + + + + + + <_WPPCleanTargets> + $(_WPPCleanTargets); + CleanAspNetCompileMergeTempDirectories; + + + + + + + + + + + + + + + + + + + + + + + + + + GetFrameworkPaths; + + + + + aspnet_merge.exe + $(TargetFrameworkSDKToolsDirectory) + + + + + + + + + + + + + $(OnBeforeGenerateAssemblyInfoFromAssemblyAttributes); + $(GenerateAssemblyInfoFromAssemblyAttributesDependsOn); + GetFrameworkPaths; + GetAspNetMergePath; + + + + + + + <_AssemblyInfoSource Condition="'$(_AssemblyInfoSource)' == ''" >$(IntermediateOutputPath)AssemblyInfo\AssemblyInfo.cs + <_AssemblyInfoSourceDirectory>$([System.IO.Path]::GetDirectoryName($(_AssemblyInfoSource))) + $([System.IO.Path]::GetDirectoryName($(_AssemblyInfoSource)))\AssemblyInfo.dll + <_AssemblyInfoDllDirectory>$([System.IO.Path]::GetDirectoryName($(AssemblyInfoDll))) + + + + + + + + <_GenerateAssemblyInfoDll>false + <_GenerateAssemblyInfoDll Condition="'$(_AssemblyInfoSourceIsUpdated)' == 'true' or !Exists($(AssemblyInfoDll))">True + + + + + + + + + + + + + + + $(OnBeforeGenerateAssemblyInfoFromExistingAssembleInfo); + $(GenerateAssemblyInfoFromExistingAssembleInfoDependsOn); + GetFrameworkPaths; + GetAspNetMergePath; + GenerateAssemblyInfoFromAssemblyAttributes; + + + + + + + + + + <_AspNetCompile_AssemblyInfo Include="$(_AssemblyInfoSource)" /> + + + + <_AssemblyInfoDllDirectory>$(IntermediateOutputPath)AssemblyInfo + $(_AssemblyInfoDllDirectory)\AssemblyInfo.dll + + + + + + + <_GenerateAssemblyInfoDll>False + <_GenerateAssemblyInfoDll Condition="'$(AssemblyInfoDll)' == '' Or !Exists($(AssemblyInfoDll))">True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforeGenerateAssemblyInfo); + $(GenerateAssemblyInfoDependsOn); + GetFrameworkPaths; + GetAspNetMergePath; + GenerateAssemblyInfoFromAssemblyAttributes; + GenerateAssemblyInfoFromExistingAssembleInfo; + + + + + + + + + + + + + $(OnBeforeGetAspNetPreCompileSourceVirtualPath); + $(GetAspNetPreCompileSourceVirtualPathDependsOn); + + + + + + <__AspNetPreCompileSourceVirtualPathName Include ="DevelopmentServerVPath" /> + <__AspNetPreCompileSourceVirtualPathValue /> + + + + + + + + + <_AspNetCompilerVirtualPath>%(__AspNetPreCompileSourceVirtualPathValue.Value) + <_AspNetCompilerVirtualPath Condition="'$(_AspNetCompilerVirtualPath)' == '' ">\ + + + + + + + + + + $(OnBeforeConfigureForAspNetPreCompileMerge); + $(ConfigureForAspNetPreCompileMergeDependsOn); + GetFrameworkPaths; + GetAspNetMergePath; + GetAspNetPreCompileSourceVirtualPath; + ResolveKeySource; + + + + + + + <_WDPFrameworkLowerThan4>False + <_WDPFrameworkLowerThan4 Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'">True + + + + + $(windir)\Microsoft.NET\Framework64\v2.0.50727 + $(Framework20Dir) + + + $(windir)\Microsoft.NET\Framework64\v4.0.30319 + + + $(Framework40Dir) + + + + + + <_AspNetCompileMergeKeyFile Condition="'$(_AspNetCompileMergeKeyFile)' == ''">$(KeyOriginatorFile) + + + + <_AspNetCompileMergeKeyContainer Condition="'$(_AspNetCompileMergeKeyContainer)' == ''">$(KeyContainerName) + + + + + + + + + + + + $(OnBeforeAspNetPreCompile); + $(AspNetPreCompileDependsOn); + CopyAllFilesToSingleFolderForAspNetCompileMerge; + GetReferenceAssemblyPaths; + ResolveReferences; + ResolveKeySource; + ConfigureForAspNetPreCompileMerge; + + + + + + + <_PreAspnetCompileMergeSingleTargetFolderFullPath> + <_AspNetCompilerVirtualPath> + + + <_PreAspnetCompileMergeSingleTargetFolderFullPath>$([System.IO.Path]::GetFullPath($(_PreAspnetCompileMergeSingleTargetFolder))) + + + + <_PostAspnetCompileMergeSingleTargetFolderFullPath>$([System.IO.Path]::GetFullPath($(_PostAspnetCompileMergeSingleTargetFolder))) + + + + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforeAspNetMerge); + CopyAllFilesToSingleFolderForAspNetCompileMerge; + $(AspNetMergeDependsOn); + ConfigureForAspNetPreCompileMerge; + AspNetPreCompile; + GenerateAssemblyInfo; + + + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforeConfigureFoldersForAspNetCompileMerge); + $(ConfigureFoldersForAspNetCompileMergeDependsOn); + + + + + + + + + + <_PreAspnetCompileMergeSingleTargetFolder>$(CopyBeforeAspnetCompileMergeTargetPath) + <_PostAspnetCompileMergeSingleTargetFolder>$(AspnetCompileMerge_TempBuildDir) + + + + + + + + + + + + + + + + $(OnBeforeCopyAllFilesToSingleFolderForAspNetCompileMerge); + ConfigureFoldersForAspNetCompileMerge; + $(CopyAllFilesToSingleFolderForAspNetCompileMergeDependsOn); + + + + + + + <_AllExtraFilesUnder_PreAspnetCompileMergeSingleTargetFolder Include="$(_PreAspnetCompileMergeSingleTargetFolder)\**" /> + <_AllExtraFilesUnder_PreAspnetCompileMergeSingleTargetFolder + Remove="@(FilesForPackagingFromProject->'$(_PreAspnetCompileMergeSingleTargetFolder)\%(DestinationRelativePath)')" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforePostAspNetCompileMergeCollectFiles); + $(PostAspNetCompileMergeCollectFilesDependsOn); + AspNetMerge; + + + + + + + + + <_AspnetCompileMergePrecompiledOutput Include="@(_AspnetCompileMergePrecompiledOutputNoMetadata->'$(_PostAspnetCompileMergeSingleTargetFolder)\%(Identity)')"> + %(_AspnetCompileMergePrecompiledOutputNoMetadata.Identity) + + + + + + + + + + + + <_AspnetCompileMergePrecompiledOutput Remove="@(_FilesForPackagingFromProject_in_AspnetCompileMergePrecompiledOutput->'%(FilterItemSpec)')" /> + <_AspnetCompileMergePrecompiledOutput Include="@(_FilesForPackagingFromProject_in_AspnetCompileMergePrecompiledOutput->'%(FilterItemSpec)')" /> + + + + + + + + + + + + + + + + + + + + + + + $(OnBeforeCleanPostAspNetCompileMergeFolder); + $(CleanPostAspNetCompileMergeFolderDependsOn); + ConfigureFoldersForAspNetCompileMerge; + + + + + + + + + + + + + + + + $(OnBeforePipelineAspNetCompileMergePhase); + $(PipelineAspNetCompileMergePhaseDependsOn); + CleanPostAspNetCompileMergeFolder; + CopyAllFilesToSingleFolderForAspNetCompileMerge; + AspNetPreCompile; + AspNetMerge; + PostAspNetCompileMergeCollectFiles; + + + PipelineTransformPhase; + + + + + + + + + + + + + + + + + true + + + diff --git a/eng/msbuild/web/WebApplications/Microsoft.WebApplication.Build.Tasks.Dll b/eng/msbuild/web/WebApplications/Microsoft.WebApplication.Build.Tasks.Dll new file mode 100644 index 00000000..a86cb69d Binary files /dev/null and b/eng/msbuild/web/WebApplications/Microsoft.WebApplication.Build.Tasks.Dll differ diff --git a/eng/msbuild/web/WebApplications/Microsoft.WebApplication.targets b/eng/msbuild/web/WebApplications/Microsoft.WebApplication.targets new file mode 100644 index 00000000..5888831b --- /dev/null +++ b/eng/msbuild/web/WebApplications/Microsoft.WebApplication.targets @@ -0,0 +1,396 @@ + + + + + + + False + True + False + $(WebProjectOutputDirInsideProjectDefault) + False + False + False + True + False + + + + + $(MSBuildProjectDirectory) + $(OutDir)_PublishedWebsites\$(MSBuildProjectName) + + + + + $(PrepareForRunDependsOn); + CopySilverlightApplications; + _CopyBinDeployableAssemblies; + + + $(PrepareForRunDependsOn); + _CopyWebApplication; + _BuiltWebOutputGroupOutput + + + + + + + + + $(CleanDependsOn); + CleanWebProjectOutputDir; + + + + + + + + + + + + + + + + + + + + + + _CopyWebApplicationLegacy; + + + _WPPCopyWebApplication; + + + $(OnBefore_CopyWebApplicationDefault); + + + + + + <_CopyWebApplicationDependsOn Condition="'$(_CopyWebApplicationDependsOn)'==''"> + $(OnBefore_CopyWebApplication); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_SilverlightApplications Include="@(_AllSilverlightApplications)" Condition="Exists('%(Identity)')"/> + <_SilverlightApplicationsNotExist Include="@(_AllSilverlightApplications)" Condition="!Exists('%(Identity)')"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _bin_deployableAssemblies\ + $([System.IO.Path]::GetFullPath($(BinDeployableFolder))) + + + + + + + + + + <_binDeployableAssemblies Include ="@(__binDeployableAssemblies)" Condition="'@(__binDeployableAssemblies)' != ''"> + $([System.String]::Concat($([System.IO.Path]::GetDirectoryName($([System.String]::new('%(__binDeployableAssemblies.FullPath)')))),'\').SubString($(BinDeployableFolderFullPath.Length))) + + + + + + + + + + + + + + + $(MSBuildThisFileDirectory)..\Web\ + + + + + + + + $(OnBeforePipelineCollectFilesPhase); + CopySilverlightApplications; + + + + + + false + $(ProjectConfigFileName) + + diff --git a/samples/Fornax/Fornax.Server/Fornax.Server.csproj b/samples/Fornax/Fornax.Server/Fornax.Server.csproj index 588adb35..a44a8be7 100644 --- a/samples/Fornax/Fornax.Server/Fornax.Server.csproj +++ b/samples/Fornax/Fornax.Server/Fornax.Server.csproj @@ -4,7 +4,7 @@ $(NetFrameworkTargetFramework) Web.config Overwrite - $(NuGetPackageRoot)msbuild.microsoft.visualstudio.web.targets\14.0.0.3\tools\VSToolsPath + $(RepoRoot)eng\msbuild\web false disable CA3147 diff --git a/samples/Mortis/Mortis.Client/Mortis.Client.csproj b/samples/Mortis/Mortis.Client/Mortis.Client.csproj index a9cf1691..55bf0909 100644 --- a/samples/Mortis/Mortis.Client/Mortis.Client.csproj +++ b/samples/Mortis/Mortis.Client/Mortis.Client.csproj @@ -4,7 +4,7 @@ $(NetFrameworkTargetFramework) Web.config Overwrite - $(NuGetPackageRoot)msbuild.microsoft.visualstudio.web.targets\14.0.0.3\tools\VSToolsPath + $(RepoRoot)eng\msbuild\web false disable CA3147 diff --git a/samples/Mortis/Mortis.Server/Mortis.Server.csproj b/samples/Mortis/Mortis.Server/Mortis.Server.csproj index a0d81a1b..da3317b6 100644 --- a/samples/Mortis/Mortis.Server/Mortis.Server.csproj +++ b/samples/Mortis/Mortis.Server/Mortis.Server.csproj @@ -4,7 +4,7 @@ $(NetFrameworkTargetFramework) Web.config Overwrite - $(NuGetPackageRoot)msbuild.microsoft.visualstudio.web.targets\14.0.0.3\tools\VSToolsPath + $(RepoRoot)eng\msbuild\web false disable CA3147