Announcing NuPack, ASP.NET MVC 3 Beta, and WebMatrix Beta 2

I’m excited to announce the beta release of several projects today.

Two of these releases - ASP.NET MVC 3 Beta and WebMatrix Beta 2 - are evolutions of projects we first previewed this summer.  The third – NuPack - is a new project that I’m particularly excited about.

NuPack – Open Source Package Manager for .NET

NuPack is a free open source package manager that makes it easy for you to find, install, and use .NET libraries in your projects. It works with all .NET project types (including, but not limited to, both ASP.NET Web Forms and ASP.NET MVC).

NuPack enables developers who maintain open source projects (for example, projects like Moq, NHibernate, Ninject, StructureMap, NUnit, Windsor, RhinoMocks, Elmah, etc) to package up their libraries and register them with an online gallery/catalog that is searchable.  The client-side NuPack tools – which include full Visual Studio integration – make it trivial for any .NET developer who wants to use one of these libraries to easily find and install it within the project they are working on.

NuPack handles dependency management between libraries (for example: library1 depends on library2). It also makes it easy to update (and optionally remove) libraries from your projects later. It supports updating web.config files (if a package needs configuration settings). It also allows packages to add PowerShell scripts to a project (for example: scaffold commands). Importantly, NuPack is transparent and clean – and does not install anything at the system level. Instead it is focused on making it easy to manage libraries you use with your projects.

NuPack is itself an open-source project.  The Outercurve Foundation (formerly CodePlex Foundation) today announced the acceptance of the NuPack project to the ASP.NET Open Source Gallery.  Developers - both inside and outside Microsoft – will contribute features, bug fixes and patches to NuPack.

Our goal with NuPack is to make it as simple as possible to integrate open source libraries within .NET projects.  It will be supported in all versions of Visual Studio.  You can start using the first developer preview of it today.

A Simple NuPack Scenario – Enabling ELMAH

As a simple example to show off what NuPack enables – let’s assume we are working on a brand new ASP.NET application and want to use the popular open-source “ELMAH” library to log and report errors with our site.  To install ELMAH today, you’d need to manually download it, unzip it, add a reference to your project, make sure you have source control bindings for the library setup correctly, and update the web.config file of your application to include the Elmah HttpModule entries.  All doable – but a little tedious.

With NuPack installed, you can simply open the new “Package Manager Console” that NuPack enables inside VS and type “Add-Package elmah” within it:

image

Typing "Add-Package elmah” causes NuPack to check an online feed to locate the Elmah library, download it, add a reference of it to your current project, and automatically add the appropriate Elmah registration entries within your application’s web.config file:

image

And now we have Elmah setup and installed for our project, and error report logging enabled.  No additional manual steps required to make it work.

Learn More About NuPack

Check out the following links to learn more about NuPack and some of the many scenarios it enables:

.NET and Open Source

We think NuPack will be a fundamental component of the .NET stack going forward.  It will encourage more .NET developers to use open-source libraries.  Having a standard package manager integrated into millions of copies of Visual Studio will hopefully also encourage the creation of more open source projects with .NET.

ASP.NET MVC 3 Beta

Today we are also shipping a Beta Release of ASP.NET MVC 3.  This release is a significant update of the ASP.NET MVC 3 Preview we shipped two months ago, and includes a bunch of great feature improvements.

In addition to the ASP.NET MVC 3 features introduced with the first preview, today’s beta includes:

  • Razor Enhancements: ASP.NET MVC 3 supports the new Razor view-engine option. In addition to the functionality enabled with the ASP.NET MVC 3 Preview, today’s Beta adds a bunch of additional capabilities: Cleaner MVC integration – including the ability to use a new @model syntax to more cleanly specify the type being passed to the view.  A new @helper syntax for declaring re-usable HTML helpers (really slick).  A new @* *@ comment syntax.  The ability to specify defaults (like layoutpage) once for the entire site - keeping your views DRY.  Support for using both C# and VB flavors of Razor.

  • New View Helpers: New view helper methods are now supported.  This includes a new Chart() helper method for dynamically creating charts (same features as the <asp:chart> control in ASP.NET 4 – except now using view helper methods), as well as a new WebGrid() helper method that can be used to create data-grid style UI (including paging and sorting).

  • Unobtrusive JavaScript and HTML 5: The AJAX and Validation helpers in ASP.NET MVC now both use an unobtrusive JavaScript approach by default. Unobtrusive JavaScript avoid injecting inline JavaScript into HTML, and instead enables cleaner separation of behavior using the new HTML 5 data- convention (which conveniently works on older browsers as well). This makes your HTML smaller and cleaner, and makes it easier to optionally swap out or customize JS libraries.  The Validation helpers in ASP.NET MVC 3 also now use the jQueryValidate plugin by default.

  • Dependency Injection: The initial ASP.NET MVC 3 Preview added better support for Dependency Injection (DI) with Controllers, Views and Action Filters.  Today’s Beta extends this with better dependency injection support for Model Binders, Model Validation Providers, Model Metadata Providers, and Value Providers.  It also supports a new IDependencyResolver interface that makes it easier to integrate Dependency Injection Frameworks.

  • NuPack Integration: ASP.NET MVC 3 automatically installs and enables NuPack as part of its setup.  This makes it trivial to take advantage of NuPack to find and add lots of MVC extensions and libraries to your projects.

  • Other Goodness: The initial ASP.NET MVC 3 Preview added lots of additional helpers and classes to make everyday coding better.  Today’s beta includes a bunch of additional improvements: more granular XSS HTML input validation, HTML helper improvements to support HTML 5, Crypto helpers for salting and hashing passwords, easier Email APIs, improved “New Project” dialog, etc.

The ASP.NET MVC 3 beta supports “go-live” deployments – which means the license does not restrict you from building and deploying production applications with it.

Learn more about ASP.NET MVC 3

Check out the below links to learn more about the ASP.NET MVC 3 Beta:

Download

Click here to download and install the ASP.NET MVC 3 Beta using the Microsoft Web Platform Installer.

Alternatively you can download and install the ASP.NET MVC 3 Beta using a standalone installer here (note: for today’s beta you need to first install the AspNetWebPages.msi link from that page and then the AspNetMVC3Setup.exe file).

WebMatrix Beta 2

Today we are also shipping WebMatrix Beta 2.  This release is an update of the WebMatrix Beta 1 preview we shipped this summer, and includes a number of great feature improvements.

In addition to the WebMatrix features introduced with the first beta, today’s Beta 2 release includes:

  • Web Page Enhancements: WebMatrix supports building standalone ASP.NET Web Pages using the new Razor syntax. It includes the same syntax improvements (@helper, @* comment *@, etc) that I mentioned above with ASP.NET MVC 3.  It also now supports building pages using both VB and C#.

  • Improved Templates: WebMatrix includes template projects for common scenarios.  The template projects now use HTML 5 and CSS 3 (and also work with downlevel browsers).  A new Wishlist project template has been added with Beta 2.

  • NuPack Integration: WebMatrix provides NuPack integration and supports a web-based admin experience for installing libraries to an application you are working on.

  • Toolkit Support: We are delivering a toolkit (that can be installed via NuPack) that provides convenient helpers that can be used within ASP.NET applications.  This includes helpers for Analytics, Facebook, GamerCard, Gravatar, LinkShare, Captcha, Twitter and Video scenarios.

Download

Click here to download and install WebMatrix Beta 2.

Summary

Today’s releases further evolve and enhance the Microsoft Web Stack.  All of the above capabilities work with .NET 4 and VS 2010, and do not modify any existing files that ship with it (they are all additive and safe to install on your machine). 

I’ll be blogging more details about some of the above improvements in the weeks ahead.

Hope this helps,

Scott

126 Comments

  • Updates look great! Keep up the good work. Can't wait for intellisense support for Razor views.

  • I have a post on NuPack as I was part of the team here.
    http://weblogs.asp.net/bsimser/archive/2010/10/06/unicorns-triple-rainbows-package-management-and-lasers.aspx

  • Hi Scott,

    Sounds great - any news onm intellisense for Razor?

    Regards, Matt.

  • Very nice! DEVELOPAHS! DEVELOPAHS! DEVELOPAHS!

  • This is fantastic - I've been playing around with Nu in VS to simulate Ruby Gems functionality, but to have it supported by MS within VS is fantastic.

  • Will you be able to add other repositories to your local config, so that I can use this for internally shared libs? Because that would be a huge win for shops that use many shared libs but don't want to release them to the public.

  • wow This is some news. Great to hear this.

  • Great stuff (especially about the MVC3 beta stuff)! Can you confirm that VS2010 now supports Razor syntax highlighting for MVC Beta 3? I was looking out for that in the text but couldn't see it, so apologies if I missed it.

  • It seems NuPack 'borrows' VERY heavily from the OpenRasta product Seb Lambla started 2 years ago.

  • Looking forward to razor view intellisense report. NuPack looks great. thanks.

  • I really like the look of the razor syntax, seems like a much cleaner view engine than the webforms one.

    I'm not really convinced by the need for all the new MVC helper methods. Particularly charts. One of the things I really like about MVC is how small and concise it is. Everything I need to know fits in my head. I'm a bit worried that MVC3 and beyond will start to suffer from feature bloat.

    Hopefully that won't happen, but I wouldn't like to see lots of features just been added for the sake of it.

  • There seems to be a lot of enthusiasm for this solution, and my only knowledge of it is via the linked blog posts and a quick perusal of the codeplex site. A few things that seem kind of, um, intereseting at first glance:

    1) Released "only" as a VSX package? Really? Only supporting 2010, no less? I guess that's great for MVP bloggers, community evangelists and other assorted MS Employees who like to auto-fellate on all the Great Things they do for the community, but there's still a *huge* number of enterprise devs out there in the wild still on VS2008 and 2.0/3.5 . If reaching them and expanding the reach and ease-of-access to FOSS solutions is the goal, here, then this is an unsatisfactory solution.

    2) This is a decidedly "dev-side" solution to the problem. That is, a developer with a local copy of the code checked out manages dependencies locally and that information (the abstract dependency graph) is only really represented in the artifacts of NuPack's work (the changes it makes to proj files). I'm curious to see how/when this could be leveraged in a Continuous Integration/Build scenario, as it is pretty much "missing" at the moment. In this regard, NuPack is a *lot* different from other dependency management schemes that appear in other platforms (Gems/Bundler in particular come to mind), where the fetch/integration step is explicitly part of the tool/ and intended to verified in the course of CI and integrate into your build/deployment scheme. This doesn't appear to be the case with NuPack, but please correct me if I'm mistaken. We can also have a debate on the merits of the above-mentioned approach(es), as plenty of people aren't terribly fond of Bundler.

    3) Umm.. Mono?

    At this point, the default response is probably along the lines of "blah blah open source blah blah if you don't like it, we take pull requests blah blah etc." Ok. Fine. But I can just-as-easily turn that question around, like: how does this tool differentiate from other, existant, solutions like hornget (besides possibly being actively maintained)? Thanks for moving the FOSS community forward, guys. Which brings us to...

    4) Not-Invented-Here, anyone?

    Bonus points for talking about the problem-space as though NuPack were the only possible solution, to date. Kudos. Reminds of me EF, WCF, ASP.NET MVC, Unity, etc.

  • Any info regarding the source codes? They were not available in preview, so how about beta?

  • Scott,
    Is it possible to upgrade from Web Matrix Beta 1 to Beta 2 or does it require a full uninstall/reinstall? I'm not seeing anyway to check for updated versions in WPI or Web Matrix itself.
    Thanks.

  • Great work Scott!!

    As per Richard's concern, I think it will save lot of time and code by having chart and grid functionality in MVC.

  • Ah, yes, I was thinking Web Matrix was IIS Express. When is the update for IIS Express and integration into Visual Studio coming?

  • Nice to have something similar to Maven of Java here. Will be better if it downloads dependencies of those libraries if there are any.

  • Whoa whoa whoa whoa whoa whoa WHOA. Open a console and type some cryptic commands to a package manager? What is this, Linux? :) Fortunately there IS a GUI for this, as described by the blogs you linked to. You had me going for a minute there though!

  • I have not been able to install WebMatrix using the wpilauncher.exe file EVER. Anyone know why that might be? I have admin rights on the box, but I get a message saying it's not a valid installer and that the program couldn't start.

  • You delete optional of @RenderSection?
    @RenderSection("content",optional:true) bug

  • This is very dismal, I see now that there will be no feature to return multiple views in mvc 3.0, or even an elegant way to update various divs without having to make multiple requests (which force js hackery to request and blatant js hackery to split up and re assign on the receive end)... I still find it hard to believe that such a common need is not only ignored but not even acknowledged.

  • Hi, Scott
    Is it just me or what?
    1. My machine already has WPI 3.0 and WebMatrix Beta 1
    2. Your link to download WebMatrix Beta 2, it directs me here: http://www.microsoft.com/web/webmatrix/download/ ~ and the downloads is for the WPI 3.0, which I already have.
    3. How can I update my WPI 3.0 to update to WebMatrix 2

    Thanx

  • In case anyone gets turned off by the console - it has a GUI as well. Check out Scott Hanselman's post, half way down it you will see that that the References node in the Solution Navigator has a a new context menu item to add a package reference.

  • Scott

    This is really great news. I am very much anticipating the Razor view engine release. The only question I have is when do you think the razor engine will support donut caching?
    This is a very critical feature for public facing web sites with mostly static pages and a few dynamic elements. For instance a home page that is essentially static but displays dynamic login controls.

    Thanks

  • Scott,

    Where can we find information on using razor outside of a webpage? For example, to create an e-mail. The existing code I have partly working with the previous beta doesn't work with Beta 3, there appear to have been some major changes.

    ...Stefan

  • W.r.t. the MVC install via the Web Platform Installer I get an error that reads "The product you are trying to install in not supported on your operating system"! My OS is Windows 7. The executable works fine though.

  • @Matt,

    >>>>>>> Sounds great - any news onm intellisense for Razor?

    Razor intellisense isn't in today's beta. We needed to do a little more testing (and bug fixing) before we were ready to distribute it broadly. It patches a few VS files and so we need to make sure it is 100% solid before giving it out broadly.

    It will definitely be in the final release, though, and should be available for people to install in the next few weeks.

    Thanks,

    Scott

  • @poundKeys,

    >>>>>> Will you be able to add other repositories to your local config, so that I can use this for internally shared libs? Because that would be a huge win for shops that use many shared libs but don't want to release them to the public

    Yes - NuPack supports the ability to register multiple feeds. So you could have a local feed for just your organization. Alternatively you can also just point to a local file-system directory/share and drive it off of that. So lots of options along what you are looking for.

    Hope this helps,

    Scott

  • @Steve Hobbs,

    >>>>>>>> Can you confirm that VS2010 now supports Razor syntax highlighting for MVC Beta 3?

    Razor intellisense isn't in today's beta. We needed to do a little more testing (and bug fixing) before we were ready to distribute it broadly. It patches a few VS files and so we need to make sure it is 100% solid before giving it out broadly.

    It will definitely be in the final release, though, and should be available for people to install in the next few weeks.

    Thanks,

    Scott

  • @Adam,

    >>>>>>> Looking forward to razor view intellisense report. NuPack looks great. thanks.

    Razor intellisense isn't in today's beta. We needed to do a little more testing (and bug fixing) before we were ready to distribute it broadly. It patches a few VS files and so we need to make sure it is 100% solid before giving it out broadly.

    It will definitely be in the final release, though, and should be available for people to install in the next few weeks.

    Thanks,

    Scott

  • @Richard,

    >>>>>> I really like the look of the razor syntax, seems like a much cleaner view engine than the webforms one. I'm not really convinced by the need for all the new MVC helper methods. Particularly charts. One of the things I really like about MVC is how small and concise it is. Everything I need to know fits in my head. I'm a bit worried that MVC3 and beyond will start to suffer from feature bloat. Hopefully that won't happen, but I wouldn't like to see lots of features just been added for the sake of it.

    The new helpers aren't required (and you can actually unregister them if you don't want them). We added them primarily because those were scenarios a lot of people asked for better support with.

    Hope this helps,

    Scott

  • @Anonymous,

    >>>>>> Any info regarding the source codes? They were not available in preview, so how about beta?

    The NuPack source is available now. The ASP.NET MVC 3 source should be available shortly (it was posted for the Preview BTW).

    Hope this helps,

    Scott

  • @Blaise,

    >>>>>>> Is it possible to upgrade from Web Matrix Beta 1 to Beta 2 or does it require a full uninstall/reinstall? I'm not seeing anyway to check for updated versions in WPI or Web Matrix itself.

    You should be able to upgrade. Send me email (scottgu@microsoft.com) if you have problems.

    Thanks,

    Scott

  • @Mike,

    >>>>>>> While all this is nice, I am desperately waiting for IIS Express.

    IIS Express for VS 2010 is coming in the future - we need to release an update for VS to support it cleanly. We'll release this once it is ready.

    Here is a good post on how you can use IIS Express with VS 2010 now (and not have to wait): http://www.intrepidstudios.com/blog/2010/7/11/debug-your-net-web-project-with-iis-express-t.aspx

    Hope this helps,

    Scott

  • Weird issue I found today when playing with the newest release. If I'm using the Authorize attribute on a Action when it goes to redirect to the Login action it is always redirecting to Account\Login and not reading the Forms authorization setup in the web.config. For instance with just a default project created from the new MVC3 Template add the authorize attribute to the Index method and run the site. It will throw an error saying it can't find the Account/Login page. It should be going to the Account/LogOn page.

  • @Liming,

    >>>>>> Nice to have something similar to Maven of Java here. Will be better if it downloads dependencies of those libraries if there are any.

    Yes - NuPack handles dependencies for you (and will download those too). Check out Scott Hanselman's post on NuPack and see the NHibernate.Linq package example for how this works: http://www.hanselman.com/blog/IntroducingNuPackPackageManagementforNETAnotherpieceoftheWebStack.aspx

    Hope this helps,

    Scott

  • @mcdoma2000,

    >>>>>>>> I have not been able to install WebMatrix using the wpilauncher.exe file EVER. Anyone know why that might be? I have admin rights on the box, but I get a message saying it's not a valid installer and that the program couldn't start.

    Send me email (scottgu@microsoft.com) and we can investigate what is going on.

    Thanks,

    Scott

  • @stuhin,

    >>>>>>> You delete optional of @RenderSection? @RenderSection("content",optional:true) bug

    The API has changed slightly. You not write:

    @RenderSection("content, required:false)

    Hope this helps,

    Scott

  • @Erx,

    >>>>>>>> This is very dismal, I see now that there will be no feature to return multiple views in mvc 3.0, or even an elegant way to update various divs without having to make multiple requests (which force js hackery to request and blatant js hackery to split up and re assign on the receive end)... I still find it hard to believe that such a common need is not only ignored but not even acknowledged.

    Well today is just the beta. There will be more features coming in the future.

    Scott

  • @EarlNet,

    >>>>>> How can I update my WPI 3.0 to update to WebMatrix 2

    Shoot me email if you are having problems (scottgu@microsoft.com) and we can help.

    Thanks,

    Scott

  • @Areg,

    >>>>>>> This is really great news. I am very much anticipating the Razor view engine release. The only question I have is when do you think the razor engine will support donut caching? This is a very critical feature for public facing web sites with mostly static pages and a few dynamic elements. For instance a home page that is essentially static but displays dynamic login controls.

    Yes - I believe the plan is still to build-in partial caching support before the final release.

    Hope this helps,

    Scott

  • @Stefan,

    >>>>>> Where can we find information on using razor outside of a webpage? For example, to create an e-mail. The existing code I have partly working with the previous beta doesn't work with Beta 3, there appear to have been some major changes.

    Send me email (scottgu@microsoft.com) and I'll connect you with someone who can help.

    Thanks,

    Scott

  • @Levi,

    >>>>>>> Weird issue I found today when playing with the newest release. If I'm using the Authorize attribute on a Action when it goes to redirect to the Login action it is always redirecting to Account\Login and not reading the Forms authorization setup in the web.config. For instance with just a default project created from the new MVC3 Template add the authorize attribute to the Index method and run the site. It will throw an error saying it can't find the Account/Login page. It should be going to the Account/LogOn page.

    You found a bug! To work around it, add the following entry into your web.config file:





    ( is a child element of , not of .)

    This should fix it.

    Thanks,

    Scott

  • Does Nu let you pick the latest trunk builds yet? Last time I tried it you couldn't have Trunk of FNH/NH3.0. Which would make it fail compared to HornGet... :( I miss HornGet website.

  • sweeeet, that nu packaging tool it's exactly what .net lacked at this moment comparing to ruby

  • Does the go live mean there won't be any breaking changes in the RTM release? Is it safe to build in MVC3 to launch before year end? I'm not sure if an ETA for RTM has been announced.

  • Does NuPack support adding package source code as new project to current solution for developer who wants to control/debug every line of code?

    Thanks,

  • Great stuff. I noticed SQLCE as a package; does that still require an independent installer as per your earlier blog posts or will doing adding the package via NuPack accomplish the same thing in terms of getting features like EF Code First to auto-generate a .sdf if it doesn't already exist?

  • @Philip,

    >>>>>>> Does Nu let you pick the latest trunk builds yet? Last time I tried it you couldn't have Trunk of FNH/NH3.0. Which would make it fail compared to HornGet... :( I miss HornGet website.

    NuPack will allow people to upload multiple versions of a package. So you could envision one for the latest trunk of a project and also a stable one for released versions.

    Hope this helps,

    Scott

  • A note about moving AddGlobalImport to System.Web.WebPages.Razor.WebPageRazorHost would've been nice, especially since I can't seem to specify them using web.config yet... :)

  • @Kareem,

    >>>>>>>> Does the go live mean there won't be any breaking changes in the RTM release? Is it safe to build in MVC3 to launch before year end? I'm not sure if an ETA for RTM has been announced.

    We aren't guaranteeing no breaking changes, and I suspect there still will be a few tweaks before RTM. In general, though, the changes should be pretty minor and not impact your ability to build on top of it.

    Thanks,

    Scott

  • @Soul_Master

    >>>>>> Does NuPack support adding package source code as new project to current solution for developer who wants to control/debug every line of code?

    Not entirely sure I understand this - can you explain more what you are looking to enable?

    Thanks,

    Scott

  • @Paige,

    >>>>>>> Great stuff. I noticed SQLCE as a package; does that still require an independent installer as per your earlier blog posts or will doing adding the package via NuPack accomplish the same thing in terms of getting features like EF Code First to auto-generate a .sdf if it doesn't already exist?

    The SQLCE package will actually add it to the \bin directory of your app - and embed the database within the actual application. So no need to run an installer at all on a machine. Makes adding an embedded database super easy!

    Thanks,

    Scott

  • Scott, I think it was mentioned in the MVC preview that the Razor teams was considering providing support for declaratively building helpers by placing .cshtml files in a “Helpers” folder. Is that in this release, possibly still in the pipeline, or being persued?
    I agree with Areg, doughnut/doughnut hole caching support would be a big plus.
    Cannot wait to dig into this.

  • Not sure if this is or should be a supported scenario, however every time I attempt to Add Package Reference to a Modelling Project, VS2010 opens the Add Package Manager then abruptly crashes VS2010!

  • For my understanding, NuPack is a tool for including any related dll files to current project and setting any related configuration file and so on.

    But I want to add any related-source code as new project (that should be one or more projects) to my solution. For example, I want to add ASP.NET MVC 3 Beta package to my solution. NuPack should able to create ASP.NET MVC source code project and add it to my solution. After that, NuPack add reference of ASP.NET MVC project to my default main project instead of reference to its dll.

    Thanks,

  • Dear Scott, when we'll have standalone IIS express...any idea?

  • I like NuPack and excited about Razor Enhancements.....

  • Scott, I wish all of Microsoft ran like the developer tools unit does. These teams are doing a great job of listening to your customers and building the software they need.

  • Congrats for the Beta release of MVC 3

  • Thanks! will be great have a look at it!

  • Congrats Scott + Team.

    Just out of curiosity, whats the most complex package installation you've used NuPack on. The Elmah example seems a little simple for something you have to do once at the Solution Setup Stage. (Not knocking it, just curious ;-))

    Will have to make time to play with this at the weekend

    ~Eoin C

  • What happens if I already have the binaries for a package installed, but not as a package. Can I then use NuPack to upgrade? For example, if I already have elmah installed, but pre NuPack and elmah releases a new version via NuPack, can I use NuPack to upgrade the existing assemblies, or do I have to rip out the existing elmah functionality, so that NuPack can take over?

  • Scott -> thanks again for making it easier...

    If we are currently developing for MVC2 - and using libraries/third-party components (i.e. Telerik) which are MVC2 specific (installs which differentiate libraries for MVC1 and MVC2), would we be able to use MVC3beta seamlessly. In other words, are there any API-level or otherwise breaking changes that would make using MVC2 dependencies potentially fail?

    Thanks again, Jim

  • Looking forward to your early release for including NuPack, ASP.NET MVC 3 Beta, and WebMatrix Beta 2!

  • Looking forward to your early release for including NuPack, ASP.NET MVC 3 Beta, and WebMatrix Beta 2!

  • Great to see nupack! Thank you!
    Btw, assets directories (Content, Scripts) could be in one directory assets/scripts|styles

  • Does anyone know of any example of using the new HTML Helpers with MVC 3? - In-particular, the WebGrid...?

  • I am also votin for returning multiple views or to have an elegant way to update multiple span or divs in one call. The roadmap has no indication of this, will it be in mvc3 final?

  • I am also votin for returning multiple views or to have an elegant way to update multiple span or divs in one call. The roadmap has no indication of this, will it be in mvc3 final?

  • Does anyone notice that a website created with ASP.NET MVC 3 Beta 1 runs slowly? (about 1 sec wait time until the page is fully loaded. this wasn't the case with the previous Preview 1 version)

  • When will release a fix for a bug when we using copy / paste feature?
    It's really annoying having to close and open visual studio every time it occurs.

  • when I go to the web platform page it's for web platform installer 2.0 I have web platform
    3.0 instaled there is no option fro MVC 3 so I went and instaled mvc 3 when I launch Package Manager Console I get this

    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\types.ps1xml(2943) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\types.ps1xml(2950) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\types.ps1xml(2957) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\types.ps1xml(2964) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\types.ps1xml(2971) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
    System.Management.Automation.ActionPreferenceStopException: Command execution stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to find type [NuPackConsole.Host.PowerShell.Implementation.PSTypeWrapper]: make sure that the assembly containing this type is loaded.
    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
    at System.Management.Automation.Runspaces.Pipeline.Invoke()
    at NuPackConsole.Host.PowerShell.Implementation.PowerShellHost.Invoke(String command, Object input, Boolean outputResults)
    at NuPackConsole.Host.PowerShell.Implementation.PowerShellHost.LoadStartupScripts()
    at NuPackConsole.Host.PowerShell.Implementation.PowerShellHost.Initialize()
    at NuPackConsole.Host.PowerShell.Implementation.PowerShellHostProvider.c__DisplayClass2.b__1(Object sender, EventArgs e)
    at NuPackConsole.CommonExtensionMethods.Raise(EventHandler ev, Object sender, EventArgs e)
    at NuPackConsole.Implementation.Console.ConsoleDispatcher.Start()
    at NuPackConsole.Implementation.PowerConsoleToolWindow.MoveFocus(FrameworkElement consolePane)

  • I've made a simple hello world project in both asp.net mvc 2 aspx and mvc 3 razor and benchmarked them. it was in release mode on iis 7.5 and I've tested with ab (Apache benchmark), run 50.000 requests with 1000 clients. It seems razor is 2.7 times slower than mvc 2 aspx. I know it's under development and will be optimized but can it be as fast as aspx when released ?

  • I have been working on a website using MVC Preview 1 since it came out. Now that beta is out, I have updated my system to beta.

    There is not alot of help out there for upgrading from Preview 1 to beta, and just rebuilding caused a lot of problems. What I have done so far:

    1) Copied the web.config from a new MVC3 Beta project (to get the correct sections and values). 2) Added references to System.Web.Helpers and System.Web.WebPages, so that my references would match the newly created project. 3) Changed all my @import to @model as per the new format.

    The problem I am getting, is that the views in the existing project, are being derived off of System.Web.Web.Pages and those in the new project are being derived off System.Web.Mvc.WebViewPage.

    What am I missing that would be causing this base class issue.

  • You need to disable .NET reflector in your Add Manager it will work but no intellisense
    and no elmah and every time I type in List-Package I get a different set of packages
    most of the examples install elmah it's not available so I gust left it for a while typed in List-Package a few times until elmah showed up typed in Add-Package elmah and it installed could it be so many pepole stroking this puppy that the server is backed up

  • Two thoughts:
    1. In the Application_PostAuthenticateRequest() method of my Global.asax.cs file I am referencing Context.User.Identity. This install caused this identity to come back as null every time I hit a page. However, your post above about adding to my root Web.config file fixed the problem. Thanks!

    2. I am getting the following runtime error on a @using directive on the top of a cshtml file:

    System.Web.HttpParseException was unhandled by user code Message=Expected ";"

    If I add a semicolon to the @using directive the error goes away, but then I get a ";" on my page. Looks like a bug.

    Thanks,
    Danny

    (posted this on Phil's page this morning as well)

  • The error I was receiving before was due to our corporate proxy. I got it resolved with the network team.

  • If I add a package reference using NuPack, can I then debug into the package's source code?

  • nice work, i love it. can you add more support “multiply registered” style services? i would like to see an IRouteProvider interface.

  • Does Razor support Display and Editor templates including the related helpers?

  • I noticed when I created a new MVC3 app, that the jQuery library used is 1.4.1. Any plans to use 1.4.2 for the final version?

  • Does ASP.NET MVC 3 supports WinXP? I can't seem to install it. Thanks.

  • @Gorazd Švajger

    >>>>>>> A note about moving AddGlobalImport to System.Web.WebPages.Razor.WebPageRazorHost would've been nice, especially since I can't seem to specify them using web.config yet... :)

    Sorry you ran into that! Do you have it working now?

    Thanks,

    Scott

  • @lynn,

    >>>>>>>> Scott, I think it was mentioned in the MVC preview that the Razor teams was considering providing support for declaratively building helpers by placing .cshtml files in a “Helpers” folder. Is that in this release, possibly still in the pipeline, or being persued?

    It does. There is a new @helper syntax that I'll blog about (alternatively you can find it in the release notes). Today you can declare helpers either inside a .cshtml file or by dropping a .cshtml file in the \App_Code directory. We are looking to enable you to create class libraries containing helpers (just drop the .cshtml file in them) - which I think will provide great re-use and flexibility. The class library support isn't there yet - but will come in the future.

    >>>>>>> I agree with Areg, doughnut/doughnut hole caching support would be a big plus.

    Yep - this is coming too.

    Hope this helps,

    Scott

  • @AM,

    >>>>>>> Not sure if this is or should be a supported scenario, however every time I attempt to Add Package Reference to a Modelling Project, VS2010 opens the Add Package Manager then abruptly crashes VS2010!

    Sorry you are running into that. Send me email (scottgu@microsoft.com) and we can help.

    Thanks,

    Scott

  • @Naveen,

    >>>>>>> Dear Scott, when we'll have standalone IIS express...any idea?

    Support for IIS Express with VS (with a standalone installer) is coming in the next few months. We are finishing up the VS tool integration work for both IIS Express, Razor intellisense, and SQLCE now.

    Thanks,

    Scott

  • @Fatal,

    >>>>>>>> The _viewstart.cshtml sounded like a nice feature but it doesnt seem to work very well with partial pages. Are there any suggestions when using partial pages? (eg: avoid _viewstart.cshtml? or set @ {Layout = null} in the partial page?)

    Can you send me email (scottgu@microsoft.com) about this? I checked with the team and they said they don't use the layout for partial requests - and were curious what scenario you were seeing it happen with.

    Thanks,

    Scott

  • @Eoin Campbell

    >>>>>>> Congrats Scott + Team. Just out of curiosity, whats the most complex package installation you've used NuPack on. The Elmah example seems a little simple for something you have to do once at the Solution Setup Stage. (Not knocking it, just curious ;-)) Will have to make time to play with this at the weekend

    Add-Package NHibernate.Linq pulls in several dependencies. Not sure if that is the most complex scenario, but I think it does do a good job of making the installation of NHibernate with the LINQ helper library much easier.

    Hope this helps,

    Scott

  • @Rob,

    >>>>>>> What happens if I already have the binaries for a package installed, but not as a package. Can I then use NuPack to upgrade? For example, if I already have elmah installed, but pre NuPack and elmah releases a new version via NuPack, can I use NuPack to upgrade the existing assemblies, or do I have to rip out the existing elmah functionality, so that NuPack can take over?

    Good question - to be honest I'm not 100% sure. I think if you already have the reference and do an Add-Package, I think NuPack will honor your existing reference and not overwrite it. Probably the easiest approach is to delete the reference in your project then do an Add-Package on Elmah again - which will cause it to be managed by NuPack.

    Hope this helps,

    Scott

  • @Jim,

    >>>>>>>> If we are currently developing for MVC2 - and using libraries/third-party components (i.e. Telerik) which are MVC2 specific (installs which differentiate libraries for MVC1 and MVC2), would we be able to use MVC3beta seamlessly. In other words, are there any API-level or otherwise breaking changes that would make using MVC2 dependencies potentially fail?

    It should work as the APIs are the same. I haven't tried out these specific components - but in theory it should just work. Send me email if it doesn't as that is likely a bug on our side.

    Thanks,

    Scott

  • @Philip,

    >>>>>>> ^ Looks like someone else did a VS extension first, but MS steps in to steal the light lol.

    The Nu team is actually part of the NuPack team. Bill and Rob have blogged about this:

    http://weblogs.asp.net/bsimser/archive/2010/10/06/unicorns-triple-rainbows-package-management-and-lasers.aspx
    http://devlicio.us/blogs/rob_reynolds/archive/2010/10/06/the-evolution-of-package-management-for-net.aspx

    Hope this helps,

    Scott

  • @Koistya

    >>>>>> Does anyone notice that a website created with ASP.NET MVC 3 Beta 1 runs slowly? (about 1 sec wait time until the page is fully loaded. this wasn't the case with the previous Preview 1 version)

    Hmm - are you sure that isn't a proxy issue with your browser? You shouldn't see that it takes 1 sec to load.

    Thanks,

    Scott

  • @Giovane

    >>>>>> When will release a fix for a bug when we using copy / paste feature?

    I think this patch fixes the issue you are referring to: http://weblogs.asp.net/scottgu/archive/2010/06/27/patch-for-cut-copy-insufficient-memory-issue-with-vs-2010.aspx

    Hope this helps,

    Scott

  • @rickj1

    >>>>>>>>> when I go to the web platform page it's for web platform installer 2.0 I have web platform

    Can you send me an email (scottgu@microsoft.com) about this? I can then have someone help.

    Thanks,

    Scott

  • @aer,

    >>>>>>> I've made a simple hello world project in both asp.net mvc 2 aspx and mvc 3 razor and benchmarked them. it was in release mode on iis 7.5 and I've tested with ab (Apache benchmark), run 50.000 requests with 1000 clients. It seems razor is 2.7 times slower than mvc 2 aspx. I know it's under development and will be optimized but can it be as fast as aspx when released ?

    We haven't fully optimized MVC3 yet (there is usually a lot of cache tuning we do). We expect razor to be the same performance as the .aspx view engine before it is finally released.

    Hope this helps,

    Scott

  • @Chad,

    >>>>>>> I have been working on a website using MVC Preview 1 since it came out. Now that beta is out, I have updated my system to beta.

    Have you read through the release notes that came with the MVC3 Beta? It should cover how to upgrade.

    Send me email (scottgu@microsoft.com) if you are still running into any issues and we can help.

    Thanks,

    Scott

  • @Danny,

    >>>>>>> 1. In the Application_PostAuthenticateRequest() method of my Global.asax.cs file I am referencing Context.User.Identity. This install caused this identity to come back as null every time I hit a page. However, your post above about adding to my root Web.config file fixed the problem. Thanks!

    If you can send me email (scottgu@microsoft.com) I can connect you with someone to help.

    Thanks,

    Scott

  • @SLaks,

    >>>>>> If I add a package reference using NuPack, can I then debug into the package's source code?

    Most of the packages are pure binaries. The source for them is available, but you'd need to download that and add it to your symbols list to debug into it.

    Hope this helps,

    Scott

  • @DalSoft,

    >>>>>>> Does Razor support Display and Editor templates including the related helpers?

    Yes - Razor supports all the standard ASP.NET MVC Helpers including Display and Editor Templates.

    Hope this helps,

    Scott

  • @Yarx,

    >>>>>> I noticed when I created a new MVC3 app, that the jQuery library used is 1.4.1. Any plans to use 1.4.2 for the final version?

    Yes - I believe that will be updated for the final release.

    Thanks,

    Scott

  • @Kenny,

    >>>>>>> Does ASP.NET MVC 3 supports WinXP? I can't seem to install it. Thanks.

    Yes - it should work. Are you using XP SP3? Note that you do need VS 2010 or Visual Web Developer 2010 Express installed to develop with it from the tooling side.

    Hope this helps,

    Scott

  • What about unit testing Razor templates, are the included in this beta? Thanks!

  • Scott,

    Thanks for the fix, work perfectly.

  • Scott, it's HTML5, not HTML 5.

  • Installing MVC3 (I used installer executable and not WPI) on Windows 7 box with Visual Studio 2010, has broken my existing MVC2 solution. For example, my mvc2 application has an action filter filterContext.ActionDescriptor.GetFilters();, when i installed MVC3 it started complaining that this method is obsolete. I have installed MVC3 only for learning / exploring. Is there a ways i can install MVC3 again without it clashing with existing MVC2 solutions?

  • How do you add global namespace imports for razor views? with aspx views namespaces added in the web config via the pages/namespaces setting were available. With MVC 3 preview 1, razor views could see namespaces added programitically using Microsoft.WebPages.Compilation.CodeGeneratorSettings.AddGlobalImport("") -- It appears this method no longer is available.

  • I would really like to see a constructor of the MvcRouteHandler where i can inject my own ControllerBuilder (or a ControllerFactory) and a list of ViewEngines (or something like a ViewEngineProvider).
    This would make the entire framework more flexible, you could add a route which routes to a custom MVCRouteHandler with its own controller factories and view engines. Each MVCRouteHandler would represent a complete mvc application.
    You would be able to create web applications consisting of many diffrent mvc applications.

  • Please encourage the patterns & practices guys to post their projects on NuPack (Enterprise Library 5.0, Unity, Prism, etc) this would be a major help in getting new enterprise projects up and running.

    Also, great announcements!

  • Parser Error
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Expected '>' after generic type argument


    Source Error:


    Line 1: @model IEnumerable<Dictionary>
    Line 2:
    Line 3: @{

  • I just installed a fresh copy of VS2010 Professional. I just downloaded NuPack (NuPack.Tools.vsix) and ran the file. I create a new test website in IIS and opened up the site in VS2010. When I click "Add Package Reference..." I get a red error box: "Exception has been thrown by the target of an invocation." If I click the Installed button on the left, VS02010 crashes. I downloaded the NuPack build for Wed Oct 6 2010. Please advise, thanks.

  • IIS Express required administrator privileges to register host header, different from "localhost".
    With VS development server we use useful feature "localhost.yourdomain.com" — this allow separate cookies (and other browser- and config-specific things) between different sites, same as in product environment.

    May be permit to register headers, resolved to localhost IP's (127.x.x.x or [::1])? Alternative, permit to register headers with "localhost" at any level of domain (f.e. localhost.net, www1.localhost.somedomain.com)?

  • Please encourage the patterns & practices guys to post their projects on NuPack (Enterprise Library 5.0, Unity, Prism, etc) this would be a major help in getting new enterprise projects up and running.

    Also, great announcements!

  • In MVC 3 Beta, is there a difference between the templates MVC 3 Partial Page (Razor) and MVC 3 View Page with Layout (Razor) ?

    I added a partial page (_partialList) to my application. Now when I return only the partial view, it applies the Layout present in _ViewStart.cshtml - acting very much like a stardard view page with layout.

    if (Request.IsAjaxRequest())
    return View("_partialList", someModelData);

    How does a "partial" page distinguish itself from a standard view page with layout ? Will the two behave differently in any particular scenario? Is there really a concept of a "partial" page in razor ?

    return PartialView("_partialList", someModelData) does not apply the layout for neither the View Page or the Partial page.

  • Scott,

    Looks like there is an issue with the MVC3 beta and classic asp. I posted about it here:

    http://forums.asp.net/t/1613021.aspx?MVC3+Beta+Interfering+with+Classic+ASP+Form+Posts

    Is that where I should be providing feedback on the beta or should I be doing that elsewhere?

    Thanks,

    m

  • fanstastic, now we have a open source repository

  • I would also like to know if updating multiple divs in one Ajax request will be available in mvc3 final

  • Oh God! NO! NO! NO! NO!

    This is .NET not Ruby. Repeat after me... .NET is a component based architecture and attempts to promote reuse at a binary level. If we wanted source code reuse we could have stayed with C or C++.

  • Is there any way to force the IValidatableObject Validate() method to be called when some validation annotations have already failed?

    This would be really useful as it would allow all errors to be passed back to the user in one go, rather than the user having to fix some errors, then be told about some more when the Validate() method is called.

    Thanks
    Chris

  • It looks like the MVC Beta is not actually "go-live" ready if you are using Razor, because it has a runtime dependency on the System.Web.Razor.dll from ASP.NET Web Pages, and the Web Pages eula does not allow production deployments.

  • Unless I missed something, which is more than possible, I don't think that the webgrid uses data annotations. I'd love to see the following:

    @grid.GetHtml(
    tableStyle: "grid",
    headerStyle: "head",
    alternatingRowStyle: "alt",
    columns: grid.Columns(
    grid.ColumnFor(m => m.AccountNumber),
    grid.ColumnFor(m => m.CompanyName)
    )
    )

    This would automatically display the DisplayName (or ShortDisplayName) as the column heading. I'd also like to have a ColumnFormat annotation that would be picked up. Just my little wish.

  • I would like to know if updating multiple divs in one Ajax request will be available in mvc3 final

  • I am excited with asp.net mvc. I am using asp.net with flex because flex gives me more power control of UIs. But the disadvantages are obvious too. So I decide to learn asp.net mvc. I wish there would be more open-source pojects of asp.net mvc, especially in vb.net.

  • I am sorry to read that FluentHtml will not included in the default MVC 3 package.

  • Can I use MVC3 Beta plus Visual Web Developer 2010 Express in production? Or wait for the final release of MVC3 ?

  • Speaking of "Dependency Injection", I really dislike the fact that MVC depends on the (horribly named) ASP.Net Web Pages feature.

    Razor is interesting, but I find ASP.NET Web Pages to be horrendously sloppy and encourages terrible programming practices (inline sql, etc). I don't want it *anywhere* near my code and I never, ever want to take a production dependency on it. I find it strange that MVC 3 is so tightly coupled to it, especially considering the fact that MVC is the exact opposite - it enforces clean design practices.

    Can this please be changed before the final release? I strongly dislike how clean, professional MVC projects are now forced to depend on "web pages for beginners". I dumped ASP and the like years ago, and I really don't want to go back! As the memes say: "DO NOT WANT!"

Comments have been disabled for this content.