Attempted to read or write protected memory in a blank form  
Author Message
Pra_na_b





PostPosted: Visual C# General, Attempted to read or write protected memory in a blank form Top

While testing one applications in C#, I encounter a problem and the error message was some memory error and restarted VS. After that what ever application, those were working fine earlier is giving me the following error message:

 

“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”

 

Finally I though of creating a new application, surprisingly here also I got the same error. It is a new Window Application in C# containing a single form with out any control on it. When I run the application it stops at the below line in private void InitializeComponent().

 

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

 

I comment that line, the application runs and I can see the blank form. Now I thought of putting some control on the form and I stopped the application and I was on the code window of the Form1, hence I pressed Shift+F7 to move to design mode, VS propmted the same error message, yes the same

 

“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”

 

And it kept on adding in the error list tab as warning, the number of time I pressed the Shift+F7 the warning entry increased with the same error message.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Please help to get rid of this. I am now stuck and can not do any job.



Visual C#1  
 
 
Charlie Calvert MSFT





PostPosted: Visual C# General, Attempted to read or write protected memory in a blank form Top

I have no idea what is wrong, but it sounds a little like you have something wrong with either your installation of Visual Studio or your system. You might try a reinstall of Visual Studio and possibly also scan your hard drive for errors.

- Charlie