Announcing the ASP.NET MVC 3 Release Candidate

This morning the ASP.NET team shipped the ASP.NET MVC 3 RC (release candidate). You can download it here.

ASP.NET MVC 3 is a pretty sweet release, and adds a ton of new functionality and refinements.  It is also backwards compatible with ASP.NET MVC V1 and V2 – which makes it easy to upgrade existing apps (read the release notes for the exact steps to do so).  You can learn more about some of the great capabilities in ASP.NET MVC 3 from previous blog posts I’ve done about it:

Today’s ASP.NET MVC 3 RC build includes several additional feature refinements (in addition to bug fixes, tooling improvements, perf tunings, etc).  This blog post covers the improvements specific to today’s release.  Please review my previous posts to learn more about the many, many other ASP.NET MVC 3 features and improvements introduced in prior previews/betas.

Razor Intellisense within Visual Studio

Colorization and intellisense support for Razor-based view templates is now supported within Visual Studio and the free Visual Web Developer Express. 

Intellisense works for HTML, C#, VB, JavaScript and CSS when editing within razor based view templates:

image

You get full C#/VB code intellisense – including against HTML helper methods (all of the existing Html helper methods in ASP.NET MVC also work just fine in Razor based views):

image

We also provide intellisense for Razor keywords and directives:

image

Note below how after setting the @model directive to be a Product, the strongly-typed HTML helpers (and the “Model” property within the template) are now typed correctly to provide intellisense for a “Product” class:

image

We are still doing final performance tuning on the editor (and have several optimizations that just missed today’s build).  If you encounter a scenario where intellisense either doesn’t seem to work or seems slower than it should be – please send us a repro so that we can verify that our latest builds have it fixed.

NuGet Package Manager

I blogged about a new, free, open source package manager last month - which at the time we were calling “NuPack”.  We’ve since renamed NuPack to NuGet. Today’s ASP.NET MVC 3 release automatically installs it as part of the setup.

You can use NuGet to easily download and install both commercial and open source libraries within your projects.  For example, to install NHibernate and a LINQ extension library that someone has built for it, I could type “install-package NHibernate.Linq” within the NuGet package manager console inside Visual Studio:

image

When I press enter NuGet will automatically download all of the libraries (and their dependencies) and setup my ASP.NET MVC 3 project to use them:

image

There are now hundreds of open source .NET libraries within the NuGet package feed, and the list will continue to grow over time. 

We think NuGet will enable all .NET developers (not just ASP.NET MVC ones) to be able to more easily leverage and share functionality across the community, and make building .NET  applications even better. 

Watch Scott Hanselman’s PDC Talk

Scott Hanselman gave the highest-rated talk at PDC this year, which he called “ASP.NET + Packaging + Open Source = Crazy Delicious”.  It is a “no slides” talk that demonstrates how to code an application from start to finish using ASP.NET MVC 3, Razor, NuGet, EF Code First, SQL CE and a bunch of other cool things.

image

You can watch the talk online or download it (by right-clicking and choosing “save as” from one of the links below):

- Low Bandwidth WMV Video (about 258 megs)

- Low Bandwidth MP4 Video (about 120 megs)

I highly recommend watching it – it is both entertaining, and demonstrates how all the pieces of the ASP.NET MVC 3 stack (and especially NuGet) fit together.

Partial Page Output Caching

ASP.NET MVC has supported output caching of full page responses since V1.  With ASP.NET MVC V3 (starting with today’s RC) we are also enabling support for partial page output caching – which allows you to easily output cache regions or fragments of a response as opposed to the entire thing.  This ends up being super useful in a lot of scenarios.

Output caching just a region of a page is really easy to-do.  Simply encapsulate the region you want to output cache within a child action that you invoke from within the view that you are rendering.  For example, below I have a product listing page, and I want to output a “Daily Specials” section on the page as well:

image

Above I’m using the Html.Action() helper method to call the SalesController.DailySpecials() child action method.  Notice that I’m passing a category parameter to it above – which will allow me to customize the “Daily Specials” I display based on what types of products the user is currently browsing (that way if they are browsing “computer” products I can display a list of computer specials, and if they are browsing “baby” products I can display diaper specials).

Below is a simple implementation of the SalesController.DailySpecials() method.  It retrieves an appropriate list of products and then renders back a response using a Razor partial view template:

image

Notice how the DailySpecials method above has an [OutputCache] attribute on it.  This indicates that the partial content rendered by it should be cached (for 3600 seconds/1 hour).  We are also indicating that the cached content should automatically vary based on the category parameter.

If we have 10 categories of products, our DailySpecials method will end up caching 10 different lists of specials – and the appropriate specials list (computers or diapers) will be output depending upon what product category the user is browsing in.  Importantly: no database access or processing logic will happen if the partial content is served out of the output cache – which will reduce the load on our server and speed up the response time.

This new mechanism provides a pretty clean and easy way to add partial-page output caching to your applications.

Unobtrusive JavaScript and Validation

I discussed several of the validation and JavaScript/AJAX improvements coming in ASP.NET MVC 3 with in my blog post about the first ASP.NET V3 preview release.

One of the nice enhancements with ASP.NET MVC V3 is that the AJAX and Validation helpers in ASP.NET MVC now both use an unobtrusive JavaScript approach by default. Unobtrusive JavaScript avoids injecting inline JavaScript into HTML markup, and instead enables cleaner separation of behavior using the new HTML 5 “data-“ convention (which conveniently works on older browsers – including IE6 - 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.

Client Side Validation On By Default

With previous versions of ASP.NET MVC (including last month’s ASP.NET MVC V3 beta) you needed to explicitly call Html.EnableClientValidation() within your views in order to enable client-side validation to take place.  Starting with today’s RC that is no longer required, and client-side validation (using an unobtrusive approach) is now enabled by default (you can turn this off if you want through a config setting in web.config).

You do still need to reference the appropriate jQuery+jQuery Validation libraries within your site for the client-side validation to light-up.  Because you explicitly reference the JavaScript files, you can choose to either host them on your own server or reference them from a CDN (content delivery network) like Microsoft’s or Google’s. 

Remote Validator

An additional validation feature that is new with today’s RC is support for a new [Remote] validation attribute that enables you to take advantage of the jQuery Validation plug-in’s remote validator support.  This enables the client-side validation library to automatically call a custom method you define on the server to perform validation logic that can only be done server-side.  It provides a very clean way to integrate scenarios like this within your client-side validation experience.

Granular Request Validation

ASP.NET MVC has built-in request validation support that helps automatically protect against XSS and HTML injection attacks.  Sometimes, though, you want to explicitly turn off request validation for some scenarios where you want users to be able to post HTML content (for example: blog authoring or CMS content editing). 

You can now add a [SkipRequestValidation] attribute to models or viewmodels that disables request validation on a per-property basis during model binding:

image

Adding the above attribute to your model/viewmodel enables you to set it once and have it apply in all scenarios.

Other Improvements in the RC

Below is a partial list of other nice improvements in today’s RC:

Improved “New Project” Dialog Box:

When you create an ASP.NET MVC 3 Project you are presented with a dialog like below:

image

The above dialog is now extensible, and you can add additional starter templates, view engines, and unit test project frameworks to it.  We’ll be releasing additional starter templates over time (that will show up in the list) to make it even easier to get up and running on new projects.

Scaffolding Improvements

A number of small, but nice, improvements have been made to the default ASP.NET MVC scaffold templates.  The templates now do a better job of identifying ID/Primary Key properties on models, and handle them appropriately (for example: they now create appropriate links for edit/delete/etc).  The Create/Edit scaffolds also now use Html.EditorFor() by default instead of Html.TextBoxFor() – which makes it easier for you to customize/tweak how your models are displayed.

Add-View Dialog Box Improvements

When you use the Add->View dialog box to add a view that is strongly-typed, the Add View dialog box now filters out more non-applicable types and is sorted/organized in a way that makes it easier to find what you are looking for.

Session-less Controller Support

You can now indicate whether you want a Controller class to use session-state – and if so whether you want it to be read/write or readonly. 

Razor Model Dynamic By Default

If you do not specify a @model directive within your Razor views, the “Model” property on the page will now default to dynamic instead of object.  This enables you to perform late-binding against the model type.  Previously you had to add a ‘@model dynamic” to the top of the file to do this.

New Overloads for Html.LabelFor() and Html.LabelForModel()

New method overloads have been added for the LabelFor() and LabelForModel() helper methods that enable you to optionally specify or override the label text.

Download

A direct link to an installer for the ASP.NET MVC 3 RC can be found here.  It works with both VS 2010 and the free Visual Web Developer 2010 Express.

Please make sure to uninstall any previous ASP.NET MVC 3 releases you have installed on your system (as well as any previous ASP.NET Web Pages setups that you might have installed).

Summary

Today’s ASP.NET MVC 3 RC build contains a bunch of goodness that makes web development with ASP.NET MVC better than ever.  If you have questions or suggestions about the release, or find issues/bugs with it, please post them to the ASP.NET MVC forum on www.asp.net.  The ASP.NET MVC team monitors this forum closely and will be able to help.

We plan on spending the next few weeks monitoring feedback, tuning performance, and fixing the final set of bugs.  Thanks in advance for any issues you send our way!

Hope this helps,

Scott

P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

Published Tuesday, November 9, 2010 7:53 AM by ScottGu
Filed under: , , ,

Comments

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:05 AM by Michael Pereira

The current link to download ASP.NET MVC 3 RC isn't working :/

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:07 AM by Charles Ouellet

Hi,

We have a file Helpers.cshtml in App_Code, it worked well in beta, but in the new RC it creates an error:

The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

Is there a new way to create global razor helpers?

Thanks,

Charles

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:11 AM by Marc Chouteau

Vous avez fait un boulot enorme, bravo ! cette version est très prometteuse

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:11 AM by Christian Sparre

Very nice, looking forward to trying it out. These are very interesting times for .NET developers... ;)

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:12 AM by Gregor Suttie

The url to download here - doesnt work Scott.

Cheers

Gregor

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:13 AM by tps

Thank the lord and your team.  Intellisence for Razor is here.  Great work guys.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:14 AM by J.-Luc

When the final release date ?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:15 AM by ScottGu

@Michael,

The download might still be propagating to the server you hit. Try again in a few minutes and it should work. If you continue to have problems send me email (scottgu@microsoft.com)

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:33 AM by Antoine

out of the subject :

using the rss feed on google home page for reading your lastest posts,

but the widget remains stuck on this post and older ones :

Update on ASP.NET Vulnerability .... ??????

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:40 AM by Marius Schulz

This release of ASP.NET MVC tremendously improved the web application development experience. Thanks for inventing Razor and all of the other stuff!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:55 AM by stefac

hy Scott, great work as usual, but please, leave me a cuoriosity, what is  doing the setup procedure of asp.net mvc3... it take a lot of time, seem   i'm installing office or reinstalling visual studio.

Best regards and thank you again.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 11:55 AM by James Foster

Does ASP.NET MVC 3 RC come with a go-live license?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:12 PM by James

Hi Scott,

I just installed the RC, but I'm not getting intellisense in Razor views -- even in a newly created MVC3 project.  

Is there some additional config that needs to be done when upgrading from the Beta?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:19 PM by James

Nevermind, I was able to get intellisense working after going to tools > options > text editor > all languages and turning on statement completion options (for some reason they were off previously for me).

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:21 PM by Laurent Kempé

Congrats to the team !

ASP.NET MVC is really cool.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:25 PM by ScottGu

@Gregor,

>>>>>> The url to download here - doesnt work Scott.

Can you try again to see if it is working now?  I think the replication to some of the remote servers might have been delayed - it should work now.  If you still see the issue make sure you do a deep refresh of the page (Ctrl+F5 on IE) as the link might be cached in your browser.  And let me know if you still have problems with it.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:26 PM by ScottGu

@J.-Luc

>>>>>>> When the final release date ?

We haven't announced one just yet - waiting to see feedback on today's RC first :)  It isn't too far off though.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:27 PM by ScottGu

@stefac,

>>>>>>> hy Scott, great work as usual, but please, leave me a cuoriosity, what is  doing the setup procedure of asp.net mvc3... it take a lot of time, seem   i'm installing office or reinstalling visual studio.

Most of the time is spent installing the VS tools update.  That requires applying a VS patch - which takes awhile (because of how patching works).  Sorry about that!

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:28 PM by ScottGu

@James Foster,

>>>>>>> Does ASP.NET MVC 3 RC come with a go-live license?

Yes - the ASP.NET MVC 3 RC does support a go-live license.  You can start using it in production now.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:29 PM by ScottGu

@James,

>>>>>>> Nevermind, I was able to get intellisense working after going to tools > options > text editor > all languages and turning on statement completion options (for some reason they were off previously for me).

If you have Resharper installed (or a tool like it) that by default turns off the built-in VS intellisense (since it replaces it with its own).  That might have been why it was off for you initially.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:57 PM by guest

Session-less Controller, is there any explanation when and why we need it?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 12:59 PM by itai

How to use the @section feature?

I have this in my layout page:

@RenderSection("CSSPageExt", required: false)

..and this in my view page:

@section CCSPageExt {

  <link href="/Css/ ...

}

But I get an Exception:

"The following sections have been defined but have not been rendered for the layout page"

Furthermore, the editor highlights in green that <link .. can’t be nested …

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 1:05 PM by James

Ok, so did something in the Razor syntax parser change?  My app is breaking left and right after upgrading from MVC3 beta  - it's throwing Razor parser errors all over the place on stuff that worked fine before my upgrade.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 1:21 PM by Diego

@Charles Ouellet

I'm having the same problem, I'm getting an error saying that WebData doesn't exist in the WebMatrix namespace. This happens in an autogenerated file called App_Code.eo5s4zel.0.cs with a namespace called Helpers. Modifying this file didn't have any effect, as it autogenerates itself again.

Help?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 1:39 PM by mikesdotnetting

Will Razor Intellisense make it into WebMatrix?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 1:46 PM by random guy

I'm having some namespace issues as well (can't resolve System.Web.Helpers). I created a new mvc3 razor project and fired it up, and I'm getting compilation errors. Not sure if it's an issue with the release, or just a problem with the razor project template, but here it is....

Compilation Error

Compiler Error Message: CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

Source Error:

Line 19:     using System.Web.Helpers;

Source File: c:\Users\...\AppData\Local\Temp\Temporary ASP.NET Files\root\f5a3720d\b876c97f\App_Web_index.cshtml.a8d08dba.ejoz9vea.0.cs    Line: 19

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 2:00 PM by Igorbek

Thanks a lot for Razor!

I write you about two bugs in Razor that I've found.

I tested these bugs in this RC version, and they're not fixed yet.

1. I can't write any inline-templates in _ViewStart, cause

WriteLitralTo is not defined in ViewStartPage class

2. Translator inserts unnecessary whitespace writes

For ex:

_ViewStart.cshtml

@{

Func<int, HelperResult> intFormatter = @<text>- @item -</text>;

}

That code translates to:

public class _ViewStart_cshtml : System.Web.Mvc.ViewStartPage {

...

public override void Execute() {

Func<int, HelperResult> intFormatter =item => new

System.Web.WebPages.HelperResult(__razor_template_writer => {

 WriteLiteralTo(@__razor_template_writer, " ");

 WriteLiteralTo(@__razor_template_writer, "- ");

                WriteTo(@__razor_template_writer, item);

 WriteLiteralTo(@__razor_template_writer, " -");

         }

     }

 }

So:

(1)

CS0103: The name 'WriteLiteralTo' does not exist in the current context

WriteLiteralTo is defined in System.Web.WebPages.WebPageBase, but

StartPage does not inherited from it.

(2)

Why these unnecessary WriteLiteralTo calls (" ")? - there is no in my

code. And these unnecessery calls occurs all the time even in other

views! Why? I don't need them!

If I change the code, by replacing single space by other spaces (for

ex, three tabs) between = and @:

Func<int, HelperResult> intFormatter =                  @<text>- @item -</text>;

translator generates:

WriteLiteralTo(@__razor_template_writer, "\t\t\t");

WriteLiteralTo(@__razor_template_writer, "- ");

...

so, it generates writes for whitespaces BEFORE @, from code context!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 2:35 PM by Diego

I fixed my issues by explicitly referencing the Webmatrix.Webdata.dll and Webmatrix.Data.dll files in C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies and setting Webdata.dll to CopyLocal=true

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 2:35 PM by camus

those who have namespace issues should seek the webpages beta3 framework available here :

www.microsoft.com/.../details.aspx

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 2:46 PM by Nicolas

Any indication of a release date?

And something not (too) related, are we going to see an intellisense file (.vsdoc) for jQuery v1.4.3? (the last one was for v1.4.1 back in Jan 2010)

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 2:53 PM by John Downey

Christian, I am having the same issue though a co-worker who installed the RC isn't. The only different we could find between our machines is I installed the Async CTP and Azure tools.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:22 PM by cyost

Thanks for this.  I love the new labelfor(), however, there are some cases were we put a label just for accessibility.  In those cases, we don't want it shown to the sighted, just read by a reader, so we have a css class to hide it (basically move it off the screen, but the reader can't see it).

The problem is in the new labelfor() methods, there isn't an override to specify htmlAttributes like there are on others.  I would like to see that.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:37 PM by ScottGu

@Guest,

>>>>>> Session-less Controller, is there any explanation when and why we need it?

The release notes cover this more (you can download them from the download link above).  Session state is designed so that only one request from a particular user/session occurs at a time.  So if you have a page that has multiple AJAX callbacks happening at once they will be processed in serial fashion on the server.  Going session-less means that they would execute in parallel.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:40 PM by ScottGu

@itai,

>>>>>>> How to use the @section feature?

>>>>>>> I have this in my layout page: @RenderSection("CSSPageExt", required: false)

>>>>>>> ..and this in my view page:

>>>>>>> @section CCSPageExt {

>>>>>>>    <link href="/Css/ ...

>>>>>>>

>>>>>>> }

>>>>>>> But I get an Exception:

>>>>>>> "The following sections have been defined but have not been rendered for the layout page"

>>>>>>> Furthermore, the editor highlights in green that <link .. can’t be nested …

You have a typo in your code - the name of the section in the master doesn't match the name of the one in your page - CSSPageExt vs. CCSPageExt (note the first three characters are different).

The green warning squigglie is expected in this case because you are using an element (<link>) that is only valid under the <head> and the editor doesn't know where it will be rendered, so we assume it's in the <body> tag. You can ignore this error though - it will not cause a problem at runtime.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:41 PM by ScottGu

@James,

>>>>>> Ok, so did something in the Razor syntax parser change?  My app is breaking left and right after upgrading from MVC3 beta  - it's throwing Razor parser errors all over the place on stuff that worked fine before my upgrade.

Did you customize your web.config file at all?  Alternatively, are you sure you've uninstalled the old version of ASP.NET Web Pages (it was a separate install with the beta) prior to installing the MVC 3 RC?

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:42 PM by ScottGu

@mikesdotnetting

>>>>>> Will Razor Intellisense make it into WebMatrix?

Eventually yes - but not for V1.  With V1 of WebMatrix we'll support C#/VB colorization but not intellisense.

Sorry!

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:43 PM by ScottGu

@Diego, @Charles Ouellet

>>>>>>> I'm having the same problem, I'm getting an error saying that WebData doesn't exist in the WebMatrix namespace. This happens in an autogenerated file called App_Code.eo5s4zel.0.cs with a namespace called Helpers. Modifying this file didn't have any effect, as it autogenerates itself again.

If you can send me email (scottgu@microsoft.com) I can connect you with someone on the team to help.  I just saw a thread where they said there was a known issue in today's build with this, and that they might be able to suggest a workaround.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:45 PM by ScottGu

@Antoine,

>>>>>>>  using the rss feed on google home page for reading your lastest posts, but the widget remains stuck on this post and older ones :

Sorry about that - I'm not sure why that happened.  I'll try and follow-up - but am not sure I can fix it on my side.  Google Reader does seem to be handling my posts fine - so it has something to do with the Google home-page.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 3:54 PM by pbz

Is there a way to programmatically invalidate the cache? There are cases where it would make sense to keep something in cache until, for example, an admin changes something. If we could assign a cache key of some kind and then be able to refresh / invalidate that cache key it would cover a lot of scenarios.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 4:02 PM by mstyura

@Christian Sparre, @John Downey I have the same problem with "Unable to evaluate the expression." I had installed Async CTP. This problem mentioned in Release Notes, but I read about it after installing mvc3rc. Anybody known how to fix it?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 4:25 PM by Alex

Can you post info on the WebMatrix namespace issue?  This seems to be happening on every computer I have installed MVC 3 on with projects that already existed (new projects work fine).

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 4:37 PM by Scott927

Great release! Now I can finally use Razor in my project. Been waiting a while for this. One thing I noticed though, is that there doesn't appear to be any design time checking or error highlighting on the view model. For example:

View.Title = Model.SomeProperty;

If my model doesn't contain a member called SomeProperty, the IDE doesn't tell me that until it throws a runtime error.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 4:54 PM by Craig

This is cool, although like others I have no intellisense :-(

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 5:05 PM by Eric

Will the validation by localized out of the box ? That would be very nice !

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 5:34 PM by Eric Hexter

Congrats.. looking forward to this release. big props to the team !

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 5:42 PM by Craig

I worked out my intellisense problem. I had set HTML as the default editor for cshtml files. I had to Open With... and select Razor as the default editor.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 5:49 PM by peaboy

I'm not seeing any difference with the primary\foreign keys. Can you explain that better?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 5:59 PM by PK

Awesome news Guru-Gu and the ASP.NET team :)

Not wanting to hijack this thread - but is the a *very rough* timeframe for VS2010 SP1? Will the new SqlServer CE 4.0 come in SP1?

thanks mate!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 6:10 PM by peter

Since mvc3 has a "go-live" license, can it be bin deployed to a shared hosting production environment with razor views? Which assemblies must be copied? Thanks in advance.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 6:23 PM by Gregor Suttie

Started working seconds after I posted it wasnt working - sorry.

Woop Woop MVC 3 is here though! - I love MVC

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 6:27 PM by Damian Edwards

@Scott927, the Model property is Dynamic by default, so the editor won't provide IntelliSense or validate the properties. It will be a runtime check instead. If you hover your mouse over the Model property you should see a Quick Info tooltip telling you it's a dynamic expression.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:13 PM by ScottGu

@random guy,

>>>>>>> I'm having some namespace issues as well (can't resolve System.Web.Helpers). I created a new mvc3 razor project and fired it up, and I'm getting compilation errors. Not sure if it's an issue with the release, or just a problem with the razor project template, but here it is....

You shouldn't be seeing this.  Did you have an earlier version of ASP.NET MVC 3 or WebMatrix installed on the machine?  If so, did you remove it before installing the ASP.NET MVC 3 RC?

Also - did you have the Async.NET CTP installed?  I just learned that there is an issue with that and the ASP.NET MVC 3 RC on the same machine.  You should uninstall that before installing ASP.NET MVC 3 RC to avoid problems.  If you already installed both, you should uninstall both - and do so in the reverse order in which you installed them.  This will get you back to a clean state.  You can then choose which of the two you want to install and install that one again.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:15 PM by ScottGu

@Igorbek,

Can you try posting this question in the MVC forum on http://forums.asp.net - that way someone from the team can connect directly and help answer.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:18 PM by MartinF

Is there a list of all available Attributes in MVC and a short description of their use ?

If not I think it would make it easier to get a good overview of the options available if there was one.

Maybe group them into Categories like Model and Controller etc.

Martin

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:18 PM by ScottGu

@Nicolas,

>>>>>>> Any indication of a release date?

Pretty soon now - the final release is probably a few weeks away.

>>>>>>> And something not (too) related, are we going to see an intellisense file (.vsdoc) for jQuery v1.4.3? (the last one was for v1.4.1 back in Jan 2010)

Yes - I need to follow-up on this.  I asked about this a few weeks ago but don't know the latest status.  I will chase it up.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:19 PM by ScottGu

@John Downey,

>>>>>>> Christian, I am having the same issue though a co-worker who installed the RC isn't. The only different we could find between our machines is I installed the Async CTP and Azure tools.

I just learned that there is an issue with having both the Async.NET CTP and ASP.NET MVC 3 RC on the same machine.  If you already installed both, you should uninstall both - and do so in the reverse order in which you installed them (meaning if you install Async before MVC, you should uninstall MVC first and then Async).  This will get you back to a clean state.  You can then choose which of the two you want to install and install that one again.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:21 PM by ScottGu

@pbz,

>>>>>> Is there a way to programmatically invalidate the cache? There are cases where it would make sense to keep something in cache until, for example, an admin changes something. If we could assign a cache key of some kind and then be able to refresh / invalidate that cache key it would cover a lot of scenarios.

There is - although I need to double check the exact cache key semantics we use to figure out how.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:21 PM by ScottGu

@mstyura

>>>>>>>>>> @Christian Sparre, @John Downey I have the same problem with "Unable to evaluate the expression." I had installed Async CTP. This problem mentioned in Release Notes, but I read about it after installing mvc3rc. Anybody known how to fix it?

I just learned that there is an issue with having both the Async.NET CTP and ASP.NET MVC 3 RC on the same machine.  If you already installed both, you should uninstall both - and do so in the reverse order in which you installed them (meaning if you install Async before MVC, you should uninstall MVC first and then Async).  This will get you back to a clean state.  You can then choose which of the two you want to install and install that one again.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:34 PM by Piers Lawson

Will there be a new MVC Futures DLL with MVC 3... perhaps with some more REST goodness?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:58 PM by Daniel Liuzzi

Did the default authentication mode change by any chance? On MVC 3 beta, I was able to comment out the whole authentication section in my web.config, and it would default to FormsAuthentication and loginUrl of "/Account/Login". On RC, it seems the default mode is now WindowsAuthentication, and if I change it to FormsAuthentication but don't specify a loginUrl, it defaults to "/login.aspx", which is kind of odd...

Other than this, the Intellisense support for Razor is a pleasure to use, I couldn't be happier with this release. Big props for you guys. Keep up the great work, MVC is coming along wonderfully!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 7:59 PM by Daniel Liuzzi

Did the default authentication mode change by any chance? On MVC 3 beta, I was able to comment out the whole authentication section in my web.config, and it would default to FormsAuthentication and loginUrl of "/Account/Login". On RC, it seems the default mode is now WindowsAuthentication, and if I change it to FormsAuthentication but don't specify a loginUrl, it defaults to "/login.aspx", which is kind of odd...

Other than this, the Intellisense support for Razor is a pleasure to use, I couldn't be happier with this release. Big props for you guys. Keep up the great work, MVC is coming along wonderfully!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 8:54 PM by Wayne Ye

Traditional ASP.NET developer piao guo, going to learn ASP.NET MVC in future if my business requires it:)

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 9, 2010 9:01 PM by Hakeem Mohammad

Installation fails repeatedly on Win 7 64-bit. I dont even have the Asnyc.NET CTP installed

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 12:40 AM by ScottGu

@Alex,

>>>>>> Can you post info on the WebMatrix namespace issue?  This seems to be happening on every computer I have installed MVC 3 on with projects that already existed (new projects work fine).

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

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 12:47 AM by ScottGu

@Scott927,

>>>>>>>> Great release! Now I can finally use Razor in my project. Been waiting a while for this. One thing I noticed though, is that there doesn't appear to be any design time checking or error highlighting on the view model. For example: View.Title = Model.SomeProperty; If my model doesn't contain a member called SomeProperty, the IDE doesn't tell me that until it throws a runtime error.

The "View" property within Razor is a dynamic property that maps to the ViewData collection, which is why you aren't getting intellisense or compile-time checking (it is late-bound).

The "Model" property within Razor is typically strongly-typed - which gives you compile-time checking and intellisense.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 12:56 AM by John S

Seriously MS needs to slow down the release cycles just a tad.

As soon as MVC3 is released (March 2011?) it will only be out in the wild for a year then there's a newer version to contest with in 2012. Why don't you have longer release cycles? With a longer release cycle maybe you can fit more features into each release rather than creating smaller and more frequent releases.

Just like the iPhone, buy a new one today then it will be out of date come this time next year.

How can anyone ever keep up!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:10 AM by Erx

Just curious, will we be able to return several views in one go in mvc3's next release?

Mainly to solve the problems introduced by having to update several different areas of a web page, there are currently two solutions, 1): que the requests, and the user sees this queuing in action and the waiting incurred, 2): using really nasty JavaScript to split the response and place them under.different divs. This goes against everything mvc and web programming stands for.

I hope it's solved for mvc3 - if several view returns (in one request)  are supported I think so many other innovative use-cases would come out of this as well as solving the above problem  :).

Thanks. Also, what do other readers think?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:14 AM by shiju

Big thanks to the ASP.NET MVC team

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:27 AM by ScottGu

@Craig,

>>>>>> This is cool, although like others I have no intellisense :-(

Can you go into tools > options > text editor > all languages and make sure intellisense is turned on.  It could be that you have installed a utility like Resharper that might have disabled it.  Send me email (scottgu@microsoft.com) if that doesn't work and we can help further.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:34 AM by ScottGu

@Eric,

>>>>>>> Will the validation by localized out of the box ? That would be very nice !

Yes - the nice thing about the validation architecture is that you can fully localize error messages and they'll work both on the server and with the client-side validation architecture.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:39 AM by ScottGu

@peaboy,

>>>>>> I'm not seeing any difference with the primary\foreign keys. Can you explain that better?

When you use the Add->View dialog now we are a little smarter about detecting primary keys.  For example, with lists we now link to details/edit/delete actions with them, and with edit/create we are smarter about the editing fields.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:45 AM by ScottGu

@PK,

>>>>>> Not wanting to hijack this thread - but is the a *very rough* timeframe for VS2010 SP1? Will the new SqlServer CE 4.0 come in SP1?

ASP.NET MVC 3 will actually ship before VS 2010 SP1.  VS 2010 SP1 will include tooling support for SQL CE and IIS Express though.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:59 AM by ScottGu

@Peter,

>>>>>> Since mvc3 has a "go-live" license, can it be bin deployed to a shared hosting production environment with razor views? Which assemblies must be copied? Thanks in advance.

Yes - I believe that is fully supported.  I think you just need to copy-local the references in your project.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 2:05 AM by Razzie

So is the Html.Action the same as the Html.RenderAction from the MvcFutures lib? Or are there differences? Partial OutputCache was already possible using Html.RenderAction, however, I'd be more excited about a way to use out-of-the-box 'donut hole' caching as described by Phil Haack. In other words, cache a whole page except for a small part. Is there a chacne we'll see this in MVC 3?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 2:08 AM by ScottGu

@Deepak Chawla,

The release notes include pretty detailed upgrade instructions to go from V2 to V3.  Definitely check those out.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 2:12 AM by ScottGu

@Piers,

>>>>>>> Will there be a new MVC Futures DLL with MVC 3... perhaps with some more REST goodness?

Yes - we'll have a MVC Futures DLL as as well with lots of goodies in it.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 2:14 AM by ScottGu

@Daniel,

>>>>>>> Did the default authentication mode change by any chance? On MVC 3 beta, I was able to comment out the whole authentication section in my web.config, and it would default to FormsAuthentication and loginUrl of "/Account/Login". On RC, it seems the default mode is now WindowsAuthentication, and if I change it to FormsAuthentication but don't specify a loginUrl, it defaults to "/login.aspx", which is kind of odd... Other than this, the Intellisense support for Razor is a pleasure to use, I couldn't be happier with this release. Big props for you guys. Keep up the great work, MVC is coming along wonderfully!

Sorry about that.  With the beta we inadvertently picked up the WebMatrix authentication library.  This has since been backed out of the RC.  You should keep the authentication section in web.config to control the login URL now.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 2:20 AM by ScottGu

@Hakeem Mohammad,

>>>>>>> Installation fails repeatedly on Win 7 64-bit. I dont even have the Asnyc.NET CTP installed

If you can send me email (scottgu@microsoft.com) we can have someone investigate to figure out what is going wrong.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:08 AM by Erx

(continued from my first post...)... Just to be clear, the problem I described is an issue when making ajax requests from client and wanting to update several different areas/divs of a web page, say, one div on the top of the page and one on the bottom. You could of course return it in one update and return the two areas and everything in between, but this would just defeat the purpose of Ajax and having partials - I just wanted to clarify the problem I was describing better, I hope I have, thanks.

Will this be happening for mvc3 at some stage?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:19 AM by qwos

one problem is performance is bad in mvc 3 razor RC,half the mvc 2 aspx

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:37 AM by Otyce

Hi Scott,

with the new feed for nuget packages it is no longer possible to download packages onto my machine. when are you going to enable this again.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:54 AM by Paco

Hello!

Scott, how to implement scenario when on one page I have several "models".

For example:

realty object

table with several sellers of this object

& table for each seller with phones of seller.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:57 AM by Deepak Chawla

Simple question) Does this work in Visual Studio 2008 professional?

The release note mention need .NET4 and VS 2010.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 4:05 AM by Igorbek

@ScottGu,

>>>>> Can you try posting this question in the MVC forum on http://forums.asp.net - that way someone from the team can connect directly and help answer.

I have already posted this issues at the forum: http://forums.asp.net/t/1618460.aspx?2+bugs+in+Razor+view+engine

But no one from the MVC team answered.

I also wrote to Andrew Nurse, and he said that first issue will be fixed to RTM, but the second will not. It may be fixed to Razor v2!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 4:25 AM by Edmund

Hi,

When can we expect a MVC Futures 3.0? Can I use the MVC Futures 2.0 RTM meanwhile?

Thanks,

Edmund

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 5:02 AM by Chris

Hi Scott,

I've come across one minor problem:

When adding a strongly-typed view with a nested class as the view data class, the @model directive is incorrectly generated. A '+' is inserted before the nested part of the class name, where it should be a '.'

Thanks

Chris

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 5:15 AM by Stefan

Hi Scott,

I notice the IDependencyResolver interface does not have a Release implementation that is required, how are the default factories going to release controllers from the container, or is it upto me to implement a new factory and do this myself again?

Thanks

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 5:34 AM by AndreVianna

Since I've installed new MVC 3 and NuGet I'm not being able to install any package.

I'm receiving the following message:

PM> Install-Package SQLCE.EntityFramework

Install-Package : Object reference not set to an instance of an object.

At line:1 char:16

+ Install-Package <<<<  SQLCE.EntityFramework

   + CategoryInfo          : NotSpecified: (:) [Install-Package], NullReferenceException

   + FullyQualifiedErrorId : NuGet.VisualStudio.Cmdlets.InstallPackageCmdlet

What is happening???

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 5:54 AM by Anthony Capone

After working without intellisense for a couple months, I could not be happier with the improvements this RC offers.  Unfortunately, I have also encountered the issue previously posted by "Random Guy".

Compiler Error Message: CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I followed the steps in the release notes and thus believe all system references are correctly added to the project.  Going through the standard troubleshooting steps, I uninstalled all previous versions of both MVC and MVC VS Tools.  Then reinstalled MVC 3 RC.  This to no avail, produced the same compilation error as before.

Any help is greatly appreciated.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 5:57 AM by Jack

Hi,

So glad the razor intellisense works. This was a showstopper for us. Razor is so much nicer than aspx.

I've got a question/feature request about @section and @RenderSection though. With an asp:ContentPlaceHolder it was possible to provide default content in the masterpage which could be overridden in a viewpage. This doesn't seem to work with @RenderSection. A @section with the same name in the masterpage is simple ignored. I couldn't think of any other way to try. Is this already possible or will it be in the RTM?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 6:27 AM by Henrique

GREAT!!! Love Razor...

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 6:38 AM by ScottLG

I only have Visual Web Developer 2010 Express. Does it support Razor ? Since there is no viewengine option on the addview dialog. If yes, could anyone point me to how to use it ? Really appreciate.

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 7:19 AM by Jacob

Wish you guys would put the same amount of energy into improving WebForms :)

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 7:54 AM by Allan Ferreira

Scott,

After I installed MVC 3.0 RC the async bits stopped working. I have those bits installed before I installed MVC 3.0 RC. I tried to reinstall them but it didn't work. Do you have any idea of what is going on? Could you give me some directions?

Thanks

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 8:04 AM by Asbjørn

How about SQL CE 4.0? Has that been updated or are we still at CTP1? SQL CE4 looks promising, but the lack of tooling makes it difficult to use - and the lack of information on updates makes it difficult to plan.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 8:19 AM by Johann

Scott,

I'm confused about how to "share" declarative helpers in MVC 3 RC. What I thought we would be able to do is create a cshtml file somewhere with a declarative helper that can be accessed by all views. I tried putting them in /Views/Shared but that doesn't work.   Or maybe I'm missing something in the cshtml file itself (the one that contains the helper to be shared)?

Can you clarify?  

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 9:45 AM by gligoran

I have Windows 7 64bit as well and the installation seems to be stuck at the start.

The upper status bar is full and says:

(above) File security verification:

(below) All files were verified successfully.

The lower status bar is at 0% and says:

(above) Installation progress:

(below) Installing VS10-KB2385361-x86

It's been working for over an hour now and moved nowhere.

Also the x86 bothers me a bit. Is there a x64 version?

I had MVC3 Beta before this and MVC3 Preview 1 before that.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 9:58 AM by Scott927

>>>>>>>> Great release! Now I can finally use Razor in my project. Been waiting a while for this. One thing I noticed though, is that there doesn't appear to be any design time checking or error highlighting on the view model. For example: View.Title = Model.SomeProperty; If my model doesn't contain a member called SomeProperty, the IDE doesn't tell me that until it throws a runtime error.

>>>>The "View" property within Razor is a dynamic property that maps to the ViewData collection, which is why you aren't getting intellisense or compile-time checking (it is late-bound).

>>>>The "Model" property within Razor is typically strongly-typed - which gives you compile-time checking and intellisense.

Hey Scott,

Sorry if I wasn't clear. I was simply assigning a value from the Model to the dynamic View property as an example. The problem I'm describing is isolated solely to the strongly-typed Model object. For example, using the following in my .cshtml file:

<div>@Model.Community.FormattedAddress</div>

Doesn't indicate any type of error at all, even though FormattedAddress is not a property of the Community object. Of course, it throws an error at runtime:

Compiler Error Message: CS1061: 'Data.Community' does not contain a definition for 'FormattedAddress' and no extension method 'FormattedAddress' accepting a first argument of type 'Data.Community' could be found (are you missing a using directive or an assembly reference?)

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 10:01 AM by Koistya `Navin

Is it possible to implement the following overload for Html.Action method:

@Html.Action(x => x.DailySpecials(Model.CategoryID))

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 10:04 AM by gligoran

Hmm, funny thing...

As I said earlier I started the installation, but it still wasn't going nowhere after more than an hour.

I got tired of waiting so I clicked cancel at which point the installation actually started progressing.

After about 10 minutes MVC3 RC was installed.

This is a bit weird but at least it's installed.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 10:33 AM by Mr Munchkin

I can't seem to see it anywhere and I Imagen that there must be a syntax element for it... Non-renderable Razor comments? I'm at a loss as I tend to write a lot of comments both in code and otherwise whilst im writing pages.

Could you help please scott - probably a tad easy to answer for someone that knows...

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 10:35 AM by Dennis S.

Congratulations on the Release Candidate phase!

I would like to start converting my new applications into the Razor view engine and would like to ask if you guys are planning on improving the Razor performance. Me and I am sure the rest of the community were expecting some significant performance boost in the RC version, should we expect Razor to perform as well as aspx in the final release?

Thanks!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 11:43 AM by Mark Leistner

Scott -- Any chance there is a problem with the Html.EndForm() method in this release?

I can't get it to work for the life of me.  I get the following error anytime I add it to any page, even on a brand new project.

CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments

Same error with Razor and the previous view engine.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 11:51 AM by pwills

Hi Scott,

Looks like the RC still doesn't patch Visual Studio to include .cshtml and .vbhtml files in the Publish service. (Note that this happens both in the Web Deploy / MSDeploy scenario as well as with a local File System publish.)

I also didn't see a reference to this issue in the MVC3 RC release notes.

Is publish support on the roadmap for RTW?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 12:18 PM by Chad Moran

Hey Scott, any chance we'll see a return of support for post-cache substitution?  Allowing both partial output caching and post-cache substitution would offer great flexibility in complex caching situations.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 12:45 PM by Allan Ferreira

Quoting myself:

"Scott,

After I installed MVC 3.0 RC the async bits stopped working. I have those bits installed before I installed MVC 3.0 RC. I tried to reinstall them but it didn't work. Do you have any idea of what is going on? Could you give me some directions?"

I found the answer for that in the release notes doc. The question would be then: the final (or upcoming) version of MVC 3.0 will be compatible with async bits?

Thanks

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:08 PM by Chad McCallum

I'm also having the "system.web.helpers" issue after installing the RC.  I did have the preview 1 previously installed, and installed overtop of it, which is probably causing the issue.  Since then I've uninstalled both and then reinstalled the RC, but that hasn't solved the issue.

PS> Congrats Scott!  Dedication == posting while on parental leave :)

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:16 PM by DamianEdwards

@pwills

Publishing should work correctly with .cshtml and .vbhtml files. Can you pls send me the details of the problem you're having at dedward@microsoft.com so we can look into it for you.

Thanks.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 1:34 PM by ScottLG

Razor works in Visual Web Developer 2010 Express, but only in new-created MVC 3 projects. Looks great !

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 2:55 PM by Chuck Kraatz

Says fileis corrupt? will not extract

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 2:59 PM by ChuckKraatz

Getting an extract error on the exe

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:17 PM by Haa

It appears that any additional (custom) assemblies - such as adding your own view helpers as extension methods in a dll - that are referenced in the main web.config file have to also be referenced in the web.config file for the views.  I don't think this is correct as it seems to be opposed to the DRY principle.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:33 PM by JoeReynolds

The following appears to be broke in MVC 3. Posts that worked ok in MVC 2 now produce the "dangerous" message error:

<httpRuntime requestValidationMode="2.0" />

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 3:51 PM by Jon Jenkins

Exciting. My next hobby project is going in this bad boy, and I'll try Razor to boot. Thanks!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 5:43 PM by Stacey

I want to make statues for every member of the MVC team for the JSON binding built into MVC 3.0. Seriously. If I could send medals over the internet, I would.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 9:08 PM by freehand

@ChuckKraatz

If your having coruption errors it might be the IE9 beta. I tried with a different browser and the download worked fine after that.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 10, 2010 11:16 PM by Jookyboi

Hi Scott,

I'm running into an issue with the ReCaptcha web-helper after upgrading to MVC3 RC from Preview.

The error is:

Attempt by method 'Microsoft.Web.Helpers.ReCaptcha.GetHtmlWithOptions(System.String, System.Object)' to access method 'System.Web.WebPages.WebPageContext.get_HttpContext()' failed.

Any thoughts?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 1:23 AM by Anthony Capone

@Random Guy

Verify that these two lines exist in your web.config assemblies section.

       <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

       <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 4:04 AM by shirlyleibo

Thanks for the info, great article.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 5:48 AM by Lenne23

Hi Scott! I'm always getting an "Unable to evaluate expression." error in debug mode after installing the MVC 3 RC.

Some others are having the same problem:

connect.microsoft.com/.../cannot-evaluate-immediate-expressions-using-vs2010-professional-under-framework-3-5

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 7:34 AM by Saulius

Yes indeed. I also have an issue with "using System.Web.Helpers;" in some temp file App_Web_index.cshtml. Refference is missing and there is no library left but something still points to it. I uninstalled all previous versions of MVC, never had Async CTP and no line with "add assembly="System.Web.Helpers". Any solutions? Thanks.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 8:54 AM by Mark

Awesome stuff. Any update on reusable declarative helpers? - Same question as Johann >>>

Scott,

I'm confused about how to "share" declarative helpers in MVC 3 RC. What I thought we would be able to do is create a cshtml file somewhere with a declarative helper that can be accessed by all views. I tried putting them in /Views/Shared but that doesn't work.   Or maybe I'm missing something in the cshtml file itself (the one that contains the helper to be shared)?

Can you clarify?  

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 12:42 PM by Joe White

[SkipRequestValidation] is an awful name -- there are so many different kinds of request validation, and that name doesn't specify which one it means. Why didn't you name it for what it does -- something like [AllowHtmlContent]?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 12:56 PM by krish

Nice article on MVC 3 i got many questions answered by reading this article. Thanks.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 1:57 PM by stevenk

After upgrading from the ASP.net MVC 3 Beta, I'm getting the following error on publishing to our dev server:

[MissingMethodException: Method not found: 'System.Nullable`1<Boolean> Microsoft.Web.Infrastructure.DynamicValidationHelper.ValidationUtility.IsValidationEnabled(System.Web.HttpContext)'.]

  System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +0

  System.Web.Mvc.<>c__DisplayClass6.<BeginProcessRequest>b__2() +71

  System.Web.Mvc.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() +19

  System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 func) +161

  System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +389

  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371

Any ideas?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 3:03 PM by csjthomas

Congrats Scott! I'll try out later. Cheers!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 6:25 PM by Ben

Love the new declarative helpers. Will we be able to use generic type parameters in RTM? For example:

  @helper SomeFunc<T>(IEnumerable<T> items) { }

Right now this produces syntax errors.

It would be great to see generic constraints, as well.

Either way, Razor is clearly more productive than ASPX. Can't wait to get into it further.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 11, 2010 10:40 PM by paintball barrels

what a paint this install has been:

-install mvc3 rc - fails to install, errors.

-reboot - re-run installer- succeeds now. but, launching vs2010 crashes out.

-reboot- now vs2010 will actually launch. but, cshtml files do not have intellisense.

What else will i encounter just trying to get this running?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, November 12, 2010 1:45 AM by Chris van de Steeg

I noticed you ship a dll System.web.webpages.administration.dll with the webpages package. I reall wonder what that's for, but even more... I wonder how you managed to get those compiled cshtml pages in there?

Surely it could be done with aspnet_compiler and then add those cs files manually and add the PageVirtualPathAttribute by hand also, but I'm sure you guys have some tool that automates this ?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, November 12, 2010 2:39 AM by Saulius

I think at least with VWD best solution to start use RC is start a new MVC3 project and copy files from old project. It took me about an hour but I think it worth it. As far as I have seen looks really cool. Congrats to all MVC team!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, November 12, 2010 9:24 AM by Russell

I seem to be missing the CompareAttribute.  The type or namespace cannot be found...

Anyone else?

Great work btw, thoroughly enjoying MVC.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, November 12, 2010 9:40 AM by Chops

The LabelExtensions appear to be using the TemplateInfo.GetFullHtmlFieldName for the "for" attribute:

System.Web.Mvc.Html.LabelExtensions.LabelHelper

tagBuilder.Attributes.Add("for", html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(htmlFieldName));

Should it not be using TemplateInfo.GetFullHtmlFieldId?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, November 12, 2010 11:17 AM by Eric

I'm not getting intellisense on the package manager console.  What am I doing wrong?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Saturday, November 13, 2010 5:43 PM by Sigurdur G. Gunnarsson

Thanks for a great release, I'm loving the new Razor engine!

I think I found an issue with OutputCache on partial views.

I'm calling my child action via @Html.Action and set this attribute on the action:

[OutputCache(Duration = 1200, VaryByParam = "groupId")]

However, my URL has a custom route ("/View/1" where 1 is mapped to parameter "groupId"), and it seems the child action is ignoring the routes when called via this way.

If I change the URL from /View/1  to /View?groupId=1 then it works.

I hope this gets fixed before RTM, but so far it's the only issue I've found!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Saturday, November 13, 2010 7:00 PM by Hakeem Mohammad

It took a while installing on my Win 7 machine. Hitting F5 after creating a small app doesnt do anything though. I have FF as my default browser so I thought that might be an issue and made IE the default. still no dice.

Also when the app is published and run, it is not recognizing the targetFramework attribute. This hasn't been an issue with other MVC versions or the beta of MVC3. And, oh the cshtml files aren't getting published either, as someone already posted earlier

Thanks!

# re: Announcing the ASP.NET MVC 3 Release Candidate

Saturday, November 13, 2010 11:11 PM by ScottLG

I found a way from web to reuse @helper:

1. create an App_Code directory, and put the some.cshtml with @youHelper in it.

2. define two dummy classes in your project:

namespace WebMatrix.Data { public class Foo {} }

namespace WebMatrix.WebData { public class Foo {} }

3. reuse the helpers by @some.yourHelper in razor views.

4. compile and run it.

Scott L.G.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Sunday, November 14, 2010 4:06 AM by Martin Dann

Loving this new release! A big step forward! Keep up the good work guys.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 15, 2010 1:02 AM by szpebble

ASP.NET MVC3是否能提供通过URL获取OutputCache的Key名称?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 15, 2010 9:22 AM by Jeepr

I can't seem to get sections working from a partial layout.

_Layout.cshtml:

@RenderSection("CssPageExt", required: false)

Form.cshtml

@Html.Partial("Panel");

Panel.cshtml

@* no error-message, but doesn't do anything *@

@section CssPageExt {

<link href="main.css" type="text/css" rel="stylesheet" />

}

When placing the @section code in Form.cshtml it works perfectly.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 15, 2010 10:23 AM by Eric

In the video, ScottHa shows how you can open the generated .sdf file in Visual Studio.  I'm getting the following error when I try.

This is not a valid SQL Server Compact Database file or this file version is not supported by current SQL Server Compact Engine.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 15, 2010 10:51 AM by Rajczi

We have been using the MVC3 bits for a while and it's amazing...  awesome work.

I have run into a related issue with the MVC3 bits (both P1 and RC) and the Azure bits.  When I take an Azure project and attempt to add an MVC2 web role to it, I get the new project dialog asking me if I want to use Razor as the view engine.  Then no matter what options I select in that dialog (Razor/ASPX, empty or sample project with/without tests), I get a studio error "Cannot add the item because the item to add is not a solution folder or the solution".  It appears to be a generic studio error about placement of files within the solution and I would guess it's related to the new project template but have yet to issolate the specific issue.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 15, 2010 10:54 AM by jj

Got a "Microsoft Visual Studio has stopped working..."  What to do?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 16, 2010 12:16 AM by ScottGu

@JoeReynolds,

>>>>>>> The following appears to be broke in MVC 3. Posts that worked ok in MVC 2 now produce the "dangerous" message error:

<httpRuntime requestValidationMode="2.0" />

We think we just checked in a fix for this issue.  If you could send me email (scottgu@microsoft.com), though, we'd love to verify the issue with you to make sure we fixed the exact issue you ran into.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 16, 2010 5:02 AM by waaa32

when will the compatible futures dll be released? its still not there...

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 16, 2010 10:18 AM by cyost

Scott,

Is there a way to remove assemblies from being considered as part of the "strongly-typed" list when you add a new view.  When I try and add a strongly-typed view through the dialog, I get thousands of classes which we would never be used, and some are not possible (as they are static classes).

I am also not seeing any classes from inside by project.  Since I am using ViewModels (in the solution) to wrap the models (which can't be made to work correctly for MVC), I need to see the classes within my project.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 16, 2010 2:29 PM by Baris

I can  not seem to get the intellisense to work in the following scenerio...

@{

   Layout = null;

  Mvc3App.Models.JDE_Employee EmpToOutput = (Mvc3App.Models.JDE_Employee)ViewData["Person"];

}

<!DOCTYPE html>

<html>

<head>

   <title>Index</title>

</head>

<body>

   <div>

      @ViewData["name"] is my name

      <br />

      Your name is @(EmpToOutput.name)

      <br />

       your title is  @(EmpToOutput.title)

       <br />

       your title is  @(EmpToOutput.INTELLISENSE DOES NOT WORK HERE)

   </div>

</body>

</html>

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, November 16, 2010 2:49 PM by sachingusain

Hi Scott,

You have mentioned that "Declarative HTML Helpers" will work if we add them in Helpers\View folder. But its not working.

Would someone please update blog and point us to correct direction?

Thanks,

Sachin

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 17, 2010 4:17 AM by Simon Bartlett

Does TextBoxFor output a MaxLength attribute based on Data Annotation attributes yet?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 17, 2010 7:21 AM by Lee

Hi Scott,

Is it correct that ASP.NET MVC 3 Release Candidate is not supported on Windows XP. Unfortunately this is the operating system we have to use at work and I imagine quite a few developers are in the same situation.

Cheers,

Lee

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 17, 2010 10:37 AM by Paul

Hey Scott,

I think I may have a similar issue to Sigurdur G. Gunnarsson with OutputCache on partial views.

I'm calling my child action via @Html.Action and set this attribute on the action as follows:

[ChildActionOnly]

[OutputCache(Duration = 10, VaryByParam = "options")]  

public ActionResult GetSomething(MyTestOptions options)

...

Where MyTestOptions is:

public class MyTestOptions

{

   public int SomeType { get; set; }

   public int SomeOtherValue { get; set; }

}

And I am calling this from a Razor template:

@Html.Action("GetSomething", "Home", new { options = new MyTestOptions{ SomeType = 1, SomeOtherValue = 2 } })

This all works well and is cached for the specified period, however, if I have an additional call to @Html.Action but provide different values for MyTestOptions I get the cached fragment from the first call.  I get this behaviour if included in the same or different template e.g. Index.cshtml or About.cshtml.

Regards,

Paul

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 17, 2010 11:57 AM by Andrew Cherry

Another one here for Output caching with vary by param not working. I always get the first cached element, and it never varies from then on. This one would be great to see fixed!

Additionally, it would be great to have a way of specifying this at runtime - rather than a compile time constant. E.g. if in production mode, cache for 60 minutes, if development, don't cache. Attributes only is rather limiting in terms of being able to dynamically adjust things - an alternative syntax or configuration would be very useful.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 17, 2010 9:39 PM by bradwils

VaryByParam is working, but it's just not doing what you think it's doing. :)

In the RC, VaryByParam is still using Form/Query String values. For RTM, we've changed this to be action parameters instead. It's important to note that the values are used for cache keys, so you should avoid using complex models in your child actions, unless you've also overridden ToString() to ensure that you get a unique string value for caching purposes.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, November 19, 2010 9:48 AM by mjkuehn

Hi Scott.

Thanks for all the effort you and your team put into Asp.Net Mvc 3. Pretty great stuff.

But what about the source code. Will it be opened to the public any time soon?

Cheers.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 7:18 AM by David

Guys, I always got fatal error during the installation.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 7:55 AM by avsomeren

I have come across a situation that I want to write an "@" to my output (like the twitter @screenName) using the razor view engine :

<span>@</span><span>username</span>

I'm getting the following error when i try this.

Parser Error Message: "<" is not valid at the start of a code block.  Only identifiers, keywords, comments, "(" and "{" are valid.

Is this a bug, or should i use some special construct?

Regards,

avsomeren

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:24 PM by ScottGu

@Otyce,

>>>>>>> with the new feed for nuget packages it is no longer possible to download packages onto my machine. when are you going to enable this again.

Are you still having this problem?  If so please send me email (scottgu@microsoft.com) and we can help.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:26 PM by ScottGu

@Paco,

>>>>>>> Scott, how to implement scenario when on one page I have several "models".

You can do one of two things:

1) Pass a ViewModel object as the model of the page that has all of the model objects you require.

2) Use Html.Action and implement the page using multiple controllers and separate views.  The main view would then call out to the Sub-controllers using this approach.  One nice thing with MVC3 is that you can now outputcache these separate sections.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:27 PM by ScottGu

@Deepak,

>>>>>>>> Simple question) Does this work in Visual Studio 2008 professional?

Yes - MVC3 requires either VS 2010 or Visual Web Developer 2010 Express.  It uses features that are only supported with .NET 4.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:28 PM by ScottGu

@Edmund,

>>>>>>> When can we expect a MVC Futures 3.0? Can I use the MVC Futures 2.0 RTM meanwhile?

I believe MVC Futures 2.0 will work with it (but am not 100% sure).  We'll have a MVC 3.0 Futures package available by the time MVC 3 ships.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:36 PM by ScottGu

@Chris,

>>>>>> When adding a strongly-typed view with a nested class as the view data class, the @model directive is incorrectly generated. A '+' is inserted before the nested part of the class name, where it should be a '.'

Thanks for reporting this.  Can you send me email (scottgu@microsoft.com) with the use-case for this?  The team has looked at fixing it, but wasn't sure if the fix was going to be riskier than it was worth (given that doing nested classes seemed rare).  Can you send me more details on why you are using nested classes to make sure we understand the scenario better?

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:39 PM by ScottGu

@AndreVianna

>>>>>> Since I've installed new MVC 3 and NuGet I'm not being able to install any package.  I'm receiving the following message: PM> Install-Package SQLCE.EntityFramework

I believe this is caused because you have an older version of Refactor installed. Can you confirm if you have that installed?

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:41 PM by ScottGu

@Anthony Capone

>>>>>> After working without intellisense for a couple months, I could not be happier with the improvements this RC offers.  Unfortunately, I have also encountered the issue previously posted by "Random Guy".

Are you still running into this? If so, can you send me email (scottgu@microsoft.com)?

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:42 PM by ScottGu

@ScottLG

>>>>>>> I only have Visual Web Developer 2010 Express. Does it support Razor ? Since there is no viewengine option on the addview dialog. If yes, could anyone point me to how to use it ? Really appreciate.

Yes - this should work fine with Razor.  Do you have MVC3 RC installed?

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:42 PM by ScottGu

@Jack,

>>>>>>> I've got a question/feature request about @section and @RenderSection though. With an asp:ContentPlaceHolder it was possible to provide default content in the masterpage which could be overridden in a viewpage. This doesn't seem to work with @RenderSection. A @section with the same name in the masterpage is simple ignored. I couldn't think of any other way to try. Is this already possible or will it be in the RTM?

Yes - you can do the same with Razor.  I unfortunately don't have a pointer to a sample handy - but if you ask this question in the MVC forum on www.asp.net someone can point you to a sample.

Hope this helps!

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:43 PM by ScottGu

@Jacob,

>>>>>> Wish you guys would put the same amount of energy into improving WebForms :)

Don't worry - we have a lot of investments going on with WebForms too.  WebForms has been around a lot longer and has more features, which is why it feels like MVC is moving fast (it started from zero <g>).

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:44 PM by ScottGu

@Asbjørn

>>>>>>>> How about SQL CE 4.0? Has that been updated or are we still at CTP1? SQL CE4 looks promising, but the lack of tooling makes it difficult to use - and the lack of information on updates makes it difficult to plan.

You'll see VS 2010 tooling support come for SQL CE 4.0 shortly.  Stay tuned for details!

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:44 PM by ScottGu

@Johann,

>>>>>>> I'm confused about how to "share" declarative helpers in MVC 3 RC. What I thought we would be able to do is create a cshtml file somewhere with a declarative helper that can be accessed by all views. I tried putting them in /Views/Shared but that doesn't work.   Or maybe I'm missing something in the cshtml file itself (the one that contains the helper to be shared)?

We are working on this right now - it is a little harder to-do right now in a MVC app than we'd like (especially due to some issues we introduced with the RC).  We'll share more details on how best to do this for the RTM.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:47 PM by ScottGu

@gligoran

>>>>>>> I have Windows 7 64bit as well and the installation seems to be stuck at the start.

Can you send me email (scottgu@microsoft.com) if you are still having problems with this?

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 12:52 PM by ScottGu

@avsomeren

>>>>>>> I have come across a situation that I want to write an "@" to my output (like the twitter @screenName) using the razor view engine : <span>@</span><span>username</span>  I'm getting the following error when i try this.

The easiest way to escape the "@" character would be to write it like so:

  <span>@@</span><span>@username</span>

The double @@ tells the parser to treat it like a content character.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 2:46 PM by avsomeren

@scott

Thanks for the clarification, could have come up with that myself.

Keep up the good work on these awesome developments that will make our life better ;)

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 4:55 PM by AlexW

Can you add an option in route to make all urls lowercase?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 22, 2010 7:05 PM by ScottLG

Scott,

Thanks for your reply. I can access Razor features by creating new MVC 3 projects.

Saw the Razor Single File Generator solution to reuse @helper. Curious what will be in the final version : reuse @helper declarations inline, or reuse generated method calls ?

Also any guide for the integration of MVC and MEF or Unity ?

Really appreaciate your efforts.

Scott L.G.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, November 24, 2010 6:58 PM by Rich Buff

This is great!  I'm looking forward to starting a project with MVC 3.  I am running on 2008 R2 and the first time I tried to install it hung like someone previously described.  I stopped the install and it was still hung on rollback.  I used task mgr to kill it.  I had to delete the files in c:\temp.

When I ran this a 2nd time, it installed as I would expect.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, November 25, 2010 9:43 PM by Feng

How do we make ViewModel strongly typed? I hope there's new syntax '@view' to define the type.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, November 26, 2010 5:44 AM by Stian

Stacey made a comment on Phil Haack's blog, but didn't get any answer to this question:

Inheriting Javascript Intellisense

When I create a master page/layout page and put in javascript libraries, while the compile time works in inherited pages, the intellisense does not. If I reference jQuery-1.4.3 in my layout page, then create a new View, and start typing out some javascript, it it is not 'aware' of the reference to jQuery (whereas on the layout page, it is, and would give me full intellisense of the functions in jQuery (or any other .js file references). (This has actually been true in ASP.NET WebForms, so I think it is more of a Visual Studio issue than an MVC issue)

I have the same problem and been searching for hours to find out how I can get intellisense to work in my views.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Sunday, November 28, 2010 2:25 AM by ScottGu

@AlexW,

>>>>>> Can you add an option in route to make all urls lowercase?

Yes - you can add a "constraint" to any MVC route that enforces certain behavior.  You could do one, for example, that always makes the URLs lower-case.

I'd also recommend checking out this post: weblogs.asp.net/.../tip-trick-fix-common-seo-problems-using-the-url-rewrite-extension.aspx  In it I cover how to setup URL routing rules that enforce lower-case URLs and can help improve SEO in general.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Sunday, November 28, 2010 2:36 AM by ScottGu

@Feng,

>>>>>>> How do we make ViewModel strongly typed? I hope there's new syntax '@view' to define the type.

The ViewModel property (which we are renaming for the final release to make it clearer) is actually a dynamic object - and should be thought of as a late-bound bag of additional stuff you pass to the View.  This avoids you having to always define a strongly typed ViewModel that you pass as the Model of the View.

If you want to always make the data you pass to a View strongly-typed, then I'd recommend creating a custom ViewModel class and then pass it as the model to the View.  You can use the existing @model syntax to type it and get intellisense/compilation checking.

Hope this helps,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 29, 2010 7:47 AM by Stialy

I created Internet project with unit tests. After that I run unit tests.

All created tests were failed with same message "System.Security.VerificationException: Operation could destabilize the runtime."

Thanks

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, November 29, 2010 6:11 PM by ScottGu

@Stialy,

>>>>>>>> I created Internet project with unit tests. After that I run unit tests. All created tests were failed with same message "System.Security.VerificationException: Operation could destabilize the runtime."

Can you send me email (scottgu@microsoft.com) with more details of this?  We'd like to investigate to understand it more.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, December 3, 2010 12:25 AM by joydeep1985

Dear Scott ,

Here is the situation .. we hav windows xp based production system .. what i want to ask is will MVC 3 would work on Windows xp ?? or specifically we need windows vista or later to work on visual studio and MVC 3 RC to work on ???

as we hav only windows xp for the time being as production just wanna know if there are any ways we can work it around on with Windows XP and Visual studio 2010 ... specifically Windows XP is my query ..

Thanks

Joy

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, December 3, 2010 5:50 AM by tassadaque

One control that i am really waiting for is the crystal report viewer so that we can avoid mixing asp.net webforms in mvc application

# re: Announcing the ASP.NET MVC 3 Release Candidate

Friday, December 3, 2010 10:55 AM by Cody Clayton

Two Questions:

1)Has a final release date been communicated?

2)Are there any issues with running MVC3 on IIS6?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Sunday, December 5, 2010 9:45 PM by Diego Varese

I'm using a hosting service that has a dll of MVC3 Beta in their GAC, and it appears that even though I'm deploying the MVC3 RC dll to the bin folder, the Beta dll is taking precedence and my web application isn't compiling (eg the parameters to GlobalFilterCollection.Add are different in the RC compared to the Beta). Is there some solution to this problem that doesn't required the hosting service to take down the MVC3 Beta dll?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Sunday, December 5, 2010 10:09 PM by timmi4sa

The MVC3 Release Candidate installs and works fine on Windows XP SP3, based on my personal quick test. There might be disappointments waiting around the corner but the MVC3-based simple solution builds and runs in Internet Explorer.

I too was very nervous about not finding Windows XP in the list of system requirements for MVC3 Release Candidate. I hope it was helpful.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, December 7, 2010 1:03 PM by krokonoster

I nutted out MVC3 tonight, converting my own site from 2 to 3.

But when I asked my host if this is supported yet (and these guys are good) I got the following answers:

"We'll install this once stable edition is out since it had some weird results in our test environment and we were advised to wait till its stable release to obtain support related to it. "

Then, in response to my question of which version they tried things out:

"It was in fact RTM version that we used on a cloned web server and had pretty drastic results which broke existing MVC 2 apps as well. We were then advised to wait for stable version to obtain any kind of help/support from Microsoft for this.."

Any comment on this?  Krok is not happy.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Tuesday, December 7, 2010 11:39 PM by Eddy Ho

HELP - All for C# error from "The Complete Reference - Herbert Schildt" Error - Unsafe code may only appear if compiling with /unsafe

Errors from The Complete Reference errors pg. 608 - UnsafeCode, pg. 609 - FixedCode, pg.610 PtrArithDemo, 612 - PtrIndexDemo

Sample - One of error and more

using System;

class _611_PtrArray

{

   class Program

   {

       unsafe static void Main()

       {

           int[] nums = new int[10];

           fixed (int* p = &nums[0], p2 = nums)

           {

               if (p == p2)

                   Console.WriteLine("p and p2 point to same address.");

           }

       }

   }

}

Error 1 Unsafe code may only appear if compiling with /unsafe

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, December 8, 2010 6:19 AM by frankvaneykelen

Chops (Friday, November 12, 2010 3:40 PM by Chops) is right: the "for" attribute of a label should match the "id" of an input. If not, clicking on a checkbox's label will not toggle the checkbox.

The code in the Beta is correct though. See ASP.NET MVC 3 Beta Source Code\mvc3\src\SystemWebMvc\Mvc\Html\LabelExtensions.cs:

tag.Attributes.Add("for", html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldId(htmlFieldName));

So it look like s a bug introduced in the RC.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, December 13, 2010 2:39 AM by ScottGu

@krokonoster

>>>>>> I nutted out MVC3 tonight, converting my own site from 2 to 3. But when I asked my host if this is supported yet (and these guys are good) I got the following answers: "We'll install this once stable edition is out since it had some weird results in our test environment and we were advised to wait till its stable release to obtain support related to it. "

As long as your host is running .NET 4 then you don't need them to install anything.  Just mark the references in your project as "copy to local", and then all of the ASP.NET pieces necessary to deploy ASP.NET MVC 3 will be copied as part of the \bin directory of your app and work without anything extra needing to be installed.

Send me email (scottgu@microsoft.com) if you run into any problems with this and I can help.

Thanks,

Scott

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, December 13, 2010 11:53 AM by Wei Liao

I downloaded the mvc3 rc, the setup hangs on "Installing VS10-KB2465236-x86", I thought it was because of the windows update that I haven't applied, so I did but it still hangs. I did install it fine on my home computer yesterday. This fails on my work laptop. I'm running win7 ultimate x64. Help?

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, December 15, 2010 1:00 PM by Nathan Alden

Overall the new features in MVC 3 look great. However, I have noticed a small problem when using an if() block inside some jQuery script. In the following code, $("#navigationColumn").hide(); is syntax colored as if it is C# code rather than markup/JavaScript:

$(function () {

@if (!((BaseModel)Model).IsAuthenticated) {

$("#navigationColumn").hide();

}

}

# re: Announcing the ASP.NET MVC 3 Release Candidate

Wednesday, December 29, 2010 12:59 AM by shridhar.wakhare

Nice One.... Good Work.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Monday, January 3, 2011 11:28 AM by Orion

Finally partial output caching! i was waiting for it from version 1.

# re: Announcing the ASP.NET MVC 3 Release Candidate

Thursday, January 6, 2011 3:22 AM by Phoenix

Thanks for the release.

When is the RTM release?