使用带有 Direct3D 控件的 Visual Studio 2010 时,什么可能会导致延迟?
我有一个非常烦人的问题。当使用 .NET 4.0 框架和 Direct3d 进行托管代码编写 C# 应用程序,并在用户控件内创建设备(以便我可以将其用作一种视口)时,我的 Visual Studio 2010 在第一个之后开始“滞后”编译它。当我输入内容时,会出现大约 0.5 秒 - 1 秒的延迟,直到显示输入的文本。通过向下翻页、向上翻页或箭头键滚动时也会出现相同的延迟。对于其他更大的项目 - 具有多达 1000 个源文件 (C++) 或其他 C# 项目 - 不存在这样的问题。鼠标交互也会延迟 0.5 秒 - 1 秒。
所以我的问题是什么可能导致这个问题以及如何避免它?
编辑:另一个提示是我经常通过编译它得到:
Unable to copy file "obj\x86\Debug\Direct3DTest.exe" to "bin\Debug\Direct3DTest.exe". The process cannot access the file 'bin\Debug\Direct3DTest.exe' because it is being used by another process.
I've got a really pesky problem. When writing a C# application using the .NET 4.0 framework and Direct3d for managed code, and creating a device inside a user control (so that I can use it as a kind of viewport), my visual studio 2010 starts "lagging" after the first compile of it. When I type something, there is a delay about 0.5s - 1s until the typed text is shown. The same delay occurs while scrolling via page down or page up or arrow keys. With other projects which are even bigger - with up to 1000 source files (C++), or other C# projects - there is no problem like this. Mouse interaction also delays for 0.5s - 1s.
So my question is what could cause this problem and how can I avoid it?
EDIT: One more hint is that I often get by compiling it:
Unable to copy file "obj\x86\Debug\Direct3DTest.exe" to "bin\Debug\Direct3DTest.exe". The process cannot access the file 'bin\Debug\Direct3DTest.exe' because it is being used by another process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能在设计视图中将 UserControl 在其自己的文档中打开或嵌入到表单中。这可能会导致在 VS 内创建 DirectX 设备。检查是否是这种情况,如果是这样,您应该能够查明您的控件是否处于设计模式(在 VS 中)或运行时模式。
You probably have your UserControl in design view opened either in it's own document or embedded in your form. This probably causes a DirectX device to be created inside VS. Check fi that's the case and if so you should be able to find out if your control is in design mode (in VS) or in runtime mode.