Friday, November 21, 2008

Parser Error Message: Access to the path ... (ASP.NET)

I have been working on an ASP.NET page and all of a sudden, I was getting Parse Error on this page as shown below:

All I did was modify the code in the page and plus I could build the page in Visual Studio 2008 with out any errors. I could also build the entire web site with out any errors, but I was still getting the error.

I compared the file with the previous version and I do not see any special characters or anything like that. I even tried removing the using statements and putting them back again thinking there may be some hidden character on the first line, but still did not help.

I finally, made a copy of that file and got the previous version from the Source Control and then the error is gone. I then deleted the previous version and renamed the file (that was giving the problem) to its original name and the error is still gone.

Bottom line, I do not know what caused it and neither do I know how doing what I just did fixed the problem, but thought putting it here would might come handy for anyone that run into this issue.

After I did this, I also found this blog post and the author of this post had to reset the permissions of the file that was causing this error.

Have fun coding.

No comments: