Jeffrey Palermo (.com)

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
CodeBehind does NOT seem to be supported in VS 2005 - level 100

I'm using VS.NET 2005 Beta 1, and I'm converting an existing web project to Whidbey format.  The wizard pulled all my supporting code files (.cs) to the Code directory, but it left my code-behind files next to their aspx and ascx files.  I learned that Web apps - called web sites in Whidbey - cannot be explicitly compiled as in VS.NET 2003.  Meaning, I can't put a Class1.cs in the root and have it compiled into the bin on Build.  I have to either put this class in the Code directory or have it in a supporting class library project that I reference from the web site. 

It appears that only code files in the Code directory get compiled on a Build, and the (legacy) code-behind files do not get compiled.  Then on run, the page errors out because it cannot find it's code-behind class from which to inherit. 

Code-beside, however, does get compiled no matter where it is.  The partial class linked through the CompileWith attribute gets compiled along with the aspx page.

So it seems that code-behind is really NOT supported in Whidbey.  Am I doing something wrong?  Is anyone else using Code-behind in Whidbey? or trying to.


Posted 08-17-2004 6:46 AM by Jeffrey Palermo

[Advertisement]

Comments

Romualdas wrote re: CodeBehind does NOT seem to be supported in VS 2005 - level 100
on 08-17-2004 7:15 PM
I thought it this way as well, when looking first time, but there is an option for that so You can change it.
If You do that, it will create separate file (code beside now?) with partial classes.