Visual studio 2008 express 在编写方法调用时崩溃
Visual studio 2008 express crashes when writing method call
我正在使用 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 上尝试过这段代码并且没有任何问题
在 VS 2010 中单独编译一个 dll 中的方法按我预期的方式工作,但是如果有人遇到过类似的事情,我将不胜感激任何帮助,因为这个解决方案远非理想。
我正在使用 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 上尝试过这段代码并且没有任何问题
在 VS 2010 中单独编译一个 dll 中的方法按我预期的方式工作,但是如果有人遇到过类似的事情,我将不胜感激任何帮助,因为这个解决方案远非理想。