Reference project “readonly” in Visual Studio?

2019-04-30 08:40发布

问题:

I have two applications in two solutions in VS2008 that share a common dll, the dll-code is included as a project in the first applications solution.

Is it possible to allow the second solution to reference the dll project "readonly"?

I want whoever opens the second solution to be able to step into the dll during debugging but not be able to change the code.

回答1:

I would simply build against the dll+pdb. The pdb is enough to step into code, without ever being able to edit it. You can enable pdb (debug symbols) as an output in project properties.

For loading pdb files, Shawn Burke's walkthrough here (for the .NET framework itself, but the same concept applies, just from a different location) should get you started.