Reputation: 1507
I'm suffering a really stupid problem. I've tried completely reinstalling .NET and it hasn't fixed the problem. I can't even find anyone else with the same problem by Googling.
Just on my computer, if I add a NumericUpDown control to a form in a .NET project and run the application, I get the following error message upon running the application:
An unhandled exception of type 'System.AccessViolationException' occurred in System.Drawing.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The application runs fine on other machines.
Any suggestions?
Upvotes: 2
Views: 5333
Reputation: 31
Just go in the VisualStudio tools >> options >>Debugging >>JIT(Just-In-Time) and disable the check of managed ,native and script checkboxes.It has solved the problem in my case .
Upvotes: 0
Reputation: 21
I also had a System.AccessViolationException
with an error about reading protected memory when I would drag a NumericUpDown control onto a form in Visual Basic 2010 Express and then try to run the program. I am using graphics card ASUS EAH5450. Searching for a solution I found this post.
My 32bit XP system was using the driver supplied with the card, version 9.000. After uninstalling the driver, Catalyst Control Center, and GPU Tweak (all from the supplied DVD), I installed driver version 8.980 downloaded from their support link. Once installed the driver is dated 6/11/2012. I also installed Catalyst Control Center from that same download.
I added a NumericUpDown control to my form and ran the program and there was no error. Hardly conclusive proof of a fix, but a positive step and perhaps a viable solution with no hardware change.
My thanks to those who contributed to this thread.
Upvotes: 2
Reputation: 1507
Problem turned out to be graphics card related. We found a colleagues machine with the same issue, it just so happens both machines were recently fitted with the same cheap graphics card (Radeon HD5450). Both were running latest drivers.
No explanation as to why these cards/drivers caused this problem. but removing the cards and reverting to onboard graphics fixed the issue. The plan is to try a couple of cheap GEForce 210's instead.
I realise this wasn't a programming issue per se, but this might save someone else a few hours of fart arsing around!
Upvotes: 3