2

我找到了一种手动发布常规 WPF 应用程序的方法,但是对于 WPF 浏览器应用程序,我需要相同的说明。这是常规的 WPF 应用程序操作方法:http: //msdn.microsoft.com/en-us/library/xc3tc5xx (VS.80).aspx 。如果有人知道我需要对我的法师命令进行哪些更改以使其适用于 XBAP,请告诉我。谢谢。

4

1 回答 1

0

我不得不为我们的一位不喜欢文件或文件夹名称中的空格的客户更改默认“应用程序文件”文件夹的名称,这意味着在发布后重新签署 xbap。这是我用来自动化该过程的 msbuild 脚本:

<Target Name="PublishWebsite" DependsOnTargets="CleanWebsiteOutputPath;CleanOutputPath;CleanWebsiteReleasePath">

    <!-- Compile Website -->
    <MSBuild Projects=".\Some.Namespace.Web.Site\Some.Namespace.UI.Web.Site.csproj" Targets="Clean;Rebuild;" Properties="Configuration=Release" />

    <!-- Copy Website files to release folder -->
    <ItemGroup>
        <SiteFiles Include="Some.Namespace.UI.Web.Site/**/*.*" />
    </ItemGroup>
    <Copy SourceFiles="@(SiteFiles)" DestinationFolder="..\rel\Website\%(RecursiveDir)" />

    <!-- Remove source code and source control files from website -->
    <CallTarget Targets="CleanWebsiteAfterPublish" />
    <Message Text="Website Published" />

    <!-- Rename "Application Files" folder and re-sign the xbap -->
    <StringReplace Pattern="\." InputString="$(ApplicationVersion)" Replace="_">
        <Output PropertyName="VersionUnderscored" TaskParameter="Result" />
    </StringReplace>
    <MSBuild Projects=".\Some.Namespace.UI.WPF\Some.Namespace.UI.WPF.csproj" Targets="Publish" Properties="Configuration=Release;" />
    <Exec Command="move &quot;..\bin\Release\app.publish\Application Files&quot; &quot;..\bin\Release\app.publish\ApplicationFiles&quot;" />
    <Exec Command="$(MageExe) -update ..\bin\Release\app.publish\SomeApp.xbap –AppManifest ..\bin\Release\app.publish\ApplicationFiles\SomeApp_$(VersionUnderscored)\SomeApp.exe.manifest -wpf true -cf ..\ext\Signing\SomeApp.pfx -pwd password" />

    <!-- Move published files to Release directory -->
    <ItemGroup>
        <XbapPublishFiles Include="..\bin\Release\app.publish\**\*.*" />
    </ItemGroup>
    <Copy SourceFiles="@(XbapPublishFiles)" DestinationFiles="@(XbapPublishFiles->'..\rel\Website\%(RecursiveDir)%(Filename)%(Extension)')" />
    <Message Text="XBAP Published" />
</Target>
于 2010-11-19T14:09:19.427 回答