Issue with .DLL's and the GAC when publishing applications in .NET

jmchristy used Ask the Experts™
We ran into an issue when publishing applications on our terminal servers.  All the users folders (C:\Documents and Settings) had all the .DLL's from the applications and were taking up way to much disk apce.

Our programmer said we can simply put all the .DLL's from the userhome folder into the GAC and the applications would automatically look at the GAC for the .DLL's if they couldn't be found in C:\Documents and Settings\username\local settings\apps.  He wrote a program that looks in the user home folders and searches for .DLLs and if it is there and not in the GAC it will copy it to the GAC location (C:\Windows\Assembly)

So I deleted all the .DLL's from my userhome folder just to test it, and the application(s) don't start or give any errors.  It's clearly not looking at the GAC when it can't find the .DLL's in my userhome folder.

Is this by design?  Do the applications need re-published without the .DLL's bundled in order for it to look at the GAC?  Are we way off basis here?

Looking for some guidance, thanks!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Yes this is a good strategy , but suimply a drag and Drop wasn't a approach to add a DLL to GAC , please refer this link
Senior IT Consultant
If you Drag / drop to %windir%\assembly it Will work , the normal copy / Paste won't though ,however as advised using GACUTIL or .NET FRAMEWORK 2.0 configuration tool to manipulate GAC is the preferred approach.
Keep in mind that all future versions of the assembly need to go to GAC from there on, not just lie on a share / local folder, if the file has the same version & Public key token, .NET will always use the one in GAC first.


Ok, we have dragged and dropped the majority of the .DLL's into the assembly manually.  His code wasn't working to copy/paste we found out.

The programs still aren't launching, once we deleted ALL the .DLL's from the user folder the application still won't start.  It just sits there and gives no error.  I verified that the .DLL's are in the GAC, with the same version # and public key token #
Mohamed OsamaSenior IT Consultant

Publish the assemblies  to a network share, accessible by application users ,then register them to GAC on your Terminal server.
The users will have to have access to the actual DLLs in order to use them, having them in GAC on your terminal server is not enough, since C:\windows\assembly is a special system folder that is not going to be accessible to non administrators by default.
Hope this clarifies.

Mohamed OsamaSenior IT Consultant

Forgot to add, you will need to adjust your users .NET security Trust level for either Intranet zone or configure full Trust for the network share where the application runs from, using .NET configuration tool as per below
or through caspol.exe command line as per below
if you use CASPOL.exe make sure to use the  -m switch , this will ensure applying the changes to all user profiles.
you will need to have .NET 2.0 SDK installed in order to run tools like CASPOL & MSCORCFG.MSC
Download links ,the first two results for x86 or 64 bit

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial