我遇到的问题是,当我通过 MSBuild (4.0) 发布 ClickOnce 应用程序时,publish.htm(或 default.htm)未在 app.publish 文件夹中创建.
I am facing a problem that when I publish my ClickOnce application through MSBuild (4.0), the publish.htm (or default.htm) isn't created in the app.publish folder.
当通过 Visual Studio 发布时,它会被装箱...
When publishing through Visual Studio, it gets crated...
在我的 .csproj 文件中,我设置了以下属性,但它仍然无法正常工作...
In my .csproj file I have the following properties set, and it still not working...
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>default.htm</WebPage>
有什么想法吗?
谢谢
我找到了一个很好的解决方案 这里.您可以使用带有 {VERSION} 占位符的 publish.htm 模板.MSBuild 社区任务 是 FileUpdate 任务所必需的.
I found a good solution here. You can use a template for publish.htm with {VERSION} placeholder inside. MSBuild Community Tasks are required for the FileUpdate task.
BUILD_VERSION - 环境变量,由我的构建脚本设置.PublishDir 属性在 msbuild 的参数中设置.
BUILD_VERSION - environment variable, set by my build script. PublishDir property is set in argument for msbuild.
<!-- .... -->
<Target Name="DoPublish">
<MSBuild Projects="$(ProjectFileName)" Targets="Publish" Properties="ApplicationVersion=$(BUILD_VERSION)" />
<!-- Write publish.htm file for ClickOnce -->
<Copy SourceFiles="$(ProjectDir)publish.htm" DestinationFiles="$(PublishDir)publish.htm"/>
<FileUpdate Files="$(PublishDir)publish.htm"
IgnoreCase="true"
Multiline="true"
Singleline="false"
Regex="{VERSION}"
ReplacementText="$(BUILD_VERSION)"/>
</Target>
</Project>
这篇关于MSBuild 未生成发布网页 (ClickOnce)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
有没有办法知道是否有人为您的网站添加了书签Is there a way to know if someone has bookmarked your website?(有没有办法知道是否有人为您的网站添加了书签?)
使用不同的 .Net 语言?Use of Different .Net Languages?(使用不同的 .Net 语言?)
是否有执行 Excel NORMINV 函数的 C# 库?Is there a C# library that will perform the Excel NORMINV function?(是否有执行 Excel NORMINV 函数的 C# 库?)
确定 ASP.NET 站点的“活动"用户数Determining an #39;active#39; user count of an ASP.NET site(确定 ASP.NET 站点的“活动用户数)
从 C# 中的加权列表中选择 x 个随机元素(无需替换Select x random elements from a weighted list in C# (without replacement)(从 C# 中的加权列表中选择 x 个随机元素(无需替换))
跟踪当前在线用户的最佳方式Best way to keep track of current online users(跟踪当前在线用户的最佳方式)