SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Could not load file or assembly 'System.Data.OracleClient

    I am currently trying to debug an Asp.net 2.0 project with a c# code behind, without receiving errors, in Chrome through Visual Studio 2012. The solution was originally created in VS 2005 and upgraded/imported it into VS 2012. However, I am encountering this error when I attempt to run the solution:

    Could not load file or assembly 'System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    I have added references to System.Data.OracleClient to each of the projects within the solution, but this has not resolved the issue. Additionally, I have checked the GAC (Global Assembly Cache) for a reference to the assembly (System.Data.OracleClient); it is present. I have also added a reference to the assembly (<add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >) to the web.config file for version 2.0 of .Net (C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config). I noticed that the project seems to look for the dll in the bin folder of the solution, so I have copied the dll from the GAC to the bin. None of the above steps have resolved the issue. I continue to receive the same error message when the solution is debugged. Any answers or suggestions you could provide would be greatly appreciated. Thank you in advance.

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,813
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    If it is looking in the bin/ you will want to set the Copy Local property to True by right clicking on the reference and changing the value. This way, if you build in debug or release mode, the DLL will get copied to the appropriate bin/ location.

    However, since this is in the GAC, you shouldn't need to do this. I'd first uninstall the assembly from the GAC, and re-install it. Remove any project references and add it back where necessary (make sure Visual Studio is closed when you uninstall from the GAC and re-install to the GAC).
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  3. #3
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Uninstalling the assembly

    Thank you for the timely response. So, I tried to uninstall the System.Data.OracleClient assembly, but I receive the message that I can not remove becaues it is used by the .Net framework.

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,813
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    Did you perform an iisreset prior to attempting to removing the assembly? I find that occasionally there is a worker process still holding the assembly when I try and remove it.

    Another option would be to try performing a repair on the .NET assembly or the OracleClient installation.
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  5. #5
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I performed an iisreset before trying to remove the assembly and recieved the same message stating it is required by .net. How do I go about repairing the Oracle Client installation or .Net assembly. Thanks for the help.

  6. #6
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,813
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    Add/Remove Programs or Programs and Features (for Windows Vista and after), then find the application, and right-click and choose repair.
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  7. #7
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I repaired .net 2.0 framework sp2. No change in error. System.Data.OracleClient didnt show up in Programs and features. Thanks for your help

  8. #8
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,813
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    After importing to VS 2012, what is the target framework for each project? You can find out by right clicking on the project and choosing properties (should be in the Application section).
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  9. #9
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    .Net Framework 2.0 is the target framework for each project.

  10. #10
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,813
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    Boy I'm stumped. I've gone through my list of things. I've heard of some issues with VS 2012 and the installation of .NET 4.5 causing problems, but not specifically over the OracleClient. I also don't know of any resolutions at this point either...
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  11. #11
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all your help. I'll let you know if I find a solution. :-)

  12. #12
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The key phrase in that error message is "or one of it's dependencies"; I'd turn on fusion logging and see what is happening under the surface -- sounds like a strange 2nd level dependency thing that will make a lot of sense once you figure out.

  13. #13
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    The key phrase in that error message is "or one of it's dependencies"; I'd turn on fusion logging and see what is happening under the surface -- sounds like a strange 2nd level dependency thing that will make a lot of sense once you figure out.
    Thanks, so I turned on fusion and I get this additional information about the error.


    Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.


    === Pre-bind state information ===
    LOG: User = CORP\addison.sims
    LOG: DisplayName = System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
    (Fully-specified)
    LOG: Appbase = file:///C:/Users/addison.sims/dev/CorpServices/Sites/CorpServices/trunk/webroot/CorpServices/
    LOG: Initial PrivatePath = C:\Users\addison.sims\dev\CorpServices\Sites\CorpServices\trunk\webroot\CorpServices\bin
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Users\addison.sims\dev\CorpServices\Sites\CorpServices\trunk\webroot\CorpServices\web.config
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
    ERR: An assembly with different processor architecture is already loaded.

  14. #14
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Id try forcing the site to compile to x86 or x64 rather than anycpu and see what happens.

  15. #15
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try to compile to x64 resulted in this error:

    Could not load file or assembly 'CorpServices, Version=1.0.4780.29715, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

  16. #16
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Compiling to x86 resulted in the same Oracle Client error. Thanks for the suggestion.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •