0
votes

I am creating a custom master page through feature in sharepoint 2010 visual studio and on deploying the feature I am getting this

Error occurred in deployment step 'Activate Features': Failed to instantiate file "custom.master" from module "CustomMaster": Source path "Features\WSPBuilderImportProject2_SiteElements2db64791-54f6-4571-a161-66e0ef6497f5\custom.master" not found.

5

5 Answers

1
votes

RHM, your final url is doubled up. effectively you're trying to publish to _catalogs/masterpage/_catalogs/masterpage. try to only specify the list url in the module element and then put the remainder in without the path. I.e.

0
votes

This is a fairly self explained error. SharePoint is not able to find the file in the location you have specified in Elements.xml. Check the location if it exists and retry.

0
votes

If you deploy the masterpage as part as an feature (SharePoint solution) with for example Visual Studio 2010, the MasterPage will be deployed to the features directory. The feature file will provision the masterpage to the MasterPage Gallery (_Catalogs). As long as the file is not customized by SharePoint Designer, sharepoint will serve the masterpage (by using the virtual path provider) from the filesystem and not from the database.

<File Path="MasterPageModule\abc.master" Url="_catalogs/masterpage/abc.master" Type="GhostableInLibrary"  />

Deploy the master page. You can now control the master page by changing it from its physical location (SharePoint Root - 14 folder) and still be able to access from /_catalogs/masterpage/abc.master

The above is the recommended approach when you deploy master pages and page layouts.

0
votes

My module folder has master page in it with name of "custom.master" and here is the xml

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Url="_catalogs/masterpage" RootWebOnly="FALSE" Name="CustomMaster">
    <File Type="GhostableInLibrary" Url="_catalogs/masterpage/custom.master" Path="CustomMaster\custom.master"  />
  </Module>
</Elements>
0
votes

I was having this same problem and having checked and double checked all my paths, urls etc were correct the master was just not being provisioned by the feature.

It turned out the VS2010 had got a little confused and messed up the path in the spdata file. If you're in the same situation definitely worth checking.