Click here to Skip to main content
15,943,245 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more:
I'm trying to add a page to an existing web site in its own sub-folder. When I try to browse to it, it gives me this error (and this is the only thing displayed on the page):

The application has encountered an error.

Things I've done:

0) I've tried commenting out all of the code behind.

1) I've tried creating a new master page for it (as opposed to using the one I original tried to use).

2) I verified that the code behind is okay by creating another web site project on my local box and it renders as expected.

3) I comment out EVERYTHING in the aspx file, and just had the following text, when rendered as expected:


Due to security restrictions, I cannot remotely debug, and I can't change the web.config. I've google the error text itself, but haven't yet found anything that can help me through the problem.

How do I find out what I'm doing wrong?

EDIT ===============

If you're going to edit my qestion, tell me what you changed.

EDIT ===============

Why was this question down-voted? Sheesh...
Updated 19-May-11 9:42am
R. Giskard Reventlov 19-May-11 11:21am    
Check the event log when you are able and see what the real error might be.
Is the path to the Master Page correct?
You can put some exception handling in Global.asax (Application_Error).
#realJSOP 19-May-11 12:16pm    
I can't check the event log - no access. I assume the master page path is right because I chose it in the ide when I created the page. I'll ook into the global.asax thing.
#realJSOP 19-May-11 13:43pm    
Well, I can't modify global.asax because it's read-only on the server (and of course, I don't have permissions to change it).
dan!sh 19-May-11 12:27pm    
Is it like the new build (one with the new page) does not works on web server but works on the local box? How about adding tracing and creating log for everything on the server?

Update: Sorry, just noticed you cannot change web.config too. :doh:
[no name] 19-May-11 13:42pm    
Is it perhaps a .net version issue? Your local has a different version than the server and different references in the web.config?

We randomly get this error on the form that generates pdf reports for us... the solution (for us) is to perform an iisreset, then it all magically works again... ymmv.
Share this answer
We use VS2010 to write (VB) code now. VS2010 allows you to use .Net 4.0 constructs, even if the web site is specified to target .Net 2.0. This means that all of the stuff that was required (or not previously supported) in VB.Net 2.0 became optional in .Net 4.0, and since intellisense wasn't barking at me, some of the stuff I did wouldn't run on the web site because the server doesn't have .Net 4.0 on it. This caused the generic error described above to be displayed.

For the record, the most problematic item was the way ternary conditions were handled. .Net 2.0 requires Iif, but .Net 4.0 allows If.
Share this answer
go to visual studio command prompt

type devenv.exe/resetskippkgs

And then open your project again.

I hope this will help you.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900