当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - What are the consequences of setting same output path for all configurations?

问题描述:

In order to debug Web API projects in Visual Studio 2013, I had to set output path for the Debug configuration to bin\ (meaning files end up in {ProjectName}\bin relative to the solution root folder) as can be seen from some of the answers here.

But now I face the issue that we have used the path bin\{ConfigurationName} in several places in our build server setup. I would very much like to unify the setup for Debug and the other Visual Studio configurations.

Therefore my question is: do you know of any problematic consequences of unifying the output folder for all configurations to be bin\, leading to folder structure {ProjectName}\bin?

If you do, is there any way to debug a Web API project without changing the output folder from bin\Debug\ ?

网友答案:

No Consequences:

By default, Project builds are stored in Project directories like:

{Solution}/{Project}/obj/Debug/{Project}.dll    
{Solution}/{Project}/obj/Release/{Project}.dll

A folder for each build type in each Project folder


If all your binaries were output to the same directory, they would

  • link the same way at run-time in your development environment
  • resolve dependencies the same way
  • deploy the same way

The result would be directory structure of

{Output Directory}/Debug/{Project}.dll    
{Output Directory}/Release/{Project}.dll    

The IDE is customizable:

There is no requirement to keep Project builds in Project directories. Project build Folders are a configuration default. The IDE was designed to allow you to work around your comfort zone. If you prefer to group all assemblies, or find that it resolves an issue, you are free to change this build configuration.


Problems De-bugging Web-API?

You should not have to change the output path to Debug Web API. Attach your Web-API to a worker process.

1) click on your Web API Project in VS Explorer

2) click debug in Visual Studio Menu

3) click Attach to Process...

4) click / select all processes named w3wp.exe

分享给朋友:
您可能感兴趣的文章:
随机阅读: