0

I have a bare ASP.NET application with only a web.config and global.asax, is it possible to build the application as if i am publishing the entire application to a specific folder (and debugging from that specific folder) instead of VS201x running off of the default bin folder?

i.e.

  • x:\path\to\webapp\service\global.asax
  • x:\path\to\webapp\service\web.config (transformed)
  • x:\path\to\webapp\service\bin\*.*

The reason i want to do this is that this particular ASP.NET web application is dynamically loading assemblies and creating routes dynamically (depending on the classes decorated by a certain attribute, as is basically a WCF service)

so in the end, my build folder would be something like:

  • x:\path\to\webapp\service\global.asax
  • x:\path\to\webapp\service\web.config (transformed)
  • x:\path\to\webapp\service\bin\*.*
  • x:\path\to\webapp\plugins\plugin1\*.*
  • x:\path\to\webapp\plugins\plugin2\*.*

I can provide additional info if needed

Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
bose
  • 13
  • 1
  • 3
  • This question is somewhat similar to what i needed: http://stackoverflow.com/questions/17429650/asp-net-webdeploy-include-folder-generated-in-post-build-of-sub-project – bose Oct 06 '13 at 12:29
  • Shadow Wizard's link is exactly what i needed: http://stackoverflow.com/questions/7076971/publish-a-web-application-from-the-command-line – bose Oct 06 '13 at 12:41

1 Answers1

1
  1. In Visual Studio, right click the ASP.NET project and choose Properties.
  2. Go to the Build tab.
  3. Click the button marked in red to select new build folder:

Edit: figured you actually want to Publish the project automatically after successfully building it, so to achive this follow the steps described here to make command line utility that will do that then add the command line as post-build event:

Community
  • 1
  • 1
Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
  • yes of course, but what i need is to simulate a "publish" during a build, so all of the necessary files are copied to another folder (the global.asax and transformed web.config) – bose Oct 06 '13 at 12:32
  • The project folder would be in x:\some\path\to\aspnet\project\ whilst the build (published) folder would be somewhere else like x:\path\to\build\ – bose Oct 06 '13 at 12:34
  • You can follow the answer [here](http://stackoverflow.com/q/7076971/447356) to have command line publish and add the command line as Post-build event. – Shadow The GPT Wizard Oct 06 '13 at 12:38