This error first appear to occur randomly.
Steps to recreate:
- Open Visual Studio and load a solution (some files automatically opened) - this is when the problem occurs
- Close all open files
- Restart visual studio and load solution (no issues)
- Open Exactly the same files again, restart visual studio and load solution so files open automatically (problem occurs!)
So the problem appears reproducible.
However, when trying to narrow it down to a single file (that is automatically opened when the solution is loaded), I couldn't reproduce the problem. Now with all the files open again the problem doesn't occur!!! So it looks like it is fixed - though this happened before and eventually the is开发者_JAVA技巧sue came back.
I think it is to do with one of the user controls with DevExpress controls on it - when the error occurs, the designer displays the error. Though I can't reproduce it at the moment to confirm that.
This has stopped happening for the time being, so I can't reproduce it.
Try to catch the exception and post the callstack here. To grab the callstack, try to use the approach described in the What information do you need to fix a problem, which occurs with your products at design time?. Also, please make certain that the CopyLocal attribute for DevExpress assemblies referenced by your project is set to false. Also, the bin folder of your application should not contain our assemblies. Perhaps, this will help you to address this issue.
This type of error occurs when you try to pass a null pointer to a native method and that method tries to read from that null pointer, which throws up this error. Look in your code for some P/Invoke or a 3rd party DLL you may be using which is possibly using P/Invoke.
Once you find the possible method, just put a check in the parameters to make sure no parameter is null (or in VB.NET, Nothing)
精彩评论