Monday, October 13, 2008

Resolve Error : The resource cannot be found

I hope this post will be very usefull for anybody who have to use it because I was so happy myself when I discovered this SharePoint trick completely by chance, and it made me save so much time since this day.
You have sometimes this error while developping a SharePoint application :
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.


Even if you have activated the possibility to see errors and trace in SharePoint (Web application web.config --> callstack="true", customerror="off", debug="true") you won't have a precise indication of what ressource is missing.
So just right click your page and choose "view source".
Bingo! :

28 comments:

Chris said...

Nice.. Just what I was looking for.

Anonymous said...

Thanks a loooot!

Anonymous said...

Thanks!!! That's just what i need.

yellowlabrat said...

Bless you! I have been beating my head against the wall, and this was such an awesome fix!

Anonymous said...

Thanks soooo much! Just spent 4 hours on this problem...

bparrish said...

Ok, now that I have where the error is, how do I fix it? I am doing an exercise that creates a custom site definition, but says it can't find the master page that I created.

Marc Charmois said...

Hi bparrish,

the reason why your master page is not found can be:

- You use a feature to install the master page in SharePoint, and the feature does not work, so the entry corresponding to your master page is not present in the Master Pages Gallery of your Site Collection.

- The URL corresponding to your master page in the ONET.xml file is wrong.

You may check the SharePoint Log Files to have more precision about the reason:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS

Hope that helps.

Marc

David Remillard said...

Thank you very much! This was driving me crazy!

Steve said...

BINGO INDEED!

Shraddha said...

Excellent!

Will said...

Thanks a million! I started getting this error as I was developing a solution package with a master page in it.

Though it was on my dev system, I was thinking it would be disasterous if this happened on a production system.

The problem occurred when I tried to upgrade the solution, but it never reinstalled after retracting it. This made the master page disappear and all pages that used the master page started displaying that error.

You are the man! Thanks!

/_layouts/settings.aspx is the place to go to change your master page out to at least get the pages working again....

:)

Anonymous said...

You're the best!

Anonymous said...

YOU ARE A LIFE SAVER !!!!!

Marc Charmois said...

...so pleased to read all your comments...

Cheers.


Marc

Anonymous said...

FANTASTIC!! You saved my afternoon!! :)

rajat said...

Great work

Anonymous said...

Three years later, this article still saves lives! ;)

Anonymous said...

nice! Thanks so much, yours was the first result I clicked on, led me right to the answer!

Yashwanth said...

Thanks a lot. Your approach helped me to troubleshoot the issue.

Anonymous said...

Thanks for your post, I did check but the page that it says is missing is my custom master page and it is there, I did delete and copy it back but still the same result

Marc Charmois said...

Hi,
one explanation is there is a mistake in the name of your master page or in the path.

How have you referenced it?
Check in this direction...

Good luck...

Marc

Anonymous said...

Sir
actually i m not able to understand the solution to the error. Please provide me the solution.
Also when i am running any web application on my visual studio 2010 m getting this error only.
Please lend me help for the same

Anonymous said...

Very helpful... Thank u..

Sagir Kazi said...

Very useful trick! Thank you!

Mobeen said...

You saved my day. Thanks a lot!

Deepthi said...

thanks u saved my day

Marc Charmois said...

Happy of that Deepthi ! :-)
Marc

Anonymous said...

God bless your soul!