System.MethodAccessException was unhandled
Message=Attempt to access the method failed: System.IO.Path.GetFullPath(System.String)
StackTrace:
at Sharpen.IO.File.GetCanonicalPath()
at Db4objects.Db4o.IO.FileStorage.FileBin..ctor(BinConfiguration config)
at Db4objects.Db4o.IO.FileStorage.Open(BinConfiguration config)
at Db4objects.Db4o.IO.StorageDecorator.Open(BinConfiguration config)
Db4objects.Db4o.Ext.Db4oRecoverableException was unhandled Message=Db4oRecoverableException StackTrace: at Db4objects.Db4o.Internal.ObjectContainerBase.GetByID(Transaction ta, Int64 id) at Db4objects.Db4o.Internal.Fileheader.FileHeaderVariablePart.ReadIdentity(LocalTransaction trans) at Db4objects.Db4o.Internal.Fileheader.NewFileHeaderBase.ReadIdentity(LocalObjectContainer container)
这时一个ReCoverableException.目前官方对于这个异常我没有找到相关说法. ok. 创建TESt.DB4o文件成功后创建一个实体类来直接保存数据对象 如果我们这样定义:
1: ///
2: /// use Data Model ProductCode EntityMode
3: /// Sign by chenkai Date:2010年10月19日11:21:02
4: ///
5: public class ProductCode
6: {
7: public string CodeId { get; set; }
8: public string CodeName{get;set;}
9: public string CodeState{get;set;}
10: public string CodeDate{get;set;}
11: }
当我们建立一个ProductCode对象并保存时 会提示一个异常:
1: //执行Linq查询
2: var q = from myproductcode getcode in app.db
3: where getcode.ObjectID == oid and Codename="chenkaiCode"
4: select getcode;
偶尔程序会自动报出一个异常:
System.MissingMethodException was unhandled Message=Method not found: quality rlib, Version=3.7.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC.System.Type. StackTrace: at JournalIt.JournalEntryListPage.PhoneApplicationPage_Loaded(Object sender, RoutedEventArgs e) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
1: // Code to execute on Unhandled Exceptions
2: private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
3: {
4: if (System.Diagnostics.Debugger.IsAttached)
5: {
6: // An unhandled exception has occurred; break into the debugger
7: System.Diagnostics.Debugger.Break();
8:
9: //you get out the Mainpage ???? why ?
10: //sign by chenkai
11: MessageBox.Show("you get ou t! by UnhandleException");
12: }
13: }
很怪异啊.