MrDave's (David Yack) WebLog

Class1.cs - Anyone really use it?

Is it just me or does it drive everyone else crazy that when you create a new project the first thing it does for you is create class1.cs or create webform1.aspx.

If I only had a dollar for each of those I had to delete.

I have to admit I was hoping that in VS2005 that would be gone as the default and they would realize that you really don’t need it to create that for you.  But sure enough I created a library class from scratch tonight and look what got created for me …my very own class1.cs

So is it just me or does this drive you crazy too?

Comments

Zk said:

That's kinda weird actually. I was watching and ASP.NET 2.0 video/slideshow from TechEd 2004 San Diego (before they realized that it wasn't really supposed to be public). Anyways, one of the things the presenter touted was the fact that when you create a new Web App project, no files would be automatically created. No global.asax, no WebForm1.aspx, etc.

So, I'm really suprised they wouldn't do this with class libraries.
# August 7, 2004 1:29 AM

Jerry Pisk said:

I know people who do use it. And they also use Label1, Edit3, and so on. But that's expected if you convince any Joe that programming is really simple, just drag few icons with your mouse and you're a programmer.
# August 7, 2004 1:31 AM

Scott Allen said:

Yes it does!
# August 7, 2004 1:36 AM

David Yack said:

Zk - Vs2003 web site will create webform1.aspx...in VS2005 it will not if you create an "Empty Website"

In VS2005 if you create a Class library though you get a class1.cs.

Looks like the asp.net team cleaned up there act but the other teams have yet to catch up.

Maybe it's just me but if you can create a class library in the first place you probably can figure out how to add / remove files!
# August 7, 2004 1:36 AM

Senkwe said:

I use it, after I rename it that is :-)
# August 7, 2004 6:55 AM

Geo said:

Remember fellas, that these are templates, as Jerry said, i also know people who use these defaults, what i do is i create templates that allow me to start working faster, i'd suggest you do the same!
# August 7, 2004 9:00 AM

AndrewSeven said:

Mine are here: \Program Files\Microsoft Visual Studio .NET\VC#\VC#Wizards\CSharpWebAppWiz
In \Templates\1033
Templates.inf has the list of files to add.

\Scripts\1033\default.js has some scripting you will need to change if you remove WebForm1

The files created with a new project should depend on the kind of project, but they need to be meaningfull too. default.aspx would be better than WebForm1 (IIS default page) but "default" has its own issues.

# August 7, 2004 7:31 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)