473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Syntaxe error in the @Application directive in global.asax

WT
Hello,

Using VS2005, when I open the global.asax file, the editor underlines in
blue all the line with a tooltip saying 'Syntaxe error '.

<%@ Application Language="C#" Inherits="MyApp.Core.Global"
Codefile="Global.asax.cs" %>

But everything is running OK, the site is under a web application project.

Any indication on the reasonfor this welcome.

CS
Jan 24 '07 #1
4 7473
re:
the site is under a web application project
Using Web Application Projects doesn't change the way the VS 2005 IDE sees the code.
WAP uses a new codebehind model, with changes in it which the VS IDE can't see.

re:
<%@ Application Language="C#" Inherits="MyApp.Core.Global" Codefile="Global.asax.cs" %>
That's standard syntax for ASP.NET 2.0/VS 2005 codebehind.

In WAP projects, that becomes :
<%@ Application Language="C#" Inherits="YourWebProjectName._Default" Codebehind="Global.asax.cs" %>

....but, to the VS 2005 IDE, that's incorrect syntax.

See : http://webproject.scottgu.com/Default.aspx
for details on the inner workings of WAP.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"WT" <WT@newsgroups.nospamwrote in message news:u%****************@TK2MSFTNGP03.phx.gbl...
Hello,

Using VS2005, when I open the global.asax file, the editor underlines in blue all the line with a
tooltip saying 'Syntax error '.

<%@ Application Language="C#" Inherits="MyApp.Core.Global" Codefile="Global.asax.cs" %>

But everything is running OK, the site is under a web application project.

Any indication on the reasonfor this welcome.

CS

Jan 24 '07 #2
WT
Thanks, you confirme that the syntax error that appears even with CodeBehind
attribut IS NORMAL ?

"Juan T. Llibre" <no***********@nowhere.coma écrit dans le message de
news: uV*************@TK2MSFTNGP02.phx.gbl...
re:
>the site is under a web application project

Using Web Application Projects doesn't change the way the VS 2005 IDE sees
the code.
WAP uses a new codebehind model, with changes in it which the VS IDE can't
see.

re:
><%@ Application Language="C#" Inherits="MyApp.Core.Global"
Codefile="Global.asax.cs" %>

That's standard syntax for ASP.NET 2.0/VS 2005 codebehind.

In WAP projects, that becomes :
<%@ Application Language="C#" Inherits="YourWebProjectName._Default"
Codebehind="Global.asax.cs" %>

...but, to the VS 2005 IDE, that's incorrect syntax.

See : http://webproject.scottgu.com/Default.aspx
for details on the inner workings of WAP.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"WT" <WT@newsgroups.nospamwrote in message
news:u%****************@TK2MSFTNGP03.phx.gbl...
>Hello,

Using VS2005, when I open the global.asax file, the editor underlines in
blue all the line with a tooltip saying 'Syntax error '.

<%@ Application Language="C#" Inherits="MyApp.Core.Global"
Codefile="Global.asax.cs" %>

But everything is running OK, the site is under a web application
project.

Any indication on the reasonfor this welcome.

CS


Jan 24 '07 #3
Hi,

The CodeBehind is for 1.1 compatibility. The CodeFile is not available to @
Application directive
(http://connect.microsoft.com/VisualS...ck.aspx?Feedba
ckID=102720). Therefore you don't need either attribute here. However,
VS2005 IDE has a known issue here that will still report error for the
syntax, which is actually correct. You could safely ignore this error.
ASP.NET has its own compiler when you're debugging.

The workaround for the issue is DO NOT open the global.asax markup file at
all in IDE and there should be no compilation errors in the Error List.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 25 '07 #4
WT
Good points thanks and have a good days.
CS
"Walter Wang [MSFT]" <wa****@online.microsoft.coma écrit dans le message
de news: BQ**************@TK2MSFTNGHUB02.phx.gbl...
Hi,

The CodeBehind is for 1.1 compatibility. The CodeFile is not available to
@
Application directive
(http://connect.microsoft.com/VisualS...ck.aspx?Feedba
ckID=102720). Therefore you don't need either attribute here. However,
VS2005 IDE has a known issue here that will still report error for the
syntax, which is actually correct. You could safely ignore this error.
ASP.NET has its own compiler when you're debugging.

The workaround for the issue is DO NOT open the global.asax markup file at
all in IDE and there should be no compilation errors in the Error List.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jan 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: .Net Sports | last post by:
I have had to move my files to another machine, and re-install visualstudio.net2003 and re-integrate my project into the IDE. When trying to run/f5 debug , I'm getting a Could Not Load type...
1
by: noname | last post by:
i have the following in global.asax: <%@ Application Codebehind="Global.asax.cs" Inherits="Foo.Global" Classname="AppClass" %> but wherever i use AppClass.foo() i get the compiler error: The...
0
by: Alexandre Martins | last post by:
Pessoal, quero chamar um application do global.asax numa classe, tem como ??
2
by: Colin | last post by:
Hi altogether, I ran into a problem with asp.net: I tried to create a pure web application WITHOUT any asax or aspx pages. Only one .dll in the bin folder supplying a HttpApplication and some...
1
by: localhost | last post by:
In the Application_OnStart, I make some data calls and place the results in the HTTP cache. Sometimes, the database is not available when the application starts up, so I want to sleep for 20...
0
by: Matija Brnetic | last post by:
When I upload files to the server I get this error : "Parser Error Message: Could not load type 'YaddaYadda.Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.cs"...
5
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
0
by: Michael | last post by:
Hi I have a problem related to global.asax and the Server.Mappath-Method. I collect all unhandled errors in the Application_Error in Global.asax. According to the type of error I...
2
by: Andy | last post by:
Hi there, I have an asp.net 2 web application with SQL Server 2005 db, running on IIS6. I have implemented some error trapping in the global.asax file, along the lines of: void...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.