Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
    
Hey did you find any solution to this. I am having same issues. –  Nadeem Yousuf Jan 20 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 at 16:50
    
Thanks looking forward to your resolution to this issue. –  Nadeem Yousuf Jan 20 at 17:09
add comment

1 Answer 1

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$" %>
share|improve this answer
    
Thanks, all my controls are having full assembly references. I seem to have some different issue. sharepoint.stackexchange.com/questions/88250/… –  Nadeem Yousuf Jan 21 at 9:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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