2

我有解决方案(.sln)文件,SLN 有多个项目(.csproj)。我需要在单个项目文件夹中发布所有项目。我正在使用下面的powershell命令,下面的命令将所有项目发布到一个文件夹而不是单个项目文件夹中,有没有办法在单个项目文件夹中发布。

Powershell 命令:

$sln ="E:\Webproject.sln"
$msbuild = "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
& $msbuild $sln /p:Configuration=Test /p:DeployOnBuild=true /p:PublishProfile="E:\FolderProfile.pubxml" /MaxCpuCount:8 /p:Configuration=Release /t:Rebuild /p:Platform="Any CPU" -clp:ErrorsOnly

这里是 E:\FolderProfile.pubxml 文件下面

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <PublishProvider>FileSystem</PublishProvider>
    <PublishUrl>C:\publishtemp</PublishUrl>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <SiteUrlToLaunchAfterPublish />
  </PropertyGroup>
</Project>
4

0 回答 0