DotNetOpenAuthの簡単なチュートリアルに従っています。ローカルホストのビジュアルスタジオ開発マシンで実行すると、正常に動作します。
ただし、monoを実行しているテスト/ステージングサーバーに移動するとすぐに、次のエラーがスローされます。
場所:Page_Load
An exception was thrown by the type initializer for DotNetOpenAuth.Reporting
InnerException: System.TypeInitializationException: An exception was thrown by the type initializer for DotNetOpenAuth.Logger ---> System.TypeLoadException: A type load exception has occurred.
at DotNetOpenAuth.Logger.Create (System.String name) [0x00000] in <filename unknown>:0
at DotNetOpenAuth.Logger.CreateWithBanner (System.String name) [0x00000] in <filename unknown>:0
at DotNetOpenAuth.Logger..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at DotNetOpenAuth.Reporting.Initialize () [0x00000] in <filename unknown>:0
at DotNetOpenAuth.Reporting.set_Enabled (Boolean value) [0x00000] in <filename unknown>:0
at DotNetOpenAuth.Reporting..cctor () [0x00000] in <filename unknown>:0
StackTrace: at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor (ICryptoKeyStore cryptoKeyStore, INonceStore nonceStore) [0x00000] in <filename unknow n>:0
at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor (IOpenIdApplicationStore applicationStore) [0x00000] in <filename unknown>:0
at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor () [0x00000] in <filename unknown>:0
at MyApp.Login_Google.Page_Load (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
私のページの読み込みコードは次のようになります。
protected void Page_Load(object sender, EventArgs e)
{
OpenIdRelyingParty openid = new OpenIdRelyingParty();
var response = openid.GetResponse();
if (response != null)
{
switch (response.Status)
{
case AuthenticationStatus.Authenticated:
// This is where you would look for any OpenID extension responses included
// in the authentication assertion.
var claimsResponse = response.GetExtension<ClaimsResponse>();
//Database.ProfileFields = claimsResponse;
//// Store off the "friendly" username to display -- NOT for username lookup
//Database.FriendlyLoginName = response.FriendlyIdentifierForDisplay;
// Use FormsAuthentication to tell ASP.NET that the user is now logged in,
// with the OpenID Claimed Identifier as their username.
//FormsAuthentication.RedirectFromLoginPage(response.ClaimedIdentifier, false);
break;
case AuthenticationStatus.Canceled:
//this.loginCanceledLabel.Visible = true;
break;
case AuthenticationStatus.Failed:
//this.loginFailedLabel.Visible = true;
break;
}
}
}
これはエラーの原因となる行です:
OpenIdRelyingParty openid = new OpenIdRelyingParty();
モノバージョン:
Mono JIT compiler version 2.10.5 (Debian 2.10.5-1)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)