Could Not Load Type Error Sharepoint
Contents |
for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting could not load type c# ads with us SharePoint Questions Tags Users Badges Unanswered Ask Question _ SharePoint Stack Exchange is parser error could not load type a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a could not load type mvc question Anybody can answer The best answers are voted up and rise to the top “Could not load type” from custom SharePoint 2010 WSP deployed to SharePoint 2013 up vote 1 down vote favorite 1 I have a custom WSP could not load type masterpage 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
Parser Error Message Could Not Load Type '_default'
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? 2013 upgrade gac share|improve this question asked Oct 10 '13 at 15:41 anderaus 392414 Hey did you find any solution to this. I am having same issues. –Nadeem Yousuf Jan 20 '14 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 '14 at 16:50 Thanks looking forward to your resolution to this issue. –Nadeem Yousuf Jan 20 '14 at 17:09 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote 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="SomeNameSpa
One games Xbox 360 games PC
Could Not Load Type From Assembly C#
games Windows games Windows phone games Entertainment All parser error message could not load type 'global_asax' Entertainment Movies & TV Music Business & Education Business Students & parser error could not load type inherits educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security http://sharepoint.stackexchange.com/questions/79273/could-not-load-type-from-custom-sharepoint-2010-wsp-deployed-to-sharepoint-201 Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft https://support.microsoft.com/en-us/kb/306155 Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
August 2010 22:08 Every now and then, I come across an error that seems to be so http://blog.zebsadiq.com/post/SharePoint-Could-not-load-type-error.aspx simple, yet after trying all the obvious remedies, I'm left the wonder whether the resulting error is unsolvable by some form a memory loss in my head, or something bizarre built into the third party system which I'm trying to wrestle. Recently I came across such a situation and I spent a bit of time could not trying to figure it out until a colleague told me something about SharePoint that I didn't know. Lets summarise what happened. What I was trying to do:Add a web part that loads a user control from the CONTROLTEMPLATES directory at runtime. The error: Parser Error Description: An error occurred during the parsing of a resource required could not load to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'MyProject,MyClient.UserControl.MyControl'. Source Error: <%@ Control Language="C#" AutoEventWireup="true" Inherits="MyProject,MyClient.UserControl.MyControl" %> The Solution:Fully qualify the assembly information inside the control.e.g.Change: <%@ Control Language="C#" AutoEventWireup="true" Inherits="MyProject,MyClient.UserControl.MyControl" %> To: <%@ Control Language="C#" AutoEventWireup="true" Inherits="MyProject,MyClient.UserControl.MyControl,, MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456123456123" %> So what's the issue:If you deploy the assembly to the bin folder, SharePoint doesn't need your ascx files to fully qualify the assembly information. Whereas, If you deploy your assembly to the GAC, full qualification of assembly information inside the ascx/aspx file is required. It may be an obvious solution if you're coding something from scratch but since I was porting some code from one project to another, I was very confused about why the code didn't work like the other project. Of course the other project was deploying the assembly to the bin folder. Best to take note of such subtle differences I s