Anonymous access and custom masterpage problem

Lately I was working on a SharePoint portal project which has to be accessed anonymously. I’ve set up everything and it seems everything was working till I’ve created a custom masterpage. Suddenly the pages using that masterpage started to ask user credentials even they are allowed for anonymous access. After a couple hours of googling I’ve came with a solution. BTW it works for both SharePoint 2010 and 2013.

All you have to publish that masterpage with a SharePoint project created by Visual Studio and set the type of that marterpage file as “GhostableInLibrary”.

Here are the steps:

  • Create an empty SharePoint 2010/2013 project.
  • Add a module to the project
  • Add the masterpage you’ve created to the module
  • Edit Elements.xml file as follows.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Masterpages" Url="_catalogs/masterpage" >
    <File Path="Masterpages\blank.master" Url="blank.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="FALSE" />
  </Module>
</Elements>

This resolves my issue. Hope it helps to you too..

Leave a comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: