Re: CodeFile - or a bug in VS?
- From: Lubomir <Lubomir@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 May 2009 11:21:13 -0700
I created a project:
Create ->project->Visual C#->Web->ASP.NET Application
This will create a VS project (not a web site) as expected.
The default page has a page declaration:
<%@ Page Language="C#" AutoEventWireUp="true" CodeBehind="Default.aspx.cs"
Inherits="Test._Default" %>
1/ I compile aproject, as it was generated - no changes made in it
2/ I run the project = I get an error:
"Server Error in '/' Application
Parser Error
Description: An error occured during the parsing of a resource required to
service this request. Please review the following specific parse error and
details and modify your source code appropriatelly.
Parser Error Message: Could not load type "Test._Default"
When I change generated attribute CodeBehind to CodeFile (I don't do any
other changes) everything works fine.
That's I wonder if it is a bug in a code generation.
To Jonathan: By "This attribute should not be there" I ment, the attribute
CodeFile should be generated isntead of the CodeBehind attribute.
Thanks for your time,
Lubomir
"Juan T. Llibre" wrote:
If you create a new Web Application, the page declaration looks like this :.
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="Default.aspx.vb" Inherits="WebApplication1._Default" %>
That's OK...and will compile without problems.
If you create a new Web Project, the page declaration looks like this :
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
That will also compile without problems.
There's no bug...just different declarations for different
types of VS applications ( "web project" vs. "web application" ).
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
=========================
"Lubomir" <Lubomir@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CCAFEBBE-78A3-4632-95FA-1C46E118768D@xxxxxxxxxxxxxxxx
Hi,
I am using VS 2008. and a project target platform is .NET 3.5. When I create
a new web app project, the VS generates a default asp page, with the page
directive. There is an attribute Inherits as expected and an attribute
CodeBehind. This attribute should not be there,the CodeFile should be used
instead. I have to change it manualy, otherwise I get a runtime server error.
Is this a bug in VS 2008 or am I missing something? I have patched OS and VS.
Thank you for help,
Lubomir
- Follow-Ups:
- Re: CodeFile - or a bug in VS?
- From: Juan T. Llibre
- Re: CodeFile - or a bug in VS?
- References:
- CodeFile - or a bug in VS?
- From: Lubomir
- Re: CodeFile - or a bug in VS?
- From: Juan T. Llibre
- CodeFile - or a bug in VS?
- Prev by Date: RE: Subject: VS2005 website deployment problems with EFS
- Next by Date: asp
- Previous by thread: Re: CodeFile - or a bug in VS?
- Next by thread: Re: CodeFile - or a bug in VS?
- Index(es):
Relevant Pages
|