{System.TypeInitializationException: The type initializer for 'Realms.Realm' threw an exception. --->
System.DllNotFoundException: realm-wrappers
at (wrapper managed-to-native) Realms.NativeCommon:register_notify_realm_changed
(Realms.NativeCommon/NotifyRealmCallback)
at Realms.Realm..cctor() [0x0004f] in <f0097c463d884e09ba2bde58b530c6d7>:0
--- End of inner exception stack trace ---
at DAL.t_MobileUser..ctor() [0x0001e] in
D:\visual studio 2015\Projects\RBankCI\DAL\t_MobileUser.cs:17
at BLL.BLL_MobileUser.m05_selectSpecific (System.Int32 id) [0x00013] in
D:\visual studio 2015\Projects\RBankCI\BLL\BLL_MobileUser.cs:34
at RBankCI.Activity_PDRN.m7_btnSaveClick() [0x00008] in
D:\visual studio 2015\Projects\RBankCI\RBankCI\Activities\Activity_PDRN.cs:96 }
Iはレルムrealm = Realm.GetInstance(設定)を呼び出す場合は例外であります私は一番上にあるエラーを受け取ります。私はナゲットパッケージャからその領域をダウンロードしましたので、DllNotFoundExceptionとして何がわからないのですか?
これらのバージョンをダウンロードしようとしましたが例外は同じ結果です:2.1.0、0.82.1、0.80例外はありません)
私のサンプルコードです。
private Realm realm;
public void insert(object obj)
{
try
{
realm = Realm.GetInstance(DAL_DBAccessVariable.config); //Error occur here
ENT_MobileUser entity = (ENT_MobileUser)obj;
using (var transaction = realm.BeginWrite())
{
DAL_MobileUserEntity dbTable = realm.CreateObject<DAL_MobileUserEntity>();
dbTable.id = entity.id;
dbTable.firstName = entity.firstName;
dbTable.middleName = entity.middleName;
dbTable.lastName = entity.lastName;
dbTable.userID = entity.userID;
dbTable.userPinCode = entity.userPinCode;
dbTable.licenseKey = entity.licenseKey;
dbTable.licenseExpiry = entity.licenseExpiry;
transaction.Commit();
}
}
catch (Exception e)
{ throw; }
}
役立つ可能性がある場合、これはDAL_DBAccessVariables
using Realms;
using System;
using System.IO;
namespace DAL
{
public class DAL_DBAccessVariable
{
private const string databaseName = "name.realm";
public static readonly string dbPath =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), databaseName);
public static readonly RealmConfiguration config = new RealmConfiguration(dbPath);
}
}
追加に関する情報です。私はxamarinを最新のバージョン、visual studio 2015 professionalにアップデートしました。
あなたのbin、obj、パッケージフォルダをクリアして再構築してみてくださいあなたの解決策。 –
私はまだ私の新しいプロジェクトでこの問題を抱えています。他のプロジェクトを実行しようとしましたが、それは機能しています。 – jace