By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,492 Members | 1,289 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,492 IT Pros & Developers. It's quick & easy.

Syntaxe error in the @Application directive in global.asax

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.