使用命令行发布的WCF服务(或ASP.NET Web应用程序) [英] Publish WCF Service (or ASP.NET Web Application) using command line

查看:259
本文介绍了使用命令行发布的WCF服务(或ASP.NET Web应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想模仿发布...从WCF服务项目(或ASP.NET Web应用程序或...)上下文菜单中的菜单项在Visual Studio 2008中,我没有必要把它发布到运行IIS的实例,只是把网页内容与bin文件夹上一些地方目录。有没有办法将其添加后生成的事件,或作为一个MSBuild任务?

I would like to simulate "Publish..." menu item from WCF Service project (or ASP.NET Web Application or...) context menu in Visual Studio 2008. I do not have a need to publish it to a running IIS instance, just to put the web content together with bin folder on some local dir. Is there any way to add it in post build events, or as a MSBuild task?

推荐答案

下面是答案,得益于此链接: http://codingcockerel.co.uk/2008/05/18/how-to-publish-a-web-site-with -msbuild / 所以,我刚才修改的Web应用程序中的.csproj文件,并写了这为AfterBuild目标(即已经在那里了):

Here is the answer, thanks to this link: http://codingcockerel.co.uk/2008/05/18/how-to-publish-a-web-site-with-msbuild/ So, I have just modified the .csproj file of web application, and wrote this into AfterBuild target (that was already there):

<Target Name="BeforeBuild">
    <Message Text="##############Before build##################" Importance="high"/>
    <RemoveDir Directories="publish"
        ContinueOnError="true"/>
</Target>
<Target Name="AfterBuild">
    <Message Text="##############After build##################$(OutputFolder)" Importance="high"/>
    <MSBuild Projects="$(ProjectName).csproj"
           Targets="ResolveReferences;_CopyWebApplication"
           Properties="WebProjectOutputDir=publish\;OutDir=publish\bin\" />
</Target>

这篇关于使用命令行发布的WCF服务(或ASP.NET Web应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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