SharePoint 2013: Create Master Page using Visual Studio 2012


You can find many blogs on how to create SharePoint 2013 master page in Visual Studio 201. We faced following issue while creating master page. Long story, we need to create master pages for our new SharePoint 2013 environment. As with our previous experience, we decided to create them in Visual Studio. Everything works fine but when we try to deploy wsp via Visual Studio 2012, master pages are not uploaded in “Master pages and Layout Library”. The problem was in the XML that was written in “Elements.xml” file.


Before moving to XML that worked, we would like to share all the XML that didn’t worked. We are not sure why they didn’t work. Perhaps, anything wrong on our side.

XML that didn’t work:


<Module Name=MasterPages” RootWebOnly=TRUE >

<File Path=MasterPages\ABCIntranet.master” 


IgnoreIfAlreadyExists=true >

<Property Name=UIVersion” Value=15></Property>




<Elements xmlns=>

<Module Name=MaterPage” Url =_catalogs/masterpage” List=116>

<File Path=MaterPage\ABCIntranetMasterPage.master” 

Type=GhostableInLibrary” IgnoreIfAlreadyExists=FALSE />



<Elements xmlns=>

<Module Url=_catalogs/masterpage” Name=MasterPage>

<File Url=ABCIntranetMasterPage.master” Type=GhostableInLibrary




XML that did work is:

<Elements xmlns=>

<Module Name=MasterPage” List=116” Url=_catalogs/masterpage
Path=MasterPage” RootWebOnly=TRUE>

<File Url=ABCIntranet.master” Type=GhostableInLibrary >

<Property Name=UIVersion” Value=15 />





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: