Exception, could not load ... (database driver)

Posts   
 
    
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 19-Feb-2010 17:23:05   

Hello,

Using version : 2.6, July 27, 2009

While I try to load my project on my new machine, I get an exception window viewer with this message in it: - "Exception has been thrown by the taeget of an invocation" - "Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified."

I understand that this version of my Oracle driver is not present. In fact I upgraded to 11g. But did I lost everything ? How can I get back all my configuration.

Should I install the old driver ? Is there anyway to load my project without having to load 2 drivers on my machine ?

Thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Feb-2010 19:38:05   

Please check this: http://llblgen.com/tinyforum/Messages.aspx?ThreadID=16475

Tip: installing Oracle Visual Studio Tools (which includes the 11G client) had fixed this issue for other users.

David Elizondo | LLBLGen Support Team
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 19-Feb-2010 20:01:53   

Thanks Daelmo,

It do not work for me...

I only add 11g client. >> Problem with LLBLGen loading project I installed 10g2 client (no ODP.net dlls was really installed in folder odp.net of my OracleHome\odp.net) >> Problem with LLBLGen loading project I uninstall 11g and 10g2 I re-installed 10g2 (odp installed fine) >> Problem with LLBLGen loading project - I red the note from daelmo in LLBGen forum (answered this question, I should try to installed Oracle Visual Studio tool) I re-installed 11g >> Problem with LLBLGen loading project I downloaded ODTwithODAC1110720.zip I installed ODTwithODAC1110720 (Oracle 11g ODAC and Oracle Developer Tools for Visual Studio 11.1.0.7.20) for both vs2005 and vs2008 at the same time >> Problem with LLBLGen loading project

Any other idea ?

Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 19-Feb-2010 20:02:18   

... Ho, just to let you know, I'm running Vista 64 bits

Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 19-Feb-2010 23:16:16   

After some research, I found that 'Oracle.DataAccess, Version=2.102.2.20' was not in the GAC. Some files of that version was there but not ''Oracle.DataAccess' althought I install it.

After installing/de-installing many versions of Oracle and ODAC and ODT (Oracle dev tools), then I decided to put Oracle.DataAccess.dll myself in the GAC. But first I made sure It was in my Oracle folder: 'odp.net' of my oracle installtion folder.

I got the same bug in LLBLGen. I tried a C# prog with the same error. But I had more info:


The assembly with display name 'Oracle.DataAccess' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified. File name: 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342'

=== Pre-bind state informatio === LOG: User = IREQHQ\cn1629 LOG: DisplayName = Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342 (Fully-specified) LOG: Appbase = file : ///C : /IreqData/MILE/Dev/Src/HQ/Mile/Presentation/PrototypeLocalisationAnalyse/bin/Debug/ LOG: Initial PrivatePath = NULL

Calling assembly : HQ.Mile.Presentation.MileControles, Version=1.0.3702.30057, Culture=neutral, PublicKeyToken=null.

LOG: This bind starts in default load context. LOG: Using application configuration file: C:\IreqData\MILE\Dev\Src\HQ\Mile\Presentation\PrototypeLocalisationAnalyse\bin\Debug\PrototypeLocalisationAnalyse.vshost.exe.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Publisher policy file is found at C:\Windows\assembly\GAC_32\Policy.2.102.Oracle.DataAccess\2.111.6.0__89b483f429c47342\Policy.2.102.Oracle.DataAccess.config. LOG: Publisher policy file redirect is found: 2.102.2.20 redirected to 2.111.6.0. LOG: ProcessorArchitecture is locked to x86. LOG: Post-policy reference: Oracle.DataAccess, Version=2.111.6.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86 LOG: Attempting download of new URL file : ///C : /IreqData/MILE/Dev/Src/HQ/Mile/Presentation/PrototypeLocalisationAnalyse/bin/Debug/Oracle.DataAccess.DLL. LOG: Attempting download of new URL file : ///C : /IreqData/MILE/Dev/Src/HQ/Mile/Presentation/PrototypeLocalisationAnalyse/bin/Debug/Oracle.DataAccess/Oracle.DataAccess.DLL. LOG: Attempting download of new URL file : ///C : /IreqData/MILE/Dev/Src/HQ/Mile/Presentation/PrototypeLocalisationAnalyse/bin/Debug/Oracle.DataAccess.EXE. LOG: Attempting download of new URL file : ///C : /IreqData/MILE/Dev/Src/HQ/Mile/Presentation/PrototypeLocalisationAnalyse/bin/Debug/Oracle.DataAccess/Oracle.DataAccess.EXE.


As you can see there is a policy the redirect to another more recent version of Oracle.DataAccess (the policy is hidden in folder only accessible in dos).

I then re-installed the missing redirected newer version of Oracle.DataAccess (ODP).

My C# app started to work but LLBLGEN still don't want to load my project with the following exception (the same one since the beginning):

============ Message ==============

Exception has been thrown by the target of an invocation. Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

============ Stack trace ============

-----[Core exception]-------------------- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at SD.LLBLGen.Pro.ApplicationCore.DBDriverHelper.CreateDBDriverInstance(String assemblyFilename, String namespaceToUse, String className) at SD.LLBLGen.Pro.Gui.Forms.MainWindow.OpenExistingProject(String filenameToOpen) -----[InnerException]-------------------- at SD.LLBLGen.Pro.DBDrivers.Oracle10g.OracleDBDriver.FillDBTypeConvertArrays() at SD.LLBLGen.Pro.DBDrivers.Oracle10g.OracleDBDriver..ctor()

Any suggestion ? Note: This message had been reformatted a little bit to remove some unwanted smileys near ':' wink

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Feb-2010 05:29:07   
David Elizondo | LLBLGen Support Team
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 22-Feb-2010 16:20:28   

Thanks daelmo,

It works now !!!

The link http://llblgen.com/tinyforum/Messages.aspx?ThreadID=17043 is very usefull.

I had some difficulties because the executable(s) that Frans put on the link you refer : http://llblgen.com/tinyforum/Messages.aspx?ThreadID=17043 just never worked. Plus, in order to make the application starts and have expected results, you have to really follow all steps... (each missing one gave a different problem). Finally, everything lookliked to works but it freeze when I click on the menu "File-Open Project". I then try another thing that worked fine. Only use the tool CorFlags.

The 2 very usefull tips that really helped me to make thinks works was: - The Frans trick about looking in Task Manager to ensure that LLBLGenPro.exe run on 32 bits mode. To verify that, I had to see it as : "LLBLGenPro.exe *32" (Vista). - To use Visual Studio (or SDK) tool CorFlags.exe to force to run "LLBLGenPro.exe" into 32 bits. Link used: http://blogs.intesoft.net/post/2007/12/Running-NET-Apps-in-32-bit-mode-on-64-bit-Windows.aspx , also the command executed: "CorFlags LLBLGenPro.exe /32BIT+ /Force" (Note: that CorFlags.exe is in my system path variable... (C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin)

The option of using the ODP 64bits driver was not possible to me. I had no other options to use the 32bit ODP driver because I work in a very large company that has deployed only that driver on every users computers (running XP 32bits).

Thanks a lot daelmo for your precious help ! Eric

... you make my day smile smile smile