Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove .NET assembly DLLs from server GAC

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.

like image 413
DaveCan Avatar asked Oct 26 '15 20:10

DaveCan


1 Answers

You should be able to do it from using the Windows interface as follows providing you have administrator privileges.

  1. Navigate to the GAC, which is located at %systemdrive%\Windows\Assembly.

  2. 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.

like image 89
benni_mac_b Avatar answered Oct 28 '22 12:10

benni_mac_b