I have a problem here:

An error occurred during the compilation of the requested file, or one of its dependencies. The type 'Microsoft.SharePoint.WebPartPages.WebPartPage' exists in both 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\MyProject\v4.0_1.0.0.0__4829610975c6feae\MyProject.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll'

When I enter/create/view list item of particular content type I receive this error. I'm new to SharePoint and this error sounds for me like nonsense. When I simply save my master page (so it's no longer based on my site definition) it fixes my problem. I have none of my code in my master page.

when I return it to site definition, error gets back.

how its connected to my master page and site definition? how to fix this? because all I have for now is workaround... please help, I searched everywhere.


well seems I found a solution. I messed up with namespaces and inheritance when I was creating custom pages for my content type.

I just added something like that:

<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document"  %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

and it worked just fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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