8 Replies - 2086 Views - Last Post: 16 August 2012 - 12:56 PM Rate Topic: -----

#1 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

how to handle system.AccessViolationException

Posted 15 August 2012 - 04:04 AM

I am working on asp.ne c# web application, my project was working fine. once i closed it and then restart it.now when i try to open .cs file it gives an error(system.AccessViolationException) and visual studio exits.

this was my thesis project and my complete project's code was under this .cs file
I am very much confused what to do as my complete project has been lost...

any suggestion how to handle this error ?????

thanks

Is This A Good Question/Topic? 0
  • +

Replies To: how to handle system.AccessViolationException

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3160
  • View blog
  • Posts: 9,532
  • Joined: 05-May 12

Re: how to handle system.AccessViolationException

Posted 15 August 2012 - 04:59 AM

Your project is not lost. You just can't open it with Visual Studio. If you go to the directory, your .cs and .aspx files should still be intact if you inspect them with notepad or some other text editor.

Try deleting the .dll's generated by your project. This usually prevents the Visual Studio Designer from loading any of your custom controls when you try to open a form (webform or winform) in designer view.

This post has been edited by Skydiver: 15 August 2012 - 05:00 AM

Was This Post Helpful? 0
  • +
  • -

#3 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

Re: how to handle system.AccessViolationException

Posted 15 August 2012 - 10:00 AM

View PostSkydiver, on 15 August 2012 - 04:59 AM, said:

Your project is not lost. You just can't open it with Visual Studio. If you go to the directory, your .cs and .aspx files should still be intact if you inspect them with notepad or some other text editor.

Try deleting the .dll's generated by your project. This usually prevents the Visual Studio Designer from loading any of your custom controls when you try to open a form (webform or winform) in designer view.



I tried in both ways.
I hav deleted the .dll's and also tried opening this .cs file with notepad and wordpad. but its still not opening.
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3160
  • View blog
  • Posts: 9,532
  • Joined: 05-May 12

Re: how to handle system.AccessViolationException

Posted 15 August 2012 - 10:19 AM

View PostSabra khan, on 15 August 2012 - 10:00 AM, said:

also tried opening this .cs file with notepad and wordpad. but its still not opening.

What error are you seeing when you try to open the .cs file with notepad or with wordpad?
Was This Post Helpful? 0
  • +
  • -

#5 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

Re: how to handle system.AccessViolationException

Posted 16 August 2012 - 09:06 AM

View PostSkydiver, on 15 August 2012 - 10:19 AM, said:

View PostSabra khan, on 15 August 2012 - 10:00 AM, said:

also tried opening this .cs file with notepad and wordpad. but its still not opening.

What error are you seeing when you try to open the .cs file with notepad or with wordpad?




it shows no error with notepad or wordpad. but .cs file's content are not displayed, just a blank paage opens
Was This Post Helpful? 0
  • +
  • -

#6 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

Re: how to handle system.AccessViolationException

Posted 16 August 2012 - 09:15 AM

when i just select this .cs file, in preview pane it is written(file can't be previewed bcz it is in use)
Was This Post Helpful? 0
  • +
  • -

#7 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3160
  • View blog
  • Posts: 9,532
  • Joined: 05-May 12

Re: how to handle system.AccessViolationException

Posted 16 August 2012 - 10:54 AM

It sounds like there is another program has those files locked open for exclusive access. A short term fix is to reboot in the hopes that will kill the other application that is holding your files open.

A long term fix is to actually find out what is holding them open. You can use tools like the handle.exe from SysInternals.
Was This Post Helpful? 0
  • +
  • -

#8 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

Re: how to handle system.AccessViolationException

Posted 16 August 2012 - 12:45 PM

View PostSkydiver, on 16 August 2012 - 10:54 AM, said:

It sounds like there is another program has those files locked open for exclusive access. A short term fix is to reboot in the hopes that will kill the other application that is holding your files open.

A long term fix is to actually find out what is holding them open. You can use tools like the handle.exe from SysInternals.



I tried it but itz also not showing .cs file in runing processes.. I also tried taskbar to show background processes, but that is also not showing this file to be open...
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3160
  • View blog
  • Posts: 9,532
  • Joined: 05-May 12

Re: how to handle system.AccessViolationException

Posted 16 August 2012 - 12:56 PM

No, the taskbar and task manager will not show your file directly. That is why I suggested using handle.exe which will show your file if it is being held open.

So you tried the reboot, and you are still getting the error with the preview pane?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1