2

I have a custom WSP with (among other things) a user control and a DLL for GAC deployment. It's been built for SharePoint 2010 and .NET 3.5 and is fully working on my SharePoint 2010 Farm.

I also have a new SP2013 farm and installed the same WSP using:

Add-SPSolution -LiteralPath C:\WSPs\mypackage.wsp
Install-SPSolution -Identity "mypackage.wsp" -WebApplication http://mywebapp -GACDeployment

This gives no errors. I have attached my 2010 content database, ran test-spcontentdatabase with no errors and have mounted it to the 2013 web app. No worries so far.

When opening the page where I expect to see the user control, I receive the error "Could not load type 'MY.DLLname'. This is the DLL contained in the WSP and referenced by my user control.

The DLL IS present in the "old" gac: c:\windows\assembly, but NOT present in the .net 4.5 gac, which is expected (I guess).

Why isn't this working? Are SharePoint 2013 sites running in "2010 mode" only looking for dll's in the "new" GAC? If so, what is the correct deployment procedure for legacy 2010 WSPs containing assemblies?

3
  • Hey did you find any solution to this. I am having same issues. Jan 20, 2014 at 12:19
  • Yes, I belive so, I will add my answer below. Let me know if it's not working for you, and I will try to find my notes from back when I had this issue.
    – anderaus
    Jan 20, 2014 at 16:50
  • Thanks looking forward to your resolution to this issue. Jan 20, 2014 at 17:09

1 Answer 1

2

The issue was resolved by adding a strong-name assembly reference in the ascx file pointing to the code-behind assembly.

If your ascx file's assembly references do not include strong-name, like this:

<%@ Control Language="C#" AutoEventWireup="true" 
CodeBehind="SomeFile.ascx.cs" Inherits="SomeNameSpace.SomeClass" %>

Try adding a full assembly reference, like this:

<%@ Assembly Name="SomeAssembly, Version=1.0.0.0, 
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Which for SharePoint can be achieved using this token (if the current project assembly is the issue):

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.