0
votes

I have a SharePoint project with a visual web part (WebPartA inherits from OtherWebPartC) - the web part references two DLL's, (ClassLibraryB and OtherWebPartC), and they are included in the package, set to be deployed to GAC.

When I deploy the project, the DLL's are successfully deployed to GAC, and the web part successfully shows up in the gallery in SharePoint.

However, when I try to add the visual web part (WebPartA) to a page, the page breaks - I enabled error display and stack trace - it says it can't find ClassLibraryB.dll. I used fuslogvw and procmon to determine that it was trying to load the DLL from typical locations (Virtual directory/bin, temporary asp.net folders), even though the DLL was not in these locations (but as I said, it was successfully deployed to GAC).

So I manually added ClassLibraryB.dll and OtherWebPart.dll to virtual directory/bin, and it worked successfully.

How do I get SharePoint to see the ClassLibraryB.dll and OtherWebPart.dll in the GAC? Or do I have to manually deploy the DLL to the site's Virtual Directory/bin?

1
Have you confirmed that your assembly is in GAC (not just that your solution deployed)? How are you referencing the assembly?Nigel Whatling
Yes - I have confirmed that the assembly is in GAC - I reference the DLL's in the project, and also have added them to the packages in the project.Warren J Thompson
Are the references used in code-behind or on the page/control using @Register?Nigel Whatling
Be sure that assemblies deployed to GAC are signed and have strong names.Oleg Savelyev
Yes they are signed and have strong namesWarren J Thompson

1 Answers

0
votes

Try to:

  • Change the WebPart/assemblies deployment target to "WebApplication" (instead of the GAC);

  • Retract the Solution and remove corresponding assemblies from the GAC;

  • Re-build and re-deploy the Solution together with the assemblies to the SharePoint Bin folder (the selected "WebApplication" deployment target).

Are all the necessary assemblies copied to the Bin folder? Does the Solution work in this case?