Programs randomly getting System.AccessViolationException

前端 未结 6 1533
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 01:53

Okay so I have been having a lot of issues with debugging. I\'m using VS2013 Pro and Windows 8.1. Both are up to date. The issue is, when I start debugging, half the time it

相关标签:
6条回答
  • 2020-12-06 02:13

    I can confirm this problem. It occurs in a small (very trivial) WinForms program distributed with my own commercial app. It's never happened in any earlier version of VS going back to VS2005, including those run on the same machine. It only occurs in VS2013. My version of VS has no 3rd-party add-ins other than what's installed with VS itself. Problem occurs even when all code in "Main()" is commented out. I've tried rebooting, disabling virus checker, firewall, etc. Makes no difference which version of .NET my app targets either (2.0, 3.5, 4.0, whatever). It happens frequently but randomly. Sometimes it works, sometimes it doesn't. Go figure.

    0 讨论(0)
  • 2020-12-06 02:14

    I also ran into this problem on windows10 using visual studio express2015. building to x86 did not fix my problem but the following workaround did the trick:

    This issue is caused by the code which gathers return values. It is possible to work around the issue by disabling Managed return values.

    1. Go to the System properties (Win8: WinKey+X, select ‘System’, Win7: Open ‘Properties’ from my computer)
    2. Advanced System Settings
    3. Environment Variables…
    4. Click ‘New’ and add
      • Name: VSDebug_DisableManagedReturnValue
      • Value: 1

    source: https://connect.microsoft.com/VisualStudio/feedback/details/819552/visual-studio-debugger-throws-accessviolationexception

    0 讨论(0)
  • 2020-12-06 02:20

    There is nothing that looks like it may cause issues.

    Did you try enabling breaking on exception? This will cause your code to pause when it encounter an exception.

    enter image description here

    0 讨论(0)
  • 2020-12-06 02:27

    http://veriworld.verivox.ads/docs/DOC-6011?et=watches.email.document_comment#comment-4629

    Seems that in some cases VS/.net framework has memory trampling issues. I really wish people would stop saying 'it cant be' when someone says something breaks.

    0 讨论(0)
  • 2020-12-06 02:28

    Changing the Platform Target to x86 works for me, It came to a point that stepping through the code was impossible without the forementioned Exception. I run Win 8.1 64-bit and Visual Studio 2013.

    0 讨论(0)
  • 2020-12-06 02:28

    In my case, such VS behavior was caused by Comodo Firewall.

    The solution is adding VS Projects folder to Comodo HIPS exclusions list (even if the HIPS is turned off!).

    Here is a related thread Comodo forum: https://forums.comodo.com/empty-t98149.0.html

    0 讨论(0)
提交回复
热议问题