I am using ASP.NET 2.0 (Visual Studio 2005) and Oracle 10g database
my application do not have build errors.Build is succeeded.
But i am getting run time error.
The below thing is the error which is i am getting.
Exception Details: System.DllNotFoundException: Unable to load DLL 'OraOps10w.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Please help me in this.
Oracle Data Provider needs theses dlls : Oracle.DataAccess.dll and OraOps11w.dll
add reference to Oracle.DataAccess.dll
The assembly OraOps10w.dll is not referenced in your project (which is probably ok like that), and so it compiles ok.
But at runtime, any referenced Oracle assemblies most likely call in their turn the OraOps10w.dll, which they cannot find at the location of the running assembly.
I suspect you copied the Oracle assembly you needed for compilation (typically the Oracle.DataAccess.dll), while you should reference it at its original location (namely, the Oracle HOME installation directory).
edit: Very similar question to NHibernate Oracle - Unable to load DLL 'OraOps10w.dll'
As is mentioned in an answer to that question, you could install the Oracle XEClient (free download, around 20MB), and reference the Oracle.DataAccess.dll in that location. Keep in mind that you'll have to install this package on each client in order to work !
Related
I'm creating an ASP.NET API Core application, to handle API services, which communicate to an Oracle Database.
At runtime, when the process tries to connect to the DB with a new Oracle Connection throught a DbContext ( Entity Framework) an unhandled error appears and forces the app to stop.
myDbContext.Database.Connection.Open();
This line causes the following error
System.TypeLoadException : 'Could not load type
'System.Security.Principal.WindowsImpersonationContext' from assembly
'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxx'.'
I had an old but similar project which used the same code and worked properly.
The library used is the same for Oracle Connector : Oracle.ManagedDataAccess.EntityFramework
What I tried :
Unistall - Reinstall Oracle.ManagedDataAccess.EntityFramework,
same for other Oracle connector ( Oracle.ManagedDataAccess, Oracle.ManagedDataAccess.Core )
Install System.Security.Principal
Changing the target framework from 3.1 to 5
I went first to this page 'System.Security.Principal.WindowsImpersonationContext' from assembly 'mscorlib' error when trying to parse template with Razor Engine but did not find anything that could help me resolve this.
For dot net 6, I was getting the same exception. Only kept the package: Oracle.ManagedDataAccess.Core and removed all others related to oracle and it works.
Get rid of 'Oracle.ManagedDataAccess'. I had both 'Oracle.ManagedDataAccess' and 'Oracle.ManagedDataAccess.Core' installed. This issue is most likely caused because 'Oracle.ManagedDataAccess' is for .NET Framework and not .NET Core/.NET 6.
I had the same problem. The .NET Core version has the same name as the .NET Framework version Oracle.ManagedDataAccess.dll but with a lower version number. As a result, Visual Studio takes the higher version from the GAC rather than the NuGet package. -> Delete the GAC version.
I am trying to run my ASP.NET 4.0 WebSite using the ODP.NET 4.0 Client in Windows 7 64 bit machine..but no luck so far.
I have downloaded the ODP.NET 4.0 from
http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
and installed using the instructions provided.
I am able to see both the Oracle.DataAccess.dll and Oracle.Web.dll in
C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342
and
C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.Web\v4.0_4.112.2.0__89b483f429c47342
respectively.
The problem is when I try to Add the reference to the website, I am not able to see them in GAC ( I mean to say in the .NET tab..where all the dlls in GAC are shown)
I somehow referenced them from my local system..
But after adding the reference the following entries are created in the web.config file.
And the problem is..
When I try to build the project it fails giving me an error stating that
Could not load file or assembly 'Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
The reason I am thinking it is not finding the file is because it is looking in the GAC folder(C:Windows\Assembly) and as they are not present ..it is throwing the compile time error.
But technically the files must be located in the GAC64 folder(C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342) and the dll is present there.
I don't know how to resolve this error.
Note: I have to run this in 64 bit machine and that too by setting the Enable 32 bit Applications flag to false in the IIS.
I would search your system for this library - generally it will exist somewhere else on your system before being added to the gac. Add the reference from that location - try: ORACLE_BASE\ORACLE_HOME\ASP.NET\Bin\2.x\ or c:\Oracle\odp.net\bin\2.x\Oracle.Web.dll
Whatever you see on that GAC reference tab is not in the gac jsut because it is on that tab. Those files are just 'reference assemblies' and can be anywhere on your system. Find the dll that is not in the GAC and add a reference to it from there. Search your system for oracle.web.dll
Note that in:
Oracle Providers for ASP.Net Installation
The location is listed as: c:\Oracle\odp.net\bin\2.x\Oracle.Web.dll
I am currently using SQLite for Windows Forms but while running the project it is showing the error:
Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I had added the DLL of System.Data.SQLite.dll but it is showing the same error. Please can any one help me by giving the perfect answer regarding this problem? Thanks in advance
This should fixed my issue.
Add the following DLLs.
Microsoft Visual C++ Runtime Package
SQLite for Windows Runtime
Use Project "Add Existing Item" and select the sqlite3.dll "As link". Click OK. Choose DLL in project and set "Copy Local" value to True.
Maybe you haven't added the version for the right platform? SQLite is distributed with one X86 (32 bit) assembly and one X64 (64 bit) assembly.
If your application is a 32 bit application you should use the System.Data.SQLite.dll located in the "bin" directory of the System.Data.SQLite distribution, if it is a 64 bit application you should use the one in "bin\x64".
However, from looking at the error message a second time I'm not sure if that's it. Are you making native calls to SQLite? In that case you may have to rename the dll to sqlite3.dll.
As you may know System.Data.SQLite is a bundling of the original native sqlite3.dll and a managed ADO.NET provider (unless you are using some old version in which case I'm not sure - you might need the native sqlite3.dll separately)
In my case I'm working on a UWP project. I had to add a reference to Visual C++ 2015 Runtime for Universal Windows Platform Apps and the error was gone. It can be added in the Reference Manager under Universal Windows > Extensions. Detailed solution can be found here.
After struggling for 3 days,finally found a way to resolve.
As of March 2018,if you try to use sqlite-net via Nuget Package Manager,it adds two files and few reference dlls to your solution independent of type of project UWP or Android etc.
And after that if you compile and run the solution will fail with an exception
Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
This is because it is unable to load sqlite3.dll as it is not added to the solution via NUGET package manger.So you need to add it manually.
To add,first determine your project is 32 bit or 64 bit then download the respective Precompiled Binaries for Windows Runtime from https://www.sqlite.org/download.html and add them manually (copy and paste).
So now your solution will look like below one and it will run without issues.
I had the same issue when I downloaded the latest sqlite provider and I tried a solution from here but it didnt work, hence I downloaded the earlier version and its works fine.
Had this problem recently - after attaching procmon to my process, I found that the latest System.Data.SQLite libs (the ones built for .NET4) have a dependency on the MSVC 2010 runtime, and the servers didn't have this installed. Fortuantly, this can be pulled down from the Microsoft website.
I had exactly the same problem for the UWP project in a Xamarin.Forms application.
Adding reference to "SQLite for Universal Windows Platform" to the UWP project solved the problem.
Copy sqlite3.dll to the System32 folder. It worked for me. And thanks too!
I'm building a native Windows Phone 8.1 app with a PCL and a Droid project. I had the same error and I put the reference to the right version of sqlite3.dll (wpa81) and all worked.
Especially if you've updated to Visual Studio 2015 RTM and are developing Universal Windows apps, try uninstalling the SQLite for Universal App Platform extension and reinstalling (see http://sqlite.org/download.html).
All of these seem to be solutions for certain situations. For me, and for #Marlon Ticao on this page, the application just can't find the DLL.
There are 2 solutions. Copy it to a directory that is in you path (such as System32) or you can copy it into the same directory that your executable is.
I had this exact problem using a 3rd party built sqlite3.dll -- the app would not launch. I used the dependency walker to find that this sqlite3.dll had a dependency on msvcr110.dll. Once I included this file, all was well.
Don't forget to deploy the published runtimes folder too in .NET (Core) projects, it should contain that DLL for various targets.
I have a Silverlight site hosted in an asp page, it has been developed using vs2010 using .net 3.5 framework and silverlight 4. It all works on my dev box. However when I publish the site and get it deployed I get the error:
Could not load file or assembly 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I have checked that the ISS asp setting are using 2.0.50727, and that all my references are using that runtime also.
I am not sure what to do to work out what the missing dependencies are at this point (I don't have access to the deployment box, I will have to go and sit with a system admin).
This looks like a case of the GAC, and nothing to do with Silverlight/VS 2010/whatever.
Basically that assembly lives in the GAC of your dev box, but now on your production box, and the DLL is not included in your build.
I was actually exactly the opposite of 'TheGeekYouNeed's suggestion ... the system administrator had not followed my instructions, and had included a couple of extra assemblies in my bin folder, lol.
So interestingly it was complaining about having an extra file! (well actually an extra file that was probably a .net 4 one)
I'm having a problem when browsing a published site on local iis7 (on windows 7).
When browsing the asp.net site through VS2008 with F5 (dev iis) it works fine. When publishing it and browsing, I get a:
Server Error in '/MySite' Application.
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Stack trace offers no clue on the problematic dll either. I copied the same published folder to a different machine (also with windows 7 32bit and iis 7) and it works.
Since this is a fresh install of iis on my machine, I verified the matching selected items in "Turn Windows Features on/off". After noticing the issue I also ran the "aspnet_regiis" util, but the problem remains.
The web site includes several external dlls (native and managed) and they all appear in the published bin folder (which is identical to the development bin folder)
Any insights?
Cheers,
Shay
As gleaned from this thread: http://social.msdn.microsoft.com/forums/en-US/netfx64bit/thread/f609f52e-00f6-4ada-9d6e-7129b85d3d4d/, as mentioned toward the bottom of the thread (second to last post as of right now), our problem was a "rogue" dll, Microsoft.SqlServer.Replication.dll. We simply removed the dll and no more error. Additionally, as no project in the solution referenced this dll, I simply removed it from the bin file and subsequent builds/publishes do not add the dll. I have no idea how the dll got in the bin file in the first place. A college prank, maybe.
Native dlls are supposed to be locatable in the PATH. Problem was they were under the User PATH and not the System PATH, so it worked fine through the VS but not through the IIS. I added the dll folder to the system PATH and everything worked...
A long shot in most cases but check you have good .NET Framework libraries. Was getting nothing from old Framework 2.0 website maintained with VS 2005 running on IIS 6 except plain text in browser window stating the error. Fiddler and Firebug reveled nothing. Started checking this, that and the other thing. Perhaps when wondering about using aspnet_iisreg that the C:\Windows\Microsoft.NET\Framework\v4.0.30319 folder was discovered to have only a handful of files. Doesn't make a lot of sense, the applications were 2.0 but there is some cross application communication and several libraries so maybe some are run as 4.0 or it might be that IIS will try to use some things from the highest version of .NET Framework available.
A co-worker more knowledgeable about servers repaired the 4.0 Framework with the stand alone installer from here.
Runs well now.
This error occurred for me when the .Net Framework on the target server was only 4.5.2 and a recently upgraded Nuget package required 4.7.2. To temporarily solve it, we downgraded the Nuget library to a previous version that did not require 4.7.2 until we can upgrade the server library.
This was in spite of our project properties having .NET Framework 4.5.2 selected as a target framework.