.NET框架中存储断点的位置 [英] Where to Store Break Point In .NET framwork

查看:134
本文介绍了.NET框架中存储断点的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我只想知道在.NET Framework中存储断点的位置
是否有存储断点的数据库
或其他任何位置

请告诉我
在此先感谢

Hi Dear ,

I just want to know where to store Break Point in .NET Framework
Is there any database that store Break point
or any other location

plz tell me
Thanks in Advance

推荐答案



只是要澄清一下:框架中没有断点!您可以在Visual Studio中进行设置,并将它们的位置保存在与解决方案文件(.sln)相对应的.suo文件中.

从VS2010开始(不在Express版本中),您可以(在另一台计算机上)导出和导入它们.请参阅MSDN文档 http://msdn.microsoft.com/en-us/library/dd293657.aspx [ ^ ]

干杯
Jürgen
Hi,

just to clarify: there are no breakpoints in the framework! You can set them in Visual Studio and their location is saved in .suo-file which corresponds to the solution file (.sln).

Since VS2010 (not in the Express vesions) you can export and import them (on another machine). See MSDN documentation http://msdn.microsoft.com/en-us/library/dd293657.aspx[^]

Cheers
Jürgen


在.NET中-无处. .NET Framework与断点无关.一组具体的断点及其状态仅与开发过程有关,并且其持久性可以归于开发工具.

我只是检查了有关Visual Studio断点存储位置的猜测.一个简单的实验证实了我的猜测:断点归因于解决方案(而不是项目)的状态,并存储在.suo文件中.该文件不应被视为源代码的一部分.这是一个临时文件,用于在开发过程中保持解决方案状态.不应将其发布,使用版本控制系统将其放入代码库,在将解决方案移至其他位置时保留等.这样做是常见的错误.


与.NET Framework相关的 是使用类System.Diagnostics.Debugger
In .NET — nowhere. .NET Framework has nothing to do with breakpoints. A concrete set of breakpoints and their states is related to development process only and its persistence can be proprietary to development tools.

I just checked up my guess about where breakpoints are stored by Visual Studio. A simple experiment confirmed my guess: the breakpoints are attributed to the state of a solution (and not a project) and are stored in the .suo file. This file should not be considered as a part of source code. This is a temporary file used to persist solution state during development; it should not be published, put to the code base using Revision Control system, preserved when a solution is moved to a different location, etc. Doing so is a common mistake.


What is related to .NET Framework is the support of debugging in the .NET application using the class System.Diagnostics.Debugger, http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.aspx[^]. This is something different from the breakpoints you mean, but is important part of .NET functionality. I appreciate the post by Simon where he pointed it out.

—SA


虽然Jürgen和SA是正确的,但如果您要使用
While Jürgen and SA are correct, I suppose you could say you stored a breakpoint in you assembly if you were to use Debugger.Break[^]

However get the feeling that you do not speak of breakpoints used for debugging, but something else, perhaps how to log information about where your application crashed and burned, just guessing here :)

If you do not talk about debug breakpoints, you need to update your question so you more clearly state what you want, perhaps some examples of what you want to do might help.


这篇关于.NET框架中存储断点的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆