手动XBAP发布 [英] Manual XBAP publishing

查看:240
本文介绍了手动XBAP发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了手动发布常规WPF应用程序的方法,但是我需要相同的WPF浏览器应用程序指令。这是常规的WPF应用程序如何: http:// msdn .microsoft.com / en-us / library / xc3tc5xx(VS.80).aspx 。如果有人知道我需要做什么改变,让我的法师命令让XBAP工作,请让我知道。谢谢。

I found a method to manually publish a regular WPF Application, but i need the same instructions for a WPF Browser app instead. Here is the regular WPF App howto: http://msdn.microsoft.com/en-us/library/xc3tc5xx(VS.80).aspx . If anyone knows what changes I need to make to my mage commands to make it work for XBAP please let me know. Thanks.

推荐答案

我不得不更改我们的客户的默认应用程序文件文件夹的名称,像文件或文件夹名称中的空格,这意味着在发布后重新签署xbap。这是我用来自动执行这个过程的msbuild脚本:

I had to alter the name of the default "Application Files" folder for one of our customers who doesn't like spaces in file or folder names and this meant re-signing the xbap after the publish. Here's the msbuild script I use to automate the process:

<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>

这篇关于手动XBAP发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆