Changing Output path in web project in VS2010
Asked Answered
B

3

15

I have several ASP.NET web projects and their Output folder are set to "C:\Builds\[ProjectName]bin" (instead of the default "bin\" folder). This makes "F5" Debugging not working because the ASP.NET Development Server expects the "bin" folder under the project folder.

I then changed to use Local IIS Web server (http://localhost/webproject1") and manually updated the vdir physical path to my custom output path. However the VS2010 will not load the csproj because it detects the url is already mapped to a different folder location.

I know I probably shouldn't change the Output folder. But wondering if there is an easy way to workaround this? The goal is to make "F5" debugging work with custom build Output folders.


Update due to Aristos' answer:

Thanks Aristos. Unfortunately that won't solve the problem. All my projects already use the Project Reference, so all the reference dll's are correctly copied to the output folder. The reason why F5 debugging does not work is because the output folder is not the normal "bin" sub folder, but in some other path say C:\BuildsOut\Foo\bin.

It seems that in order to use F5 to debug the web project in VS2010, it has to use the default Output path "bin". If you change that, then F5 will not work and even worse your project may not even load.

Bixby answered 7/1, 2011 at 23:13 Comment(1)
Try having these projects under the same "solution". Not sure but worth trying.Zealand
G
1

Ian,

I have been frustrated by the same problem. I finally gave up and put this dirty little fix in place. I added the following to the "Post-Build" event:

copy "$(TargetDir)MyWeb.dll" "$(ProjectDir)bin"
copy "$(TargetDir)MyWeb.pdb" "$(ProjectDir)bin"

This at least lets me debug the site properly and hit my breakpoints.

Gaslit answered 30/9, 2011 at 13:47 Comment(0)
B
0

You place them all on one single solution, you set as the started project your web project, and then you add on your web project the rest dll as reference (right click on web, select on menou "add reference", and automatically gets the latest version of dlls and place them on bin.

Now when you ress F5 if anyone dll project needed is automatic build it, then run the subproject with the new dll inside.

Barker answered 8/1, 2011 at 2:12 Comment(0)
O
0

Delete all items in your bin folder for the solution in question, shut down your system and restart. This fixed it for me at least.

Ossein answered 30/7, 2013 at 20:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.