Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET VB.NET
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:
 
<%=test%>
 
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...
Posted 19-May-11 5:09am
Edited 19-May-11 9:42am
v4
Comments
digital man at 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).
John Simmons / outlaw programmer at 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.
John Simmons / outlaw programmer at 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).
d@nish at 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:
Mark Nischalke at 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?
John Simmons / outlaw programmer at 19-May-11 13:45pm
   
Well, we're talking about a complete (LARGE) web site that uses authentication, versus a little off-the-cuff web site I used to verify the code behind was okay. The two can't possibly be compared. In the interest of completeness, the deployed web site is .Net 3.5, and the simple one is .Net 4, but I'm definitely not using any .Net4-specific code.
EdMan196 at 19-May-11 13:49pm
   
Aaah.. In that case I hit this problem just two days ago. The issue is that (assuming your using IIS), 'IIS cannot run two versions of the .Net Framework in the same service'. Basically, even though your not using .Net 4.0 specifc code, it's targeted at .Net 4.0 which causes IIS a problem. Try changing the simple site to 3.5 :) Should solve your problem, did for me :)
   
The simple site was not deployed - it was just to check the code behind. The problem is happening on the main site where I just uploaded a couple of files to a new folder. No web config to change (in the new folder), so no place to specify the .net version.
EdMan196 at 19-May-11 13:47pm
   
I've had this problem myself too but I can't remember how I solved it. I've an awful feeling I had to resort to deleting the new files and folder and recreating them under new names. Are you sure your page names don't cause conflicts? That' all I can suggest, recreation, sorry :/ (On a side note, I wonder if God considered 'recreation' ;P )
John Simmons / outlaw programmer at 19-May-11 13:59pm
   
I don't understand your question. There are four files in the folder right now - default.aspx (and its vb file), and masterpage.master (and its vb file). There's really nothing to conflict with those files since they live in their own sub-folder.
EdMan196 at 19-May-11 14:06pm
   
Meh.. all I know is that 1) Please see my other answer, it's more likely to be your problem - change the target framework and stuff :) 2) I just had to recreate folder and files (using Visual Studio) as something, unknown to me, had gone wrong with them :/
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

go to visual studio command prompt
 
type devenv.exe/resetskippkgs
 
And then open your project again.
 

I hope this will help you.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 503
1 George Jonsson 311
2 CPallini 290
3 OriginalGriff 139
4 Prasad Khandekar 135
0 OriginalGriff 4,623
1 CPallini 3,410
2 Sergey Alexandrovich Kryukov 2,929
3 George Jonsson 2,319
4 Gihan Liyanage 2,077


Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 29 Aug 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100