Reputation: 391
I'm trying to deploy a VS2013 project containing the Oracle ODP.NET library to a Windows 2008 IIS server, and receive an error "Could not load type 'OracleInternal.Common.ConfigBaseClass' from assembly 'Oracle.ManagedDataAccess, Version=4.121.2.0.'" From what I've found online this is caused by a conflict between the project's ODP and the server having ODP in the GAC. Instructions are then to remove ODP from the GAC. There are Oracle DLLs in the GAC on the server. We are 99% certain that the DLLs wound up in the GAC from a prior attempt to set up Oracle on that box a while back, as no other projects on that server should be using Oracle. So we should be safe removing it from the GAC.
However, gacutil.exe is only available in Visual Studio, and we are not allowed to install Visual Studio onto the server.
So how do we uninstall the Oracle DLLs from the GAC without having gacutil.exe available on the server? Can we just delete them from the directory? Or do we need to copy over gacutil.exe from my workstation to the server in order to do this? Or is there another approach? (preferably not involving registry edits)
Any advice appreciated, thanks.
Upvotes: 11
Views: 55837
Reputation: 7537
If you have Visual Studio at all, anywhere, you can port gacutil
onto the server from its location. On my computer, with Visual Studio 2015, it's at C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools
. On another question here on SO, it said you can also just install the Microsoft SDK separately (and it should install there, I assume, or in a different "v
" folder if it's a different version). If you know it should be on a particular computer, you can do where gacutil
to find it, then copy it, and the gacutil.exe.config
file that should be next to it, to the server. ( where is gacutil.exe? )
Sometimes you get an error when you try to remove Oracle.ManagedDataAccess
from the GAC using gacutil
, that Windows Installer is a dependency (
Unable to uninstall an Assembly from GAC? ). If so, you have to also remove it from HKEY_CURRENT_USER\Software\Microsoft\Installer\Assemblies\Global
& HKEY_LOCAL_MACHINE\Software\Classes\Installer\Assemblies\Global
, then do the gacutil -u
command. I had this issue and I didn't have to go to the HKCU location-but it was at the HKLM location. After removing it from there, I uninstalled & re-installed the Oracle Developer Tools for Visual Studio, just to be safe (I saw it said to do so here: https://community.oracle.com/thread/3944905), then my project finally worked.
Note: When I tried going to C:\Windows\assembly\GAC_MSIL
, I never even saw Oracle.ManagedDataAccess, so I could not remove it that way. I'm posting this to help anyone that might run into stubborn DLLs that have the same issue.
Upvotes: 4
Reputation: 8877
You should be able to do it from using the Windows interface as follows providing you have administrator privileges.
Navigate to the GAC, which is located at %systemdrive%\Windows\Assembly.
Right-click each assembly file that is included in your application, click Uninstall, and then click Yes to confirm
If you are unable to uninstall the dlls via the above method you can access the GAC folder without the special view by opening a run command and entering the path below and hitting enter.
C:\Windows\assembly\GAC_MSIL
This will allow you to interact with all the files in the GAC as a normal folder.
Upvotes: 10