Whidbey Beta 2 TypeLoadException

Posts   
 
    
Posts: 8
Joined: 30-Jun-2004
# Posted on: 20-Jun-2005 04:23:48   

I've regenerated a working LLBLGen MySQL project using the SelfServicing Vs.Net 2005 configuration and compiled successfully in VS 2005 Beta 2.

When I try to access the entities in a VS 2005 WinForm I get the following error confused :

 System.TypeLoadException was unhandled
  Message="Could not load type 'System.Data.ProviderBase.DbConnectionBase' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."
  Source="VWDL"
  TypeName="System.Data.ProviderBase.DbConnectionBase"
  StackTrace:
       at VWDL.HelperClasses.DbUtils.DetermineConnectionToUse(ITransaction containingTransaction)

       at VWDL.DaoClasses.CustomersDAO.CreateAndRunSingleInstanceRetrievalQuery(IEntityFields fieldsToReturn, ITransaction containingTransaction, IPredicate selectFilter) in G:\1. VW\LLBLGen\Generated05\DaoClasses\CustomersDAO.vb:line 423

       at VWDL.DaoClasses.CustomersDAO.FetchCustomers(IEntity entityToFetch, ITransaction containingTransaction, Int64 customersId, IPrefetchPath prefetchPathToUse, Context contextToUse) in G:\1. VW\LLBLGen\Generated05\DaoClasses\CustomersDAO.vb:line 130

       at VWDL.EntityClasses.CustomersEntity.Fetch(Int64 customersId, IPrefetchPath prefetchPathToUse, Context contextToUse) in G:\1. VW\LLBLGen\Generated05\EntityClasses\CustomersEntity.vb:line 955

       at VWDL.EntityClasses.CustomersEntity.InitClassFetch(Int64 customersId, CustomersValidator validator, IPropertyDescriptorFactory propertyDescriptorFactoryToUse, IEntityFactory entityFactoryToUse, IPrefetchPath prefetchPathToUse) in G:\1. VW\LLBLGen\Generated05\EntityClasses\CustomersEntity.vb:line 839

       at VWDL.EntityClasses.CustomersEntity..ctor(Int64 customersId) in G:\1. VW\LLBLGen\Generated05\EntityClasses\CustomersEntity.vb:line 153

       at Test.Form1.Form1_Load(Object sender, EventArgs e) in G:\1. VW\LLBLGen\Test\Form1.vb:line 18

       at System.Windows.Forms.Form.OnLoad(EventArgs e)

       at System.Windows.Forms.Form.OnCreateControl()

       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

       at System.Windows.Forms.Control.CreateControl()

       at System.Windows.Forms.Control.WmShowWindow(Message& m)

       at System.Windows.Forms.Control.WndProc(Message& m)

       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

       at System.Windows.Forms.ContainerControl.WndProc(Message& m)

       at System.Windows.Forms.Form.WmShowWindow(Message& m)

       at System.Windows.Forms.Form.WndProc(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

       at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)

       at System.Windows.Forms.Control.SetVisibleCore(Boolean value)

       at System.Windows.Forms.Form.SetVisibleCore(Boolean value)

       at System.Windows.Forms.Control.set_Visible(Boolean value)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

       at System.Windows.Forms.Application.Run(ApplicationContext context)

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

       at Test.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 76

       at System.AppDomain.nExecuteAssembly(Assembly 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)

       at System.Threading.ThreadHelper.ThreadStart()

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Jun-2005 10:16:00   

Did you reference the .NET 2.0 version of the CoreLab MySql provider?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 8
Joined: 30-Jun-2004
# Posted on: 24-Jun-2005 00:09:54   

Otis wrote:

Did you reference the .NET 2.0 version of the CoreLab MySql provider?

I had referenced the 1.1 version flushed , but have now downloaded and referenced the 2.0 version.

I'm now getting a similar errordisappointed :

 SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException was unhandled
  Message="An exception was caught during the execution of a retrieval query: Declaration referenced in a method implementation cannot be a final method.  Type: 'CoreLab.Common.DbDataReaderBase'.  Assembly: 'CoreLab.MySql, Version=2.80.7.0, Culture=neutral, PublicKeyToken=09af7300eec23701'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."
  Source="SD.LLBLGen.Pro.ORMSupportClasses.NET11"
  StackTrace:
       at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
       at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteSingleRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityFields fieldsToFill)
       at VWDL.DaoClasses.CustomersDAO.CreateAndRunSingleInstanceRetrievalQuery(IEntityFields fieldsToReturn, ITransaction containingTransaction, IPredicate selectFilter) in G:\1. VW\LLBLGen\Generated05\DaoClasses\CustomersDAO.vb:line 423
       at VWDL.DaoClasses.CustomersDAO.FetchCustomers(IEntity entityToFetch, ITransaction containingTransaction, Int64 customersId, IPrefetchPath prefetchPathToUse, Context contextToUse) in G:\1. VW\LLBLGen\Generated05\DaoClasses\CustomersDAO.vb:line 129
       at VWDL.EntityClasses.CustomersEntity.Fetch(Int64 customersId, IPrefetchPath prefetchPathToUse, Context contextToUse) in G:\1. VW\LLBLGen\Generated05\EntityClasses\CustomersEntity.vb:line 948
       at VWDL.EntityClasses.CustomersEntity.InitClassFetch(Int64 customersId, CustomersValidator validator, IPropertyDescriptorFactory propertyDescriptorFactoryToUse, IEntityFactory entityFactoryToUse, IPrefetchPath prefetchPathToUse) in G:\1. VW\LLBLGen\Generated05\EntityClasses\CustomersEntity.vb:line 834
       at VWDL.EntityClasses.CustomersEntity..ctor(Int64 customersId) in G:\1. VW\LLBLGen\Generated05\EntityClasses\CustomersEntity.vb:line 150
       at Test.Form1.Form1_Load(Object sender, EventArgs e) in G:\1. VW\LLBLGen\Test\Form1.vb:line 18
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
       at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
       at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
       at System.Windows.Forms.Control.set_Visible(Boolean value)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at Test.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 77
       at System.AppDomain.nExecuteAssembly(Assembly 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)
       at System.Threading.ThreadHelper.ThreadStart()

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 24-Jun-2005 11:20:04   

Hmm...

It could be a version mismatch still. As the MySQL DQE references 2.80.7 of the CoreLab provider, it can still be it uses the .NET 1.x version in the GAC (or did you uninstall it?), which is a wild guess from my part.

The exception is very strange, typical for .NET version mismatches.

(edit). I could try to build a .NET 2.0 orm support classes lib with a .NET 2.0 mysql DQE, though these are then completely untested, I don't even know if the code compiles on .NET 2.0 as I haven't done that yet. (the .NET 11 version runs fine on .NET 2.0), which could give more information if that's the problem or not.

Frans Bouma | Lead developer LLBLGen Pro