Second release of the VS 2005 Web Application Project Preview now available

 May 8th Update: The final release of the VS 2005 Web Application Project is now live.  You can learn more about it here.

 

Earlier this week I blogged about an upcoming refresh preview of the VS 2005 Web Application Project.  This new build is now available for download here

A couple of setup notes to install it:

1) First shutdown all running instances of Visual Studio before installing it

2) If you have the previous December preview of the VS 2005 Web Application Project installed, you should uninstall this before installing the new build

3) Download and run setup on the build above, then launch VS 2005.  You can then do File->New Project to create a new ASP.NET Web Application Project.

I have updated the existing tutorials on http://webproject.scottgu.com for the new build.  I will be adding one more tutorial this weekend which shows how to convert an existing VS 2005 Web Site Project to be a VS 2005 Web Application Project should you choose to-do so.

Hope this helps,

Scott

P.S. I've been asked a few questions about the future of the VS 2005 Web Application Project option a few times by people in the last week.  A few things to clarrify:

1) We will fully support both the VS 2005 Web Site Project Model and VS 2005 Web Application Project Model going forward.  Developers can choose whichever model works best for them (we will be providing whitepapers that detail the models more and help list the pros/cons of each model).

2) Both the VS 2005 Web Site Project Model and VS 2005 Web Application Project Model will be built-in and fully supported in future releases of Visual Studio.

3) We are looking to add the VS 2005 Web Application Project model option into the VS 2005 SP1 download -- the reason we are shipping it on the web this spring is so that people can use it before then.  The build above is still a preview build (that is not feature-complete).  Our plan is to finish the features next month, and then make it a supported release this spring (even before SP1).

 

48 Comments

  • Hi Scott,



    Is it possible to upgrade an existing .Net 2.0 solution (including various websites and class projects)?



    Cheers,



    Julian

  • Thanks and great job!

  • The Upgrade File To Web Application does not convert user control declarations properly. They all go to the designer class as System.Web.UI.UserControl

  • Thanks Scott. Looking forward to the final release as this is what's keeping us from upgrading older web applications to VS 2005.



    While I would love to upgrade our older applications sooner there is just too much risk involved with the web project changes.

  • Hi Julian,



    Yep -- you can upgrade an existing web site project to use the new project model option. I'll be posting a step-by-step tutorial on how to-do this in the next few days.



    Hope this helps,



    Scott

  • hi Jesse,



    Can you send me email (scottgu@microsoft.com) with the exact scenario you did? Was it upgrading a VS 2003 file or a VS 2005 Web Site File (note: VS 2003 typed the user conrols as System.Web.UI.UserControl -- which is why I'm wondering if you upgraded them from there)?



    Note that to re-generate the .designer.cs file, you can just open the .aspx and make a change to it and hit save. This will cause the Web Application Project to automaticlaly re-generate the designer file with the right declarations.



    Thanks,



    Scott

  • Hi Joel,



    I know we are looking to enable WebPart drag/drop scenarios with FireFox as part of Atlas (which will actually have a go-live shortly). I'm not sure yet what the plan is to back port this work to SP1 though. I should know more in a few weeks.



    Hope this helps,



    Scott

  • Thanks so much for getting this out! I spent a lot of time this week wiring up controls manually. This new version is going to be a huge time saver!



    Any chance the next verison will hide the designer.cs files?



    Thanks a million!

  • Scott,



    Is there a new version of the Web Deployment Projects yet? The web site says Visual Studio 2005 Web Deployment Projects (Beta V2 Preview). Does V2 mean this is the new version? Thanks!

  • Hi,



    Nice work on the new release. Are the control event handlers are still generated in-line or do they now get added to the code-behind classes?



    Thanks!

  • Seem to be having problems with a Web Application Project having the profile class automatically generate.



    For example:

    Web.Config:

    <profile defaultProvider="SqlProvider">

    <providers>

    <clear/>

    <add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="DotNet"/>

    </providers>

    <properties>

    <group name="PersonalInfo">

    <add name="FirstName" type="System.String"/>

    <add name="LastName" type="System.String"/>

    </group>

    </properties>

    </profile>



    Page

    public partial class MyPage : System.Web.UI.Page {

    protected void SaveButton_Click(object sender, EventArgs e) {

    Profile.PersonalInfo.FirstName = TextBoxFirstName.Text;

    Profile.PersonalInfo.LastName = TextBoxLastName.Text;

    }

    }



    Profile.PersonalInfo class doesn't appear to generate.

  • I just finished converting a big (about 35 pages with 7 extenal class libraries) project to the "web project model".

    (took me about 1.5 hours)



    I had 2 main problems which i think every one should hear or know in advance.



    1) master pages , i have only 2 at the moment, but for me it didnt create the .designer.cs file for the master page , i had to create it manually, clicking on "upgrade to web..." seems to do nothing, creating manually means i had to write each control declaring in the file (yet again luckly, i didnt have that many controls)



    2) namespace , in "Web site" model the page classes dont have namespaces, i had to add namespace to the App_code classes , which forced me either to add namespaces to pages classes or add using <mynamespace> to each page, i chose the first option.

    choosing that option forced me to add my name space to the inherits attribute of each page.

    and after all seems there was some problem with having app_code in the project (seems it still trying to create assemblies to each class over there) so i renamed my app_code to other name and this issues was resolved.



    But...

    at least now my program is ready to use after 3-5 seconds , on "web site model" it was about 15-30 seconds (mainly because of the 7 external libraries)



  • Hi Scott,



    I've upgraded an existing VS2005 web project to the new web application model. In doing this, I started with a new web application project file and imported all of my existing content from the old project and used the "Upgrade File to Web Application" context menu option. All of the pages upgraded perfectly and the site runs fine.



    However, when I add a new page to the application, I am getting a "could not load type" error on any new pages. Obviously, this means that the code behind isn't compiling, but I'm not sure why. Thoughts? I know that the site is compiling because I can make changes to existing code-behind files without any problem. It just seems to be ignoring the new pages.



    Also, I noticed that the "Upgrade File to Web Application" option is not available on pages named "default.aspx". Is there a formal location where we should be reporting feedback like this.



    Thanks!

  • Hi Fabrice,



    Sorry about the delay in posting your first comment (I got sucked into doing a separate project yesterday and am just posting them now -- doh).



    To answer your question about Edit and Continue -- we have done some initial investigation into how we might be able to support it using the Cassini web-server. The challange with E&C is that it requires the process to be created when the debugger is launched -- which means we'd need to shutdown and startup the web-server on every debug session. The downside of this is that perf could actually be slower, and negate many of the benefits. We are still investigating more though.



    The "Changes are now allowed while code is running" issue you mention above is also something we are investigating. We are going to try hard to make sure that at a minimum we can enable this going forward.



    Hope this helps,



    Scott

  • Hi Cory,



    For VB projects the .designer.cs file is hidden by default (unless you choose the "Show All Files" option in the solutione explorer).



    C# projects by default nest files like .designer.cs underneath the top-level file-type. Note that you do not ever need to open the .designer.cs file anymore, though, since VS now automatically updates the class declarations within them.



    Hope this helps,



    Scott

  • Hi Lu,



    With the second refresh event-handlers generated within the WYSIWYG design surface are still generate inline on the page -- you then need to copy/paste these into the code-behind file to use. This will be fixed with the next refresh.



    Note that VB event drop-downs do now work in the code-behind file though. So if you are using VB you can automatically wire-up event handlers this way instead.



    Hope this helps,



    Scott

  • Regarding creating a wrapper class, I'm assuming you don't mean:



    [Serializable()]

    public class ProfileCommon : ProfileBase {

    public partial class PersonalInfo : ProfileGroupBase {

    public string FirstName {

    get { return (string)base.GetPropertyValue("FirstName"); }

    set { base.SetPropertyValue("FirstName") = value; }

    }

    public string LastName {

    get { return (string)base.GetPropertyValue("LastName"); }

    set { base.SetPropertyValue("LastName") = value; }

    }

    }

    }

  • Thanks for the reply, Scott. No problem for the delay! I just thought my question could have been lost by .Text :-)

  • cool.. have waited for a long time...

  • Scott, I first want to say that I am really glad this project type is available to those of us with VS2003 websites. We tried to upgrade the first time with the default project upgrade utility in VS2005 and it was a nightmare. Over the weekend, I used this latest refresh and I am overall pleased with the upgrade.



    I do have one problem, and it is significant. With this build, the server keeps timing out very quickly while using the website. We didn't have this problem on the previous ugprade build (using the default utility). It occurs after the initial login (no, we are not using Forms Authentication at this point, unfortunately). I can have 2 browsers open to the site, and log in as 2 different users, and when one stops responding, the other does as well. But then I can open a new browser and the login page loads fine, and allows the login to go through. But very soon after, it stops responding as well.



    Do you have any suggestions? It's very strange. I haven't seen this behavior with this site before.

  • Thank you so much for all the work you and your team have done on this. It's fantastic!!



    Any idea when the final version will be ready ??

  • Scott -

    Played with the new version a bit and I like the updates, thanks.

    A wish list item for the final release: A little more integration with IIS when creating a project, somewhat akin to VS2003..or VS2005 "New Web Site". For those of us that are head strong and intent on using IIS, to create a web in the current WAP the steps seem to be.

    (1) Create a WAP project

    (2) In IIS create the Virutal Directory (it the project was not create under the web site)folder.

    (3) In IIS set Virtual Directory as an "Application"

    (4) In VS2005 set project Web tab to use IIS and specifiy the URL.

    These steps are all doable....but a nice to have/wish list item would be for fewer steps.

  • Scott -

    I forgot to ask....Will final release of WAP have some deployment option i.e. copy/publish or will it rely on a WDP?

  • The "Upgrade to Web Application" option has a bug.



    The option is completely missing if the name of the page you want to convert is named Default. Darn thing's been driving me nuts today. I thought I didn't have it installed correctly because I would right click a Default.aspx page looking for that "Upgrade to Web Application" option and it would be missing. Turns out that it's only there for pages not named Default.

  • Scott, What is the best way to report bugs?

  • Hi Brad,



    Yep -- the final release will have a copy/publish step option integrated into it to provide basic publishing support. You can then add a WDP project for more advanced scenarios.



    Hope this helps,



    Scott

  • Hi Dylan,



    That is weird -- I will have someone look into that. Have you tried right-clicking on the web project root node and using the upgrade option there instead? that should upgrade all pages in the project.



    thanks,



    Scott

  • Hi Brad,



    We are looking at possibly adding a wizard to make this easier in the future.



    On the bright-side, you no longer need to install/manage front-page server extensions....



    Thanks,



    Scott

  • Scott,



    Nice One!



    We have just converted our fairly large asp.net 2.0 web application over to the new Web Application Project - and things have gone really well so far.



    It took us around half a day to refractor and upgrade our exiting 2005 code, as we had a large amount of code behind files in the app_code directory we wanted to put back in their rightful places (I agree with a previous post suggesting that the upgrade could be performed on a folder rather than a file).



    Apart from the warm feeling we get inside knowing that our application is now structured as we'd like it to be, we are most pleased with the performance of our builds. With the old web project our builds were taking around 1 minute and driving our developers mad - under the new Web Application Project these our builds complete in under 5 seconds (back to 2003 speeds!).



    Please pass our thanks on to your team - we truly appreciate the speed that this work made available to us (and believe us, it couldn't have come at a better time).



    Many Thanks,



    Andi

  • Hi Scott,



    Just tried converting a web project over to a web application. It now no longer builds as it's complaining about any occurences of Profile or Membership. I assume I am missing some references or imports somewhere that the web project structure takes care of for me?



    Thanks

    Chris

  • Just a small cosmetic item that would be nice to see. The designer files (e.g. mypage.aspx.designer.cs) should probably be run through the source code formatter that is built-in to VS2005 before writing the output.

  • Hi Scott,



    One other quick note. I've noticed a few issues with the designer file not populating all of the controls from the page. In particular it has strange behaviour when there are placeholder controls. Even attempting to recreate the file failed to place all the controls on the page in the file. It ended up missing all of the repeater controls and two other third party controls on the page.



    Cheers,

    Colin

  • Hi Colin,



    Any chance you could send me the .aspx and code behind content for a page that isn't generating all of the controls in the .designer.cs file (scottgu@microsoft.com)? That way we can figure out what the parser is tripping up on.



    Note in cases where a control isn't declared in the .designer file you can manually add the declarations to the code-behind file and have everything work. But if you can send me the cases that weren't working I will make sure we get these fixed for the next refresh.



    thanks,



    Scott

  • Hi Scott -



    Two issues I've noticed using the Web Application Project.



    A few times the designer has changed the type of a user control to its base class (System.Web.UI.UserControl) instead of the keeping it the specified namespace/class/type.



    Dragging a UserControl onto a .aspx page doesn't appear to render its content, but instead gives me the file path.



    Thanks again for all your help and info.



    Dan

  • Hi Dan,



    It would be great if you could help provide some repro steps for when the user-control reverts to the base-class type. I've seen someone else report that -- but they couldn't track down when it does it.



    The drag/drop of the user-control onto a page is a known feature still to implement. We'll get that done for the next refresh though.



    Thanks,



    Scott

  • Scott,



    I don't know if you located the issue of a UserControl generating as "System.Web.UI.UserControl" in the designer file (rather than it's specific type) but I identified what was causing my application to have the problem.



    The problem in my case was that the "register" directive's "tagname" attribute did not match the case of the element declaration.





    So:

    <%@ Register TagPrefix="uc1" TagName="Test" Src="Test.ascx" %>

    <uc1:test id="test1" runat="server"></uc1:test>



    The environment handles this fine (it still displays/runs correctly) but the designer logic is probably looking for a case sensitive match.



    Hope this helps.

  • Hi Bryant,



    We did in fact figure out what was causing that last night (we had a bug in the parser which creates a case sensitive dictionary instead of a case-insensisitve one).



    We are working on a fix now, though, and will have it updated for the next refresh (there are a few other code-gen issues like this we are also fixing).



    Thanks,



    Scott

  • Hi Jesse,



    When you configure the web deployment project you can choose to build from either a file-path directory, or an IIS metabase path. If you have nested sub-applications you'll want to-do the later.



    If you want to send me email (scottgu@microsoft.com) I can help guide you on the metabase path syntax to use.



    Hope this helps,



    Scott

  • Hi Scott,



    This is great! Will there be support for ASPX files with NO code behind/beside .cs files?



    We would like to have some ASPX files with the code included, so that our customers can modify these. Right now it looks like you can only create aspx's with code files associated with it.



    Thanks!

    Curtis.



  • Hi Curtis,



    By default when you say File->Add New Item->Page to the project, it will add a .aspx page with a code-behind file. If you want, though, you can delete the code behind file and just have the .aspx.



    Hope this helps,



    Scott

  • Hi Krishna,



    You can actually open up the designer.cs file and mark the controls public now (we enabled this with this second refresh). You should also be able to use the refactoring tools to enable this.



    Does that work for you?



    Thanks,



    Scott

  • Hi Scott,



    Yup, that would work, this is Awesome, Just tried it out and it worked great, makes it much more easier in writing the Unit Tests..Thanks !



    Krishna

  • This is working great, and is exactly what we needed. The only thing missing is a "Publish" option (FTP/FrontPage/Local IIS). If that were included it would be perfect.



    Thanks!

    Brad

  • Hi Brad,



    The publish feature will be coming later this month with the next refresh (it will provide the same copy project semantics as VS 2003).



    Note that you can also now use Web Deployment Projects with Web Application Projects -- so if you want custom publish MSBuild script rules you can also use that.



    Hope this helps,



    Scott

  • Hi Scott,



    I am attempting to use the output of one web project as a reference in another.  I am looking for a way to set the build to Updateable=false (or similar) so that even Aspx and Ascx files are compiled into that source project's dll.



    Other than this special need, the web project is a huge improvement. Thanks to you and the team!



    Terry

  • Hi Terry,

    You can actually accomplish this by adding a VS 2005 Web Deployment Projects to your solution and have it do a post-deployment build of the VS 2005 Web Application Project. You can then configure it to have non-updatable .aspx content (meaning the html is compiled into the output assembly).

    Hope this helps,

    Scott

  • Hi Scott,

    In your response to Terry, you said to have the Web Deployment Project do a "post-deployment build" of the Web Application Project ... can you elaborate ?
    ( I can't figure out how to do that )

    Also, you said to add the Web Deployment Project "to the solution" ... you meant add it "to the Web Application Project", correct ?
    ( I couldn't find a way to add a Web Deployment Project directly to a solution )

  • Hi Grundt,

    With VS 2005 Web Application Projects, you can right-click on the project and pull up its property page. You can then click on the "Build Events" tab to setup pre or post build events.

    To learn about how to associated a web deployment project you can check out this blog post that I did: http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx

    Hope this helps,

    Scott

Comments have been disabled for this content.