Last post Feb 06, 2006 06:05 PM by mbund
Feb 06, 2006 10:48 AM|jawbrey|LINK
All of our ASP.NET code is written in C#. In VS2003, we were able to set the default language in the web.config file so that none of our aspx file have the language attribute set in the @Page directive. Everything worked great, no problem.
We just upgraded to VS2005 last week. Now when we open an aspx codebehind file for editing, the background compiler acts as if the code is written in VB. It highlights all of the code as having syntax errors. The code is clearly C# - it has a .cs extension,
and the IDE is set to recognize .cs as C# files.
This is ONLY a problem in the IDE. The code compiles and runs fine. The only way around this we've found is to specify language=c# in our aspx pages. The default language attribute in the web.config does not seem to impact the IDE.
So my question is, is there a way to set the global language deafult for the IDE? We have thousands of aspx files that will have to be edited manually otherwise.
Feb 06, 2006 11:34 AM|brianparker|LINK
Feb 06, 2006 03:59 PM|Pluginbaby|LINK
I really don't understand why you remove all the
directive of your pages if all your pages are written in C#...?
Sorry if I don't have a solution for you, but I wonder if you had a good reason to do that.
For your information, in ASP.NET 2.0 you can put code files of any languages in the special folder app_code (you can have both C# and VB for example).
Feb 06, 2006 06:05 PM|mbund|LINK
As mentioned,VS05 allows you to use multiple languages when creating your web site so it makes sense to use the Language attribute in your Page directive.