troubleshooting Question

Errors in Global.asax file

Avatar of tjgquicken
tjgquicken asked on
.NET ProgrammingASP.NET
2 Comments1 Solution2202 ViewsLast Modified:
I just migrated my web application from ASP.NET 1.1 to ASP.NET 2.0, and Visual Studio 2005 is reporting 39 errors in my Global.asax file. I wouldn't care so much, except that my application isn't calling the Session_Start and Application_BeginRequest methods, and I'm thinking that this invalid Global.asax file might be the reason why.

This is the complete contents of my Global.asax file:

<%@Application CodeBehind="Global.asax.cs" Inherits="KJI.Global" %>

In that one line, VS found 39 errors, and I can't figure out what's going wrong. There are:
16 errors whose description just says "Syntax Error,"
16 that say "Statement cannot appear outside of a method body,"
2 that say "End of statement expected,"
2 that say "Bracketed identifier is missing closing ']'", as well as:
"'Namespace' statement must end with a matching 'End Namespace'",
"'Class' statement must end with a matching 'End Class'",
"'Declaration expected",
"End of statement expected".

Can anybody please explain what's causing all these error messages?


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros