3

对新手问题感到抱歉,但我在任何地方都找不到答案:我有一个 Visual Studio 2010 项目 (C#),在同一解决方案中对其他项目有多个依赖项。当我调试项目并尝试单步执行其中一个依赖项中的代码时,它反而会单步执行。此外,它似乎正在使用以前安装的依赖项版本,而不是使用解决方案中的版本。我怎样才能让它使用解决方案中的那个并允许步入?

4

3 回答 3

3

弄清楚了。

  1. 依赖项的编译版本安装在 GAC 中 - 需要先将它们取出。

  2. 需要打开工具->选项->调试->常规->启用我的代码。

  3. 需要为目标项目中的每个依赖项将 Copy Local 设置为 True。

  4. 就像这里的每个人都指出的那样,需要首先在调试模式下重新构建所有依赖项。

感谢大家的帮助!

于 2013-09-17T21:13:08.000 回答
2

A project's output is only copied to the referencing project's bin folder if the dependent project is build. If the project is used in more than one solution, it may have been compiled previously but it won't update projects in the open solution. If the source is unchanged relative to the binary files, then the project is not compiled and the bin folder is not updated. Use Rebuild or Clean after opening the solution to ensure the projects are in sync.

Also check in Configuration Manager that all the projects have a Build checked.

于 2013-09-17T21:07:09.423 回答
2

当您将项目添加为引用时,请使用“项目”选项卡(“添加引用”对话框)添加它们,而不是将它们添加为二进制 DLL。

于 2013-09-17T20:53:00.170 回答