File does not exist

Nowadays, I’m working on my CMS project called Weblebici CMS. I aimed to create very simple and lightweight CMS web application. But this is not the subject of this article.

Last night I created a simple default template but later I began to see some weird exception on my log. It was weird because there was not any detailed information about the problem.

It was a “System.Web.HttpException” and message says. “File does not exist“. But there is no info about which file exists. First I thought I used a file type which static file handler cannot access. I checked the extensions and nothing seemed wrong to me. Later I decided to check HTML output of the page. I checked line by line, file by file… I found nothing on the first pass. In the second pass I noticed the error.

There was a relative URL like “~/a/b.ext” and I forget to use this value as a parameter for “@Url.Content()” method. It was easy to fix but hard to find. 😀

Posts created 141

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top