Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
I have Visual Studio 2013 installed. I also have XNA 4.0 installed, but that's not causing the problem since I tried creating a project without using an XNA template or XNA code, and I got this same error. I'm running this on Windows 7 64 bit. I created a project called "Tetris Attack". I did absolutely nothing with the code, so it's just simply everything given in the template. What should happen is the code should run, and I should get a window whose contents are simply the color blue. I tried to run it in debug mode (the same thing happens in release mode), and I got this in the output window:

The program '[5916] Tetris Attack.exe: Program Trace' has exited with code 0 (0x0).

The program '[5916] Tetris Attack.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.


It didn't run the program. I get the same problem no matter what project I try to run. It gives me some stuff not relevant to this problem in the output, then it gives me what I have above. How do I fix this? The code runs just fine if I "start without debugging", so there must not be anything wrong with the code. If you want to see everything given to me in the output window, you can find it here: http://stackoverflow.com/questions/22626646/i-got-an-access-violation-error-on-a-brand-new-untouched-project[^]

Update: I tried installing Visual Studio 2013 on a separate computer and tried debugging various types of projects on that, and I have not experienced this problem in any way. It must have something to do with my computer. What does anyone think it is?
Posted
Updated 7-Jun-16 5:20am
v3
Comments
Sergey Alexandrovich Kryukov 26-Mar-14 16:46pm    
If you did "absolutely nothing" to the code, its author did. The post is totally non-informative.
—SA
PianoMastR64 27-Mar-14 0:07am    
Your comment is non-informative. Tell me exactly what information you need to be able to help me with my problem. Otherwise you're just trolling. Do you not understand the problem? Do you need anymore information about something specific? What is it? When I say I did nothing to the code, I mean it gave me a template to work with which, when ran, will create a window with nothing but blue inside it. I didn't add any more code to it, so it should work.

I've been stuck on this problem for 3 days now, and it's starting to get old. It would be nice if someone were to help me.
Sergey Alexandrovich Kryukov 27-Mar-14 0:43am    
No, no, no. My comment is not even supposed to be informative, because I'm not asking for help and not making any technical statement. Calm down.

Please realize, I don't need anything, you do. If you are interested in some help, you will be able to provide enough information.

Good luck.
—SA
PianoMastR64 27-Mar-14 2:24am    
I didn't mean that to sound like I have any negative emotions toward your comment. I was just presenting to you what I thought to be relevant information. I am however frustrated with the problem I'm having. I'm also frustrated with the lack of help, but that has nothing to do with you since you at least replied in some form.

Although, apparently I misunderstood your comment. Are you saying the author of the template I was using might have flawed code? If so, I know that's not the case because I tried skipping the debug process and just running the code, and it worked perfectly fine.

I have no clue what you mean by "The post is totally non-informative." if you're not talking about my post you commented on. I'm also not sure why you think that I think you need help from me.
Sergey Alexandrovich Kryukov 27-Mar-14 2:53am    
I understand. Yes, the author's code could be flawed. Good code work on many different systems of different versions flawlessly. Not running under the debugger is important information, and is a really bad sign. Is such cases, one typical syndrome to suspect is race condition (incorrect dependency of execution on the timing). Roughly speaking, debug process slightly delays threads, one of the thread goes a bit ahead of time, and, due to incorrect (and unintended) dependency of timing, something bad happens. Sometimes, such condition can be revealed by adding some artificial delay in some strategically chosen point(s) (god forbid, not for "fixing", just for revealing the problem). But it need thorough study of the code; and experimental approach is not very helpful. It really, really needs much more detailed information. Such things are not easy, but good experience helps to spot such problems...
—SA

I have the solution to my problem. Make sure you are running Visual studio as an administrator.

To make Visual Studio always run as an administrator:
-Right click the shortcut that leads to Visual Studio.
-Click "Properties".
-Go to the "Compatibility" tab.
-Check the box "Run this program as an administrator".
-Click "OK".

To run Visual Studio as an administrator once:
-Right click the shortcut that leads to Visual Studio.
-Click "Run as administrator".
 
Share this answer
 
1) It looks like from the application message is that your application is going to use some memory location that it should not going to use or not provided access(visual studio has less privileged mode or application (Tetris) is runnning in less privileged mode.)

so can try with running visual studio in administrator mode.


2)Might be physical location which were used by your application having some problem.So my suggestion is that if u failed to regenerate above scenario u can try with Restarting Visual studio and Machine as well...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900