ERROR: The Resource Not Found

Every day I am answering lot of questions from colleagues, by coming with mostly the issues in SharePoint.

Today my colleague come with an issue, on getting Error on home page after activating a feature.

I asked him a URL and getting “The resource not found URL” error on browsing that page.

This kind of error arises, if the page couldn’t found the file that was refereed from the Page.

Then i opened the site from SharePoint Designer and tried to open that page,that was created based on page layout.
So i opened that appropriate Page Layout and get the “Master Page error” in Design Mode.
It mentions the master page file url cannot be found.
Then I have open the master page gallery to check that page is checked-out or available in that Gallery.
The specified master Page is not available in the Master Page Gallery.

I have asked him some questions to understand about the feature.

What type of feature that was?
What that will do and what kind of files it will deploy?

He replied, that was a branding feature, that will deploy some of the master pages and set the master pages for entire site collection after activating that feature.

I have asked him to share the Source of the Feature.
I have browsed through the Elements.xml in that feature and view the following lines,


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="MasterPageGallery" Path="MasterPageGallery" Url="_catalogs/masterpage">
<File Url="myCompay.master" Path="MasterPageGallery" >
</File>
</Module>
</Elements>

And I find that 4th line gets the error, so I have replaced the Elements.xml as follows,

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="MasterPageGallery" Path="MasterPageGallery" Url="_catalogs/masterpage">
<File Url="myCompay.master" Type="GhostableInLibrary" >
<Property Name="UIVersion" Value="4" />
<Property Name="ContentTypeId" Value="0x010105" />
</File>
</Module>
</Elements>

Then I have asked him to build and deploy that feature. After couple of mins, he came back and told me about the successful of deployment and Home Page.

SOLUTION:
If the Page shows “The Resource not Found”, then the problem was some file or resource is missing in the Page or Page Layout or Master Page.

Leave a Reply

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