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

2

1 Answer 1

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:

Sign up to request clarification or add additional context in comments.

3 Comments

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)
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\
You can follow the answer here to have command line publish and add the command line as Post-build event.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.