MRYHMLN

I have created a DLL that is to be shared between an ASP.NET 2.0 web application (hosted in IIS 6.0) and several SQL Reporting Services 2005 reports running on the same web server. I strongly named my DLL, installed it in the GAC, and the web app and reports were able to utilize the DLL. The problem arose when I found a bug in my DLL, rebuilt it using the same strong name, and attempted to install it in the GAC over the top of the old version (I didn't want to create 2 side by side versions of the DLL, since the second version was really just a hot fix for the original version).

Anyway, after successfully installing the new DLL to the gac (successful meaning I didn't receive any warnings or error messages), my web app and reports appear to still be using the old version of the DLL. After experimenting a bit, I discovered that totally rebooting the web server (not a very practical solution) caused the app/reports to use the new version of the DLL, which leads me to believe that the old DLL is being cached somewhere, even after uninstalling it from the GAC, and so the new version is not being detected until the old version is freed from memory. Anyway, just a hunch, but I couldn't think of any other way to explain it.

Any help with diagnosing the problem and coming up with a workable solution (other than rebooting the web server after each deployment of the DLL) would be greatly appreciated. I played around a bit with publisher policy files, which seemed to do the trick, but they seemed a little cumbersome for what I was trying to do, so I would like to be able to avoid this solution if possible. Anyway, thanks in advance.

Mary



Re: Common Language Runtime Problem uninstalling DLL from GAC

SalvaPatuel - MSFT

Hi Mary,

If the application on the application pool was still running when you upgraded the old DLL will be still loaded in memory.

Have you tried to recycle your web application (Applications Pools>>YourApp Right click>>Recycle). This will be more convinience than rebooting your server.

Let me know if this has done the trick.

Regards






Re: Common Language Runtime Problem uninstalling DLL from GAC

MRYHMLN

Hi Salvador.

Sorry. That didn't seem to work for me. Here's what I did. I went to the windows\assembly folder on the web server, right-clicked on the custom DLL, and selected uninstall. I then recycled both the web app and MS Reporting Services app pools from IIS on the web server. After doing so, I inspected the windows\assembly\GAC_MSIL folder, and I still see the old version of the DLL (even though I do not see the DLL in the windows\assembly folder). I figured things were messed up at this point, but I then followed up by dragging and dropping the new version of the DLL to the windows\assembly folder, which appeared to work on first glance because it copied it to windows\assembly, but another inspection of windows\assembly\GAC_MSIL proves it to be the old version of the DLL. Pardon my ignorance, but I am not really that familiar with application pools. Could it be that Reporting Services is the one holding onto the old version of the DLL and because it is still running as a service in the background that attempts to recycle the application pool have no real effect Anyway, it appears that I am still having the problem. Any other thoughts (besides a server reboot :-))

Mary





Re: Common Language Runtime Problem uninstalling DLL from GAC

SalvaPatuel - MSFT

MRYHMLN wrote:

Could it be that Reporting Services is the one holding onto the old version of the DLL and because it is still running as a service in the background that attempts to recycle the application pool have no real effect

This is a good place to check, recycling the process will not stop reporting services, only the applications isolated by the pool (in this case your asp.net application and the reporting service web interface), it depends how and where you use the DLL as they have different processes (upon DLLs are loaded only once no matter which process uses it), try to restart the service to test if that's works. Have you tried using gacutil /u <assembly-name> (if you have the SDK installed).

Let's try this and see how it works,

Regards






Re: Common Language Runtime Problem uninstalling DLL from GAC

MRYHMLN

Hi again Salvador.

Well, I figured out the problem. It didn't have anything to do with the DLL being held in memory. It was, instead, a problem with the version of gacutil.exe installed on the web server. I guess to install my 2.0 DLL in the GAC I needed the 2.0 version of gacutil.exe, but the web server only had the 1.x version of gacutil.exe installed. It looks like gacutil.exe is no longer installed with the .NET framework but is instead installed separately as a part of the Visual Studio SDK. So when the webmaster installed the .NET 2.0 framework on the server, the 2.0 version of gacutil.exe was never installed. Only the 1.x version from the previous version of the .NET framework installation was present. The older version of my DLL was built against the 1.x version of the framework and was installed into the GAC successfully because the server was using the 1.x version of gacutil.exe. However, when I tried installing my new 2.0 version of the DLL on the web server, I imagine that the web server wasn't able to recognize the DLL, but instead of giving me an error message, it was just ignoring my request. I have subsequently installed gacutil.exe 2.0 onto the web server and was successful in overwriting my old DLL with the new one. Thanks for the help.

Mary





Re: Common Language Runtime Problem uninstalling DLL from GAC

SalvaPatuel - MSFT

Hi Mary,

Happy that you find it, this post will be very useful for others experiencing the same issue.

Thanks for the post,

Best regards