开发者

Build (and Debug) ASP.NET Web Application in a non-default folder location

开发者 https://www.devze.com 2023-04-01 06:02 出处:网络
I have a Visual Studio 2008 solution with an ASP.NET Web Application project.I want to change the default output folder, of said project, to $(SolutionDir)\\WebApps\\$(ProjectName)\\bin.This I can do

I have a Visual Studio 2008 solution with an ASP.NET Web Application project. I want to change the default output folder, of said project, to $(SolutionDir)\WebApps\$(ProjectName)\bin. This I can do and when I build I get the expected assembly files in this folder. It doesn't copy the content files (aspx, etc.) to the parent folder but I have managed to fix this by 开发者_C百科hacking the project.csproj file with a custom build target.

The problem is I want to be able to debug this application using the ASP.NET Development Server, by pressing F5 in VS2008. Unfortunately the ASP.NET Dev server starts, has a "Physical Path", in the project directory rather than the parent of the output directory.

Is there any way to build my web application to a different output folder but still run the asp.net dev server to debug my site?

Thanks.


Short answer is yes, but it isn't pretty. The process I used is given below.

  1. Unloaded the project in VS.
  2. Manually edited the .csproj file to include a post build action that basically copies the content files (aspx, etc.) to the parent of the output folder.
  3. For the debug options I set the project to launch an external executable. The Asp.Net Development server. Also manually set the url to launch.

What I learnt? I wouldn't do this, I'd just stick with the default and create an install/web deployment project instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消