简体   繁体   中英

Changing Output path in web project in VS2010

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.

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM