Last post May 04, 2006 11:48 AM by bucketofsquid
May 01, 2006 05:15 PM|bucketofsquid|LINK
In VS 2003, I could create an ASP.NET web application. Once the project existed I could go to solution explorer and right click on the project and select "Add New Item". From there I could select "codepage" which would create a file with a .vb extension.
In VS 2005 I can't find the option to create an ASP.NET web application. There is a "New Web Site" option, but when I do that I can't add a code page. What the heck is going on? Why can't I make an ASP.NET web app? Where did my code page choice go?
(The following is a rhetorical rant and can be ignored)[:@]
Once again Microsoft does a crappy job of explaining changes in architecture. Tech issues should not be explained by marketing flunkies. Why do I always have to go to third parties to get an explanation of what Microsoft has done?
May 01, 2006 06:18 PM|ScottGu|LINK
In VS 2005, there are two ways to create a web project:
1) Select File->New Web Site. Once created, you can right-click on the solution explorer and select "Add New Item". Within that dialog box you can create either a web-form or a class.
2) Install the VS 2005 Web Application Project Option (http://weblogs.asp.net/scottgu/archive/2006/04/05/442032.aspx). With this option installed you choose File->New Project and
create a web project just like VS 2003. You can then right-click and choose "Add New Item". Within that dialog box you create either a web-form or a class.
Hope this helps,
May 02, 2006 09:40 AM|bucketofsquid|LINK
Thanks for the response. I'm trying to conform to how MS wants people to use VS 2005. Things seem to work better that way.
What I'm after is not adding a class, but instead adding a code page that contains multiple classes. My project ties several distinct groups of data tables together and the company dev standards say that each unique table or group of related tables should
have it's own data access class but all data access classes should be in the same file.
From looking at VS 2005 it looks like I can't do that anymore. From past experiance, if I do something that MS does not want me to do it will cause problems. This means I have to try to change company policy. Before I start down that road I want to know
if I really have to. If I can just slam several classes into a class page with out causing other issues then everything is fine. If I can't then I have to do some office politicing to get a policy changed.
The absense of the code page option in VS 2005 tends to imply that I can't combine several classes into 1 file.
May 02, 2006 08:50 PM|omar_k|LINK
Scott referred me to this post. Can you help us better understand the scenario in VS2003 that you are doing? I have not heard of the term "code page" used to refer to a feature in VS2003, so i'm no sure which part of the product you are describing.
If you could provide some simple steps in VS2003 that describe how to create and get to what you refer to as a "code page", then I should be able to help answer your overall question.
May 03, 2006 12:46 PM|bucketofsquid|LINK
Heh, No wonder you were confused. It isn't a codepage, it is a code file. On the off chance you still don't get what I mean here, are the steps in VStudio 2003 to start one;
Open a project and go to solution explorer.
Right click the project name.
From the pop up menu select Add - Add new item.
In the pop up window select Catagories: web project items, Template: code file.
Properly phrased, my question is: What happened to the code file? Can I still have a code file in a web project?
Thanks and sorry for the confusion.
May 03, 2006 01:34 PM|omar_k|LINK
Thanks for clarifying, it makes more sense now. Yes I do see this removed. I'm not sure why we removed it, but I think we removed it because it was redundant with "Class" item which is what almost all code files are in web apps. If you really want a strict
"code file", they are still supported, you would just create a class and then remove all the text from within the file at which point its just a simple code file.
I would be interested in knowing if there are particular scenarios where you would have a code file but with no class declared in it, as that might have us reconsider adding the "Code File" template back in the next release.
Hope this helps.
May 03, 2006 02:44 PM|bucketofsquid|LINK
I received a "page cannot be displayed error so I'm trying this post again. My apologies if you see this post twice.
Thanks for the response. The reason we want to use the code file isn't to have code exist outside of any classes, but is to group a number of related classes. In this specific case there would be about a dozen classes in the file that exist to interact
with the Oracle data tables of several different software systems. Having one class that does all of this has proven to be far too difficult to maintain. With each class having it's own file it sometimes gets to be tedious to find the specific file needed
in a large project. With the functionality that VS 2003 gives for the code file we can zip right to the class and function we want by using the two dropdowns. We are used to this so for us it is faster.
We do use a SharedCode.vb file that only contains about four public variables for holding server and database names to make going between test and production transparent. We don't have to do this in a seperate file but it is cleaner and easy to find.
May 03, 2006 06:21 PM|omar_k|LINK
Thanks for explaining further.
For the scenario you describe you should be able to use the "Class" item template and just type in additional classes into that file. This gives the identical result as if you were to start with a "Code File" template. I'm guessing that is probably why
we removed the "Code File" template because you could just do the same thing with a "Class" item.
I also verified the drop-downs work as you describe and allow you to navigate to the multiple classes declared in your file.
Let me know if you have any other questions.
May 04, 2006 02:27 AM|mbund|LINK
Have you thought about creating an item or project template for your company? Use the File/Export Template... command to invoke an easy-to-use wizard to create it. The basic steps for a web site project look like this.
The only caveat is this will setup Add New Item on your own machine. But its very easy to do and may save you and your company some headaches later.
BTW, Web Application Projects do have the "Code File" item though I agree with Omar it is superfluous since you have "Class File" too.
May 04, 2006 11:48 AM|bucketofsquid|LINK