0
我們有一個複雜的visual studio發佈配置文件,供開發人員部署文件。我希望開發人員能夠使用相同的發佈配置文件,同時爲每個未簽入源代碼管理的個人用戶配置一些變量。這可能嗎?如果是的話那麼如何?具有用戶特定變量的共享發佈配置文件
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<DeleteExistingFiles>False</DeleteExistingFiles>
<PipelineDependsOn>
CopyAssets;
$(PipelineDependsOn);
</PipelineDependsOn>
<publishUrl>C:\inetpub\wwwroot\local.MyApp\Website</publishUrl>
</PropertyGroup>
<Target Name="CopyAssets">
<Message Text="Inside of CopyAssets" Importance="high"/>
<Exec Command="%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -File "$(SolutionDir)Foundation\Scripts\Powershell\CopyAssets.ps1" $(SolutionDir) $(publishUrl)"/>
</Target>
</Project>
這是最簡單的形式。在這個例子中,我希望開發人員在每個用戶的基礎上配置發佈URL,理想情況下在.user文件中進行配置,或者從我們可以傳入此發佈配置文件的某個位置獲取變量或參數。