启用本机代码调试时 AccessViolationException 消失 [英] AccessViolationException goes away when native code debugging is enabled

查看:36
本文介绍了启用本机代码调试时 AccessViolationException 消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行 Google Drive API 示例,在 Windows 7 x64 上的 Visual Studio 2012 中.我的项目针对 .Net 4.5.我在第 185 行收到异常:

I get an AccessViolationException when I run the Google Drive API sample in Visual Studio 2012 on Windows 7 x64. My project is targeting .Net 4.5. I get the exception on line 185:

await service.Files.Delete(file.Id).ExecuteAsync();

  • 它发生在调试和发布模式以及所有平台(x86、x64、AnyCPU)中.
  • 当我在没有附加调试器的情况下运行时不会发生这种情况(开始而不调试").
  • 当我在项目属性中启用启用本机代码调试"时不会发生这种情况.
  • 为什么启用本机代码调试可能会阻止异常的任何想法?

    Any ideas why enabling native code debugging might prevent the exception?

    注意:运行示例需要 NuGet 包(预发布):Google.Apis.Drive.v2

    Note: running the sample requires the NuGet package (prerelease): Google.Apis.Drive.v2

    我希望谷歌人能插话并告诉他们是否也看到了这个,因为 示例说明 说:

    I wish Google people would chime in and tell if they've seen this as well because the sample instructions say:

    • 使用 Visual Studio 打开 GoogleApisSamples.sln
    • 点击构建 > 重建解决方案
    • 执行 Drive.SampleinDebug 中的 .exe

    这很奇怪,因为他们不遗余力地直接从调试文件夹中执行 exe,而不仅仅是说运行示例".

    which is weird since they go out of their way to execute the exe directly from the debug folder instead of just saying "Run the sample".

    推荐答案

    这只是在黑暗中的一个镜头,但我遇到了类似的问题,结果证明是由 Visual Studio 托管过程引起的.
    您可以禁用它并查看是否有任何更改.

    It is just a shot in the dark, but I had a similar issue which turned out to be caused by the visual studio hosting process.
    you can disable it and see if anything has changed.

    您可以从项目属性 > 调试 > 取消选中启用 Visual Studio 托管服务

    You can do it from Project properties > Debug > uncheck the Enable the visual studio hosting service

    这篇关于启用本机代码调试时 AccessViolationException 消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆