SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...

Symptom:

We ran into a strange issue recently. We had deployed a signed DLL to the Global Assembly Cache (GAC), and assumed
that it would be available to all applications on  the web server.

For some reason, it turned out that one of these DLLs in the GAC was not being resolved by our SharePoint application
unless the dll was copied into the \bin folder of the application as well.

The above shows the error that the Sharepoint Application was throwing if the DLL was in the GAC only, but not
copied over to the \bin folder of  the virtual.

Resolution:

After some research, we determined that we had to add a line to the web.config of our SharePoint web application,
as follows:

The copy of the DLL could then be removed from the \bin folder leaving only the one copy in the GAC.

Hope this helps other developers.

- Rajiv


Posted 12-29-2006 7:51 PM by RChakravarti

Comments

Simon Doy wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 09-05-2007 10:08 AM

Rajiv,

Thanks for that - I am having the same problem and couldnt understand why but that makes a lot of sense.

Let you know how I get on.

Regards

Simon

Simon Doy wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 09-05-2007 10:32 AM

Rajiv,

Thats brilliant it worked!

Thanks very much you saved me a late night tonight!

Regards

Simon

Luke Davis wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 06-06-2008 2:14 PM

Thanks for the help. I couldn't understand why my feature wasn't working.  I added this line to the web.config and bingo it worked.  This frustrated me as I've been working from an example that did not have to do this.  So I went back and removed the line to recreate the error.  Now, without the line in there it's still working...

Browndog wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 10-09-2008 12:28 AM

I was under the impression that if it was in the GAC it was assumed safe and didn't need to go into safecontrols in the web.config

Yongwei Xing wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 11-13-2008 3:07 AM

Thanks very much. Tis problem make me frustrated for hours. But it works well.

Henrik Kjellander wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 02-12-2009 1:54 AM

Thanks alot, I spent a lot of time on troubleshooting this!

John wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 03-18-2009 12:57 PM

Thank you man, I was struggeling with this issue for many hours.

Fredrik wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 03-31-2009 5:54 AM

Thank you Rajiv, this helped me a lot.

-Fredrik

Steve wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 04-17-2009 3:36 PM

Have you found the reason why you must register the assembly under "assemblies" rather then "SafeControl" and why this is not required for other features and their dll's

Lakshmi wrote re: TIP: DLL in GAC, but cannot be accessed through Sharepoint site ("Could not load type") ? Try this fix...
on 05-09-2009 2:24 AM

I am facing the same problem the dll is there in web.config aswell as in GAC. i am getting thie following error

An error occurred during the processing of . Could not load type 'Accenture.eServices.MOSS.Gordons.PageLayouts.CarteBlanche'.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.