开发者

What could cause lag using Visual Studio 2010 with a Direct3D control?

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 an开发者_运维百科d 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.


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜