以下是我用vb.net編寫的代碼。OpenIdButton的擴展返回null
保護小組OpenIdButton3_LoggedIn(BYVAL發件人爲對象,BYVALË作爲DotNetOpenAuth.OpenId.RelyingParty.OpenIdEventArgs)把手OpenIdButton3.LoggedIn
OpenIdButton3.Visible =假
昏暗簡介作爲ClaimsResponse = E。 Response.GetExtension(OF ClaimsResponse)()
昏暗電子郵件作爲字符串= profile.Email
MSGBOX(電子郵件)
結束子
但是
線昏暗電子郵件作爲字符串= 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>
即使這樣,我似乎得到空值。我正在從Google獲得身份驗證。
任何人都可以幫助我嗎?