H.Alex
unread,Apr 14, 2011, 11:25:19 AM4/14/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ConfORM
am i the only retard on the planet that cant get it to work?
what's wrong with this?
var entities = new[] { typeof(Customer),
typeof(CustomerPreferences), typeof(Order) };
var orm = new ObjectRelationalMapper();
orm.TablePerClass(entities);
var mapper = new Mapper(orm);
var mapping = mapper.CompileMappingFor(entities);
_cfg = new Configuration(); //NH config
_cfg.Configure();
_cfg.Properties[NHibernate.Cfg.Environment.CollectionTypeFactoryClass]
= typeof(WpfCollectionTypeFactory).AssemblyQualifiedName;
_cfg.AddDeserializedMapping(mapping, null);
new SchemaExport(_cfg).Create(true, true);
_sessionFactory = _cfg.BuildSessionFactory();
shema export fails with this below while normal nh using hbm.xml's
works fine with the same code above
NHibernate.HibernateException was unhandled
Message=Could not create the driver from
NHibernate.Driver.SqlServerCeDriver.
Source=NHibernate
StackTrace:
at
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2
settings)
at
NHibernate.Connection.ConnectionProvider.Configure(IDictionary`2
settings)
at
NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary`2
settings)
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1
scriptAction, Boolean export, Boolean justDrop)
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script,
Boolean export, Boolean justDrop)
at NHibernate.Tool.hbm2ddl.SchemaExport.Create(Boolean script,
Boolean export)
at AgilePlayground.Tests.ConfORM_Fixture.TestFixtureSetUp() in
C:\Users\Aleksandar\Documents\Visual Studio 2010\Projects
\AgilePlayground\AgilePlayground.Tests\ConfORM_Fixture.cs:line 29
at AgilePlayground.App.Application_Startup(Object sender,
StartupEventArgs e) in C:\Users\Aleksandar\Documents\Visual Studio
2010\Projects\AgilePlayground\AgilePlayground\App.xaml.cs:line 38
at System.Windows.Application.OnStartup(StartupEventArgs e)
at System.Windows.Application.<.ctor>b__1(Object unused)
at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs)
at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
source, Delegate method, Object args, Int32 numArgs, Delegate
catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at
System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object
state)
at System.Threading.ExecutionContext.runTryCode(Object
userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd,
Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr
wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs)
at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
source, Delegate method, Object args, Int32 numArgs, Delegate
catchHandler)
at
System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority
priority, TimeSpan timeout, Delegate method, Object args, Int32
numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32
msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame
frame)
at
System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at AgilePlayground.App.Main() in C:\Users\Aleksandar\Documents
\Visual Studio 2010\Projects\AgilePlayground\AgilePlayground\obj
\x86\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Reflection.TargetInvocationException
Message=Exception has been thrown by the target of an
invocation.
Source=mscorlib
StackTrace:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType
type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean
publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean
publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis,
Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean
nonPublic)
at System.Activator.CreateInstance(Type type)
at
NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance(Type type)
at
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2
settings)
InnerException: NHibernate.HibernateException
Message=The IDbCommand and IDbConnection implementation in
the assembly System.Data.SqlServerCe could not be found. Ensure that
the assembly System.Data.SqlServerCe is located in the application
directory or in the Global Assembly Cache. If the assembly is in the
GAC, use <qualifyAssembly/> element in the application configuration
file to specify the full name of the assembly.
Source=NHibernate
StackTrace:
at
NHibernate.Driver.ReflectionBasedDriver..ctor(String
providerInvariantName, String driverAssemblyName, String
connectionTypeName, String commandTypeName)
at
NHibernate.Driver.ReflectionBasedDriver..ctor(String
driverAssemblyName, String connectionTypeName, String commandTypeName)
at NHibernate.Driver.SqlServerCeDriver..ctor()
InnerException: