in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Rajiv and Michael's SharePoint discoveries and musings...

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

Comments

 

Simon Doy said:

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

September 5, 2007 10:08 AM
 

Simon Doy said:

Rajiv,

Thats brilliant it worked!

Thanks very much you saved me a late night tonight!

Regards

Simon

September 5, 2007 10:32 AM
 

Luke Davis said:

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

June 6, 2008 2:14 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts