为网站发布工件转到 PrecompiledWeb [英] Publish Artifacts for website goes to PrecompiledWeb

查看:15
本文介绍了为网站发布工件转到 PrecompiledWeb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为旧项目设置 Continuations Integration.

I am trying to setup Continuations Integration for an old project.

该项目仍然使用网站而不是 Web 应用程序.在 Visual Studio 我创建了发布配置文件.我只是希望它将它发布到解决方案中的本地文件夹.

The project still uses websites and not web applications. In Visual studio i created the publish profile. I just want it to publish it to an local folder with in the solution.

当我从 Visual Studio 中发布时效果很好,但是一旦我运行 MSbuild 命令,它就会创建一个 PrecompiledWeb 文件夹和位置里面的代码.

It works great when i publish from within Visual studio but as soon as I run MSbuild command then it creates a PrecompiledWeb folder and places the code in there.

这会导致我的构建工件在我尝试设置我的 CI

And this causes my build artifacts to fail as soon as i try and setup my CI

这是我的发布配置文件设置

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>.Publish</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <PrecompileBeforePublish>False</PrecompileBeforePublish>
  </PropertyGroup>
</Project>

我什至尝试将 PrecompileBeforePublish 设置为 false.但这也没有用.

I even tried to set the PrecompileBeforePublish to false. But that also did not work.

我的 MSBuild 命令

c:developmentprojectname>msbuild project.sln /p:deployOnBuild=true /p:publishProfile=projectFileSystem

推荐答案

当我在 Visual Studio 中发布时效果很好,但只要我运行 MSbuild 命令,它就会创建一个 PrecompiledWeb 文件夹并将代码放置在其中.

It works great when i publish from within Visual studio but as soon as I run MSbuild command then it creates a PrecompiledWeb folder and places the code in there.

发布过程的网站项目未纳入构建过程.对于网站项目,由于没有正式的构建过程,我们没有什么可以真正扩展的.

The website project the publish process is not plumbed into the build process. For website project since there is no formal build process there was nothing for us to really extend.

在 VS 中创建发布配置文件后,将创建以下内容:

After creating a publish profile in VS the following are created:

1) App_Data/PublishProfiles 下的发布配置文件(.pubxml 文件)

1) A publish profile (.pubxml file) under App_Data/PublishProfiles

2) 网站根目录中的 website.publishproj

2) A website.publishproj in the root of the website

website.publishproj 的目的是方便命令行发布.然后你可以尝试使用如下命令:

The purpose of the website.publishproj is to facilitate command line publishing. Then you can try to use command like the following:

C:Program Files (x86)Microsoft Visual Studio 14.0>msbuild "C:UsersUserNameDocumentsVisual Studio 2015WebSitesWebSite1website.publishproj" /p:deployOnBuild=true /p:publishProfile=WebsiteTestDemo /p:VisualStudioVersion=14.0

之后,您会注意到它没有创建 PrecompiledWeb 文件夹,并且发布使用了配置文件中的设置:

After that, you will noticed it does not create the PrecompiledWeb folder and the publish uses the setting in the profile:

注意:发布文件应该是 website.publishproj 而不是 WebSite1(1).sln 文件.

Note:The publish file should be website.publishproj rather than WebSite1(1).sln file.

这篇关于为网站发布工件转到 PrecompiledWeb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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