ただし、このプロジェクトタイプのPublishProfileを作成する方法はありません。 [パブリッシュ]をクリックすると基本パブリッシュウィザードが表示され、パブリッシュ設定は.pspxjファイルではなく.csprojファイルに保存されます。どうすれば特定のプロジェクトを公開することができますか?
PublishProfile
は、Webプロジェクトでは一度はクリックしません。 "基本パブリッシュウィザードとパブリッシュ設定は.pspxmlファイルではない.csprojファイルに保存されます。"なので、PublishProfile
は正しいオプションではありません。
あなたはMSBuildので溶液から特定のプロジェクトを公開したい場合は、簡単な方法は、全体のソリューションを構築するだけで1つのプロジェクトファイルを公開し、のようなことです:
msbuild.exe "ProjectName.csproj" /target:publish /p:PublishDir="$(build.artifactstagingdirectory)\
構築するために1本のコマンドラインを使用している場合と、パブリッシュはあなたの永続性です。公開するプロジェクトファイルにプロジェクトをパブリッシュするカスタムをターゲットにすることができます。 For example:このカスタムターゲットに
<PropertyGroup>
<!-- the folder of the project to build -->
<ProjLocation>..\YourProjectFolder</ProjLocation>
<ProjLocationReleaseDir>$(ProjLocation)\bin\Release</ProjLocationReleaseDir>
<ProjPublishLocation>$(ProjLocationReleaseDir)\app.publish</ProjPublishLocation>
<!-- This is the web-folder, which provides the artefacts for click-once. After this
build the project is actually deployed on the server -->
<DeploymentFolder>D:\server\releases\</DeploymentFolder>
</PropertyGroup>
<Target Name="Publish" DependsOnTargets="Clean">
<Message Text="Publish-Build started for build no $(ApplicationRevision)" />
<MSBuild Projects="$(ProjLocation)/YourProject.csproj" Properties="Configuration=Release" Targets="Publish"/>
<ItemGroup>
<SchoolPlannerSetupFiles Include="$(ProjPublishLocation)\*.*"/>
<SchoolPlannerUpdateFiles Include="$(ProjPublishLocation)\Application Files\**\*.*"/>
</ItemGroup>
<Copy
SourceFiles="@(SchoolPlannerSetupFiles)"
DestinationFolder="$(DeploymentFolder)\"
/>
<Copy
SourceFiles="@(SchoolPlannerUpdateFiles)"
DestinationFolder="$(DeploymentFolder)\Application Files\%(RecursiveDir)"
/>
<CallTarget Targets="RestoreLog"/>
</Target>
<Target Name="Clean">
<Message Text="Clean project:" />
<MSBuild Projects="$(ProjLocation)/YourProject.csproj" Properties="Configuration=Release" Targets="Clean"/>
</Target>
、あなただけのソリューションを構築する必要がある、プロジェクトを公開する必要はありません。
これが役に立ちます。
ソリューションをビルドしますが、1つのMSBuildコマンドラインで特定のプロジェクトのみを公開しますか? 'msbuild" xx.csproj "/ target:publish/p:PublishDir =" $(build.artifactstagingdirectory)\ "'コマンドラインで特定のプロジェクトを公開する方法は? –