jjc9809
asked on
Server error I am getting on debug
Hi everyone,
I am getting the attached server error when I debug my web application in VS 2008.
What is causing this error, and what do I need to do to get the application to run?
All help is appreciated.
I am new to the web and ASP.Net.
SERVER-ERROR.png
I am getting the attached server error when I debug my web application in VS 2008.
What is causing this error, and what do I need to do to get the application to run?
All help is appreciated.
I am new to the web and ASP.Net.
SERVER-ERROR.png
My guess is that there is no Request object available during application start. What are you trying to accomplish?
ASKER
I just need to load the application so as to see the web pages developed. The application uses user control ascx pages.
Please see the Application.cs
Please see the Application.cs
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Where does the above coding go. Does it go in the Application.cs?
yes, try in Application.cs
ASKER
I tried all three coding samples and neither of them work.
Let me understand your problem, do you want to get the physical path only of your application?, if that is the question you can do it through Server.MapPath("~");
ASKER
Hello.
This web application was written by someone other than myself. THey have used numerous user control pages or ascx pages and numerous validation controls which are giving errors othe ascx pages and will have to be written.
When I build the application, I get Build Succeeded. When I try to debug the application I am egtting the server error which I guess the computer is looking for a abject path unknown.
Where do I fix this, in the Application.cs or the Global.asax?
THe applicatin right now just stops on this debug. Also, bear in mind I am new to web applications. I have created numerous windows applications in Visual STudio 2005, but web applications are new to me.
So, do not assume I an experienced web aprogrammer. I am not. I need to know what to do first, second and so on. What do I need to do first? How can I get this application to finally load so I can see whats going on with it.
This web application was written by someone other than myself. THey have used numerous user control pages or ascx pages and numerous validation controls which are giving errors othe ascx pages and will have to be written.
When I build the application, I get Build Succeeded. When I try to debug the application I am egtting the server error which I guess the computer is looking for a abject path unknown.
Where do I fix this, in the Application.cs or the Global.asax?
THe applicatin right now just stops on this debug. Also, bear in mind I am new to web applications. I have created numerous windows applications in Visual STudio 2005, but web applications are new to me.
So, do not assume I an experienced web aprogrammer. I am not. I need to know what to do first, second and so on. What do I need to do first? How can I get this application to finally load so I can see whats going on with it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I thought this coding could not be placed in the Global.asax. They have the coding for Context.Request in the Application.cs. I have attached a copy of the Global.asax and Application.cs.
WHere should I place the coding you indicated in your last post.
Application.cs.doc
WHere should I place the coding you indicated in your last post.
Application.cs.doc
Well, lets put the code ApplicationPath = Server.MapPath("~/") in Application.cs
ASKER
This code is not working. The application gives the server error for ApplicationPath = Server.MapPath("~/") ;
Can you check if HttpContext.Current is null by putting a breakpoint on the line that is raising the error?
ASKER
Where do you see HttpContect.Current in code inside the Application.cs?
I just do not see where to place a breakpoint. Remember this application now is running off the local machine. I do not see HttpContext.Current anywhere.
The application is not running and is hanging.
I just do not see where to place a breakpoint. Remember this application now is running off the local machine. I do not see HttpContext.Current anywhere.
The application is not running and is hanging.
Can't you make run the application in your local machine?, is the simplest way to debug an app
ASKER
This application will not run on the local machine either if there are missing important code parts.
This web application has been poorly written. The application does not have a start page as aspx extension. There are user controls dropped on the same default.aspx page and re-used over and over throughout the application. I just thought you could help.
It looks as though the application is confusing to you as well.
Help if you can.
This web application has been poorly written. The application does not have a start page as aspx extension. There are user controls dropped on the same default.aspx page and re-used over and over throughout the application. I just thought you could help.
It looks as though the application is confusing to you as well.
Help if you can.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I made the changes in the Global.asax file, but the error is still ocurring. PLease see Application.cs attached.
I have Windows 7 on my machine.
Application.cs.doc
I have Windows 7 on my machine.
Application.cs.doc
Is it possible that this web application is used only as a repository of custom controls?, then, if this is a repository there wasn't any intention to create a web application that could be executed, only referenced by another web application.