OT: (But need help from Visual Studio wiz-kids!)

OT: (But need help from Visual Studio wiz-kids!)

Old forum URL: forums.lhotka.net/forums/t/2043.aspx


david.wendelken posted on Thursday, December 28, 2006

Generally, I've been very happy with ASP.Net 2.0 vs 1.1.  But there was one feature that I really hated about 2.0 web apps, and that was that the Visual Studio Designer-generated code was no longer visible.  (Windows apps create a .designer file that contains the generated partial class code, but the web apps did not.) 

Today, we discovered by accident that if you create a web application one way, you get the .designer files that clearly show the generated code!  Way cool, now we can actually see the code VS writes for us.  But, I've got several applications that don't have .designer files, and I really want to convert them so I get those files. 

Anyone know how to do this in a quick, reliable and painless fashion?

FYI, using New->WebSite gets no .designer files.

New->Project  choosing Web, ASP.Net Web Application) gets .designer files.

 

JoeFallon1 replied on Thursday, December 28, 2006

Did you try right clicking the file in Solution Explorer? I thought there was a menu choice to convert it (or something like that.)

 

 

 

ajj3085 replied on Friday, December 29, 2006

I would be suprised if such an option existed, as I've heard many people ask this with regards to WinForms application when upgrading, and the MS answer has always been that you'd have to split the files manually.

david.wendelken replied on Friday, December 29, 2006

ajj3085:
I would be suprised if such an option existed, as I've heard many people ask this with regards to WinForms application when upgrading, and the MS answer has always been that you'd have to split the files manually.

The files are already split, you just can't see one of them if you create a web project one way, but you can if you create it the other way.

And, I discovered that the VS Professional version I have at home doesn't support the new way of creating a web project.  :(  Have to try to figure out if there is a download I can get.

ajj3085 replied on Friday, December 29, 2006

I think I have standard at home, and I can create projects either way.  I'll check tonight.

If they are being created either way, did you try clicking the Show All Files button?  Does that show the designer file?

I tried here at work both ways to create a project, and the way that didn't create the .Designer file, and in fact the code the designer generates is put right in the .cs code behind file...

david.wendelken replied on Friday, December 29, 2006

ajj3085:
I think I have standard at home, and I can create projects either way.  I'll check tonight.

If they are being created either way, did you try clicking the Show All Files button?  Does that show the designer file?

I tried here at work both ways to create a project, and the way that didn't create the .Designer file, and in fact the code the designer generates is put right in the .cs code behind file...

At home, show all files didn't change anything for web projects.   At work (a fancier version), the button is grayed out on my problem projects,   The newly created web project lets me click the show all files button, but the designer files show up either way. 

"I is very confused", to quote a friend of mine.

JoeFallon1 replied on Friday, December 29, 2006

I just checked VS 2005 SP1 Standard Edition.

I have a right click menu option labeled:

Convert To Web Application.

It appears right above Web Accessibility... for those pages in my Solution which do not have .desginer files. It does not appear for pages that already have them.

I have a project which was converted from 1.1 to 2.0. I have never used the Web Site style.

Maybe if you create a new Web Project and Add Existing Items you can then right click them to convert them. (The menu choice appears at the top level of my root directory too so it looks like you do not have to do them 1 page at a time.) Note: I have never actually clicked this option.

Joe

 

david.wendelken replied on Friday, December 29, 2006

JoeFallon1:

I just checked VS 2005 SP1 Standard Edition.

I have a right click menu option labeled:

Convert To Web Application.

It appears right above Web Accessibility... for those pages in my Solution which do not have .desginer files. It does not appear for pages that already have them.

I have a project which was converted from 1.1 to 2.0. I have never used the Web Site style.

Maybe if you create a new Web Project and Add Existing Items you can then right click them to convert them. (The menu choice appears at the top level of my root directory too so it looks like you do not have to do them 1 page at a time.) Note: I have never actually clicked this option.

Joe

Thank you!  I did some more research and figured out why my two systems operate differently.

We downloaded an msi file that allowed us to deploy web applications without the code files on some of our machines.  (Will look up the name and location of the download and post later.) 

On the machines we installed the download on, the new web project type is available, otherwise it isn't.  

The convert option you mentioned only exists in the new web application project, not the old web application site.   I was looking for it in the old application (where my source code files that need to be converted exist.)  Now I just have to copy and paste the files en masse and convert them one at a time. 

Oh, and test that the deploy project and the installers still work... :( 

Thanks everyone!

JoeFallon1 replied on Friday, December 29, 2006

"convert them one at a time."

Don't forget to look at the top level and try to convert them all at once.

Glad to see you found it.

Joe

 

Brian Criswell replied on Friday, December 29, 2006

VS2005 SP1 has the web application add on included.  In fact, you will need to uninstall the add-on before installing SP1.  One thing one of my coworkers mentioned is that not all features of ASP.NET 2.0 are available in web application projects yet (sorry, I do not have any specifics).

JoeFallon1 replied on Saturday, December 30, 2006

I have not run into any shortcomings in that area. But then again, I was used to 1.1 web projects. Maybe what your co-worker means is that the 2 models (sites vs. projects) are different and that some of the nice things about Sites are not available in projects. That may be true. Like the ability to change the code behind of a page and then refresh it without having to re-build the whole solution. But the converse is also true. Projects behave *much* better for large sites with different levels and misc. files. As with anything, it is a matter of trade-offs. I prefer the project model.

 

david.wendelken replied on Friday, December 29, 2006

JoeFallon1:

Did you try right clicking the file in Solution Explorer? I thought there was a menu choice to convert it (or something like that.)

Not that I could find!  Could you be more specific?

Copyright (c) Marimer LLC