Question

This must have been answered before, but I've been searching for hours and for some reason I just can't see it, so excuse me if this turns out to be a massive n00b question... I'm going to be overly specific about actions because I think the terminology is incredibly confusing (to me anyway).

I have a VS2012 .Net 4 "ASP.NET Web Forms Application" type project; the type that is compiled to one (or more) assemblies then deployed to a site.

In VS2012 clicking "Publish..." on the project node in Solution Explorer displays the "Publish Web" dialog which allows one to configure a "Publish Profile". I have named mine "Dev" and configured it as a File Publish with various options. I am not using the "Package/Publish Web" options, nor do I have any interest in generating Zip files or other packaging systems.

What I would like is CTRL+SHIFT+B and F5 to not only build this project, but publish it using this profile. To do this I assume I will need to modify the csproj, but honestly I don't see how these things are connected through the mire that is msbuild configuration.

I have seen numerous posts on custom msbuild configs, building from a TFS server, and building from a command-line but none of these address what I believe must be the simplest case, invoking Publish in place of Build

Would dearly appreciate a pointer here - in the form of csproj file snippets and some explanation what the elements of the snippet are for.

Cheers.

Was it helpful?

Solution

Not an answer, but a workaround:

For what it's worth, I've wired up CTRL+SHIFT+P as a shortcut key against the Publish menu item, so while I am not "Publish automatically upon build", at least it isn't too much effort. Note that publish performs a build as its first step, so for me now CTRL+SHIFT+P replaces CTRL+SHIFT+B for this particular project.

I wonder if, given that Publish includes Build as its first step, that it is not possible to publish as an MSBuild task because it would result in a "circular reference" of sorts, building forever. Just a thought.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top