开发者

Is there a simple way to switch between a project and it's dll

We often have a set of common core libraries that for some of our development we want to think of them as dll references and thus just reference the dlls and not include the project file.

Other times we need all projects for an intimate debugging session. I can't just have Uber.sln and Core.sln as the references are in the project files. I've had this question for several years on differen开发者_运维百科t projects but do not have any solution other than having an Uber.sln with the 50 projects.

Any ideas / hints / directions welcome!


As long as the DLLs are built with Debug and you have the PDBs, you dont need to have it included as a "project reference."

It will prompt you for the source code, or you can just open the source code in the solution and set a breakpoint.

How to show source code in debug when using .lib and dll


Develop shared dlls in their own project or projects. Compile them and add them to a lib folder in your projects which reference them.
Create a dev tree like this:

/lib
 shareddlls go here
/src
 solution.sln
 /projectfolder
  project.proj
/tools
 testing frameworks

When you debug in VS and go into your own dlls you should still be able to see the code so no need to add the shared dlls to an uber project. If you cant see the code then handle it as a black box. Debug what goes in and what comes out. If it is not what you expect then the issue is in the shared dlls. Go and debug them in their own projects.

Use a testing framework to test your shared dlls in their own project. -----


I think the nearest answer I've come up with is including all the projects in the solution and also a dll project which when compiled would send the prod / canned dlls to the output dir.

Then by using different configurations I could switch between the Debug configuration with the projects being built to the Release configuration with just the dll project being built.

Will give it a go and report back....


Only 11 years after the original post I have a simple solution.

  1. On the dll project / class Library make sure to turn off 'Debug Symbol' generation on all release configurations, as her:

    Old project type properties
    New SDK based projects or Alter the .csproj file

  2. And this 'Pre-Build Event' command in the starting project's Debug configuration. This will delete all old '.pdb' files in the output folder

  3. Now to switch between debugging the dll(s) and not, just switch between release and debug in Configuration Manager. But make sure to perform at total rebuild after switching to Debug

Note that 1) and 2) is a onetime setup.

Thats it

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜