以下はvb.netで書かれた私のコードです。
Protected Sub OpenIdButton3_LoggedIn(ByVal sender As Object、ByVal e As DotNetOpenAuth.OpenId.RelyingParty.OpenIdEventArgs)Handles OpenIdButton3.LoggedIn
OpenIdButton3.Visible = False
薄暗いプロファイルAsClaimsResponse= e.Response.GetExtension(Of ClaimsResponse)()
Dim email As String = profile.Email
MsgBox(メール)
サブ終了
しかし、ライン
Dim email As String = profile.Email
次のエラーが発生しています。
例外の詳細:System.NullReferenceException:オブジェクト参照がオブジェクトのインスタンスに設定されていません。
これに関連するドキュメントを読み、webconfigにAXFetchAsSregTransformを実装しました。以下は同じことを示すブロックです。
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
<section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true" />
<section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
<section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
<section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
<section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
</sectionGroup>
> <dotNetOpenAuth>
<openid>
<relyingParty>
<add type="DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
</behaviors>
</relyingParty>
</openid>
</ dotNetOpenAuth>
それでも、null値を取得しているようです。Googleから認証を受けています。
誰かがこれについて私を助けることができますか?