开发者

Changing Output path in web project in VS2010

开发者 https://www.devze.com 2023-02-02 22:30 出处:网络
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 A

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 expe开发者_StackOverflow社区cts 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.


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.


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.

0

精彩评论

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