Publish WCF Service (or ASP.NET Web Application) using command line
NickName:Aleksandar Vucetic Ask DateTime:2009-05-22T23:13:16

Publish WCF Service (or ASP.NET Web Application) using command line

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?

Copyright Notice:Content Author:「Aleksandar Vucetic」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/898399/publish-wcf-service-or-asp-net-web-application-using-command-line

Answers
Aleksandar Vucetic 2009-05-25T07:25:22

Here is the answer, thanks to this link: http://codingcockerel.co.uk/2008/05/18/how-to-publish-a-web-site-with-msbuild/\nSo, I have just modified the .csproj file of web application, and wrote this into AfterBuild target (that was already there):\n\n<Target Name=\"BeforeBuild\">\n <Message Text=\"##############Before build##################\" Importance=\"high\"/>\n <RemoveDir Directories=\"publish\"\n ContinueOnError=\"true\"/>\n</Target>\n<Target Name=\"AfterBuild\">\n <Message Text=\"##############After build##################$(OutputFolder)\" Importance=\"high\"/>\n <MSBuild Projects=\"$(ProjectName).csproj\"\n Targets=\"ResolveReferences;_CopyWebApplication\"\n Properties=\"WebProjectOutputDir=publish\\;OutDir=publish\\bin\\\" />\n</Target>\n",


mundeep 2009-05-22T16:10:41

You should be able to write an xcopy command to copy the files you need to the right location.\nMicrosoft has an article about xcopy deployment for asp.net.\n\nOnce you have the command right you can put it into the Post Build actions so it automatically fires after a build.\n\nAlso see VS Post Build Event for examples on copying just the dll output (note the use of $(TargetPath) & $(TargetDir)).",


More about “Publish WCF Service (or ASP.NET Web Application) using command line” related questions

Publish WCF Service (or ASP.NET Web Application) using command line

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

Show Detail

Publish a Web Application from the Command Line

I've got a series of .NET 4 based web applications (WCF and Web) within the same solution, but need to selectively publish, from the command line. I've tried various things so far, MSBuild,

Show Detail

Publish event from service layer composed of web applications using service bus

I have read Why not publish NServiceBus messages from a web application and another similar question about this but I am not clear if this applies to service layer as well. For example, if the serv...

Show Detail

call wcf web service from command line - no program

Is there a way to call a web method in WCF without ever writing an application or using cURL as suggested in WCF - possible to call a wcf service from the command line with parameters? ? I was abl...

Show Detail

Publish WCF service and web app in same target location?

I have a solution that includes two projects: one regular asp.net Web Application developed in asp.net 4.0 and another project, a WCF Service Application. They're both under the same solution, but...

Show Detail

how to publish my WCF Service Library using MSBuild Command Line in VS 2012?

I want to Publish my WCF Service Library using MSBuild Command Line with VS2012, i don't want to do right click->Publish Website , instead i want to publish it using Command Prompt(MSBuild). What ...

Show Detail

Publish WCF Service app on IIS Express using Web Deployment

I want to publish WCF Service Application created in Visual Studio 2010 on IIS Express. So I'm using Project -> Publish -> Web Deploy: Service URL: http://localhost Site/application: wcf But ran...

Show Detail

Asp.Net Web Application authentication using WCF Service

I have a WCF service which is repsonsible for authenticating users . Unlike WCF Authentication Services , I want all authentication (including the ones from a asp.net web application) to happen at ...

Show Detail

WCF service in Web Application

I have a web application( Using ASP.NET Web Application template). there i have created an WCF service (svc file). for testing purpose i just return a list of objects of my custom class. i added re...

Show Detail

Deploying WCF Service with ASP.NET Web Application

I am having some difficulty in deploying my WCF service alongside my ASP.NET web application. I have everything working on my local machine (defined my address, bindings, contract) and I can call the

Show Detail