【问题标题】:Visual studio 2008 express crashes when writing method call编写方法调用时,Visual Studio 2008 Express 崩溃
【发布时间】:2015-05-03 19:10:21
【问题描述】:

我正在使用 Google Calendar API v3 并按照示例创建我需要的 Windows 窗体应用程序。示例中提供的 getAuthorization 方法存在问题。

基本上每当我写下 aut.RefreshToken(... Visual Studio 崩溃

这是我的 getAuthorization 方法:

Private Shared Function GetAuthorization(ByVal arg As NativeApplicationClient) As IAuthorizationState
    Dim scopes() As String = { _
            CalendarService.Scopes.Calendar.GetStringValue, _
            CalendarService.Scopes.CalendarReadonly.GetStringValue _
        }
    ' Get the auth URL:
    Dim state As IAuthorizationState = New AuthorizationState(scopes)
    state.Callback = New Uri(NativeApplicationClient.OutOfBandCallbackUrl)
    Dim refreshToken As String = GetRefreshToken()
    If refreshToken <> "" Then
        state.RefreshToken = refreshToken

        'If arg.RefreshToken(state) Then
        '    SaveRefreshToken(refreshToken)
        '    Return state
        'End If
    End If

    Dim authUri As Uri = arg.RequestUserAuthorization(state)

    ' Request authorization from the user (by opening a browser window):
    Process.Start(authUri.ToString())

    Dim authCode As String = ""
    While authCode = ""
        authCode = InputBox("Paste the code provided by Google here:", "Verification code")
    End While

    ' Retrieve the access token by using the authorization code:
    Dim result = arg.ProcessUserAuthorization(authCode, state)
    SaveRefreshToken(refreshToken)
    Return result
End Function

可以看出,arg.RefreshToken 块已经被注释掉了。如果我尝试取消注释或再次写入,VS 会崩溃。

我必须指出,我已经在 VS Pro 2010 上尝试过这段代码并且没有任何问题

【问题讨论】:

  • Microsoft (R) Visual Basic 编译器崩溃了
  • 也许你应该向微软发送错误报告。
  • 不幸的是,Microsoft connect 不接受 VS 2012 或更低版本的错误报告:/
  • :-( 你为什么不更新到一个新的VS版本?
  • 不能导致一些旧的工作应用程序...我将尝试在另一台使用 VS 2010 的 PC 上编译 dll,看看它是否仍然会导致 2008 崩溃

标签: vb.net visual-studio visual-studio-2008 google-api


【解决方案1】:

在 VS 2010 中自行编译 dll 中的方法按我的预期工作,但是如果有人遇到过类似情况,我将不胜感激,因为这个解决方案远非理想。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-09-16
    • 2014-12-30
    • 2011-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多