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

查看:109
本文介绍了发布网站的工件到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

这是我的发布个人资料设置

This is my publish profile setup

<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:\development\projectname>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:\Users\UserName\Documents\Visual Studio 2015\WebSites\WebSite1\website.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天全站免登陆