ASP.NET MVC 3 Release Candidate

Today we’re releasing the release candidate for ASP.NET MVC 3. We’re in the home stretch now so it’ll mostly be bug fixes and small tweaks from here on out.

There are two ways to install ASP.NET MVC 3:

Also, be sure to check out the ASP.NET MVC 3 web page for information and content about ASP.NET MVC 3 as well as the release notes for this release.

Also, don’t miss Scott Guthrie’s blog post on ASP.NET MVC 3 which provides the usual level of detail on the release.

Razor Intellisense. Ah Yeah!

Probably the most frequently asked question I received when we released the Beta of ASP.NET MVC 3 was “When are we going to get Intellisense for Razor?” Well I’m happy to say the answer to that question is right now!

Not only Intellisense, but syntax highlighting and colorization also works for Razor views. ScottGu’s blog post I mentioned earlier has some screenshots of the Intellisense in action as well as details on some of the other improvements included in ASP.NET MVC 3 RC.

NuGet

As I wrote earlier, this release of ASP.NET MVC includes an updated version of NuGet, a free and open source Package Manager that integrates nicely into Visual Studio.

What’s Next?

Well if all goes well, we’ll land this plane nicely with an RTM release, and then it’s time to start thinking about ASP.NET MVC 4. There, I said it. Well, actually, I should probably already be thinking about 4, but seriously, can’t a guy catch a break once in a while to breathe for a moment?

Well, since I’m lazy, I’ll probably be asking you very soon for your thoughts on what you’d like to see us focus on for the next version of ASP.NET MVC. Then I can present your best ideas as my own in the next executive review. You don’t mind that at all, do you? Winking smile

Seriously though, please do provide feedback and I’ll keep you posted on our planning.

Now that we have Nuget in place, one thing we’ll be focusing on is looking at building packages for features that we would have liked to include in ASP.NET MVC, but maybe didn’t have the time to implement them. Or perhaps simply for experimental features that we’d like feedback on. I think building NuGet packages will be a great way to try out new feature ideas and for the ones we think belong in the product, we can always roll them into ASP.NET MVC core.

What others have said

Requesting Gravatar... MrDustpan Nov 09, 2010 12:04 AM
# re: ASP.NET MVC 3 Release Candidate
Awesome, you guys rule! Very pumped about the intellisense and NuGet...oh and MVC 3 too!
Requesting Gravatar... Charles Nurse Nov 09, 2010 12:09 AM
# re: ASP.NET MVC 3 Release Candidate
The WebPI link says I am to date (with the earlier beta)
Requesting Gravatar... Bats Ihor Nov 09, 2010 12:13 AM
# re: ASP.NET MVC 3 Release Candidate
Intellisense Mmmmm ) I will Try it right now!
Requesting Gravatar... Felipe Nov 09, 2010 12:15 AM
# re: ASP.NET MVC 3 Release Candidate
Good news =D
Thanks!
Requesting Gravatar... Felipe Leusin Nov 09, 2010 12:36 AM
# re: ASP.NET MVC 3 Release Candidate
Where can I find the source code to ASP.Net MVC3, most specifically to Razor support to Intellisense? So we can extend this feature to other View engines?
Requesting Gravatar... Craig Stuntz Nov 09, 2010 12:56 AM
# re: ASP.NET MVC 3 Release Candidate
ControllerSessionStateAttribute seems interesting/useful. Is it limited (as the name implies) only to the controller/class level, and not the action/request level? Would be nice to specify some actions as read-only and others as read-write.

Could have used @Html.LabelFor(m => m.PropertyName,
"Label Text");
yesterday... :)
Requesting Gravatar... Laurent Kempé Nov 09, 2010 1:20 AM
# re: ASP.NET MVC 3 Release Candidate
Congrats to the team !

ASP.NET MVC is really cool.
Requesting Gravatar... Levi Nov 09, 2010 1:41 AM
# re: ASP.NET MVC 3 Release Candidate
Craig - yes, the attribute is limited to just controller classes for now. Allowing it to be applied directly to actions would require a massive rearchitecture of the MVC pipeline, and that it something we didn't have time for this go around.
Requesting Gravatar... guest Nov 09, 2010 1:51 AM
# re: ASP.NET MVC 3 Release Candidate
Session-less Controller, is there any explanation when and why we need it?
Requesting Gravatar... Terrence Nov 09, 2010 1:53 AM
# re: ASP.NET MVC 3 Release Candidate
Phil, great work.
I am amazed that you are not blowing the "SimpleMembership" horn. If more devs knew it was so easy to add additional User data to membership without using the old "blob" storage for profiles, or even worse have to implement a MembershipProvider class, they would be jumping on the band wagon.

I see Websecurity has moved to the WebMatrix.Webdata.dll.

I wonder if you could get some more documentation out about it as Matt's blog is very outdated by now.

Thanks for all the great work.
Terrence
Requesting Gravatar... Akelitz Nov 09, 2010 2:00 AM
# re: ASP.NET MVC 3 Release Candidate
bad news!
i'll have a session on mvc 3 on friday at the community tour in rome.
two more night of work for me :)
very good job, thanks for the intellisense!
Requesting Gravatar... Craig Stuntz Nov 09, 2010 2:17 AM
# re: ASP.NET MVC 3 Release Candidate
Levi, thanks. Fair enough. Would be nice when the opportunity presents itself, but I'll take what I can get for now!
Requesting Gravatar... Sean Nov 09, 2010 2:52 AM
# re: ASP.NET MVC 3 Release Candidate
Love the idea of MVC and am looking forward to installing the RC.

One suggestion, if I may: before concentrating on MVC4, have the team concentrate on building some killer documentation / tutorials and updating the MVC site to contain them. I think it will help bridge the gap between devs focused on standard .NET development, and it certainly would make picking it up for new folks new to MVC (like mysef) a lot easier.

With that said though, very excited for MVC 3!
Requesting Gravatar... BlueCoder Nov 09, 2010 2:53 AM
# Install
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).(from Scottgu blog)
Requesting Gravatar... CubanX Nov 09, 2010 3:03 AM
# re: ASP.NET MVC 3 Release Candidate
Phil, sorry to post this here, but not having any luck figuring this out..

Trying to install MVC 3 RC, but getting an error on install.

I've broken it down to the patch to VS10 not wanting to install, specifically, this file: vs10-kb2385361-x86.exe

If I try to install that by hand, I get: "KB2385361 does not apply, or is blocked by another condition on your computer."

Any ideas on where to go with this?

I had ASP.Net MVC 3 Beta installed, but I uninstalled that, rebooted, etc.

Any help would be appreciated :)
Requesting Gravatar... Igorbek Nov 09, 2010 3:03 AM
# re: ASP.NET MVC 3 Release Candidate
Thanks a lot for Razor!

I reported you about two bugs in Razor that I've found in post about Beta.
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!
Requesting Gravatar... BlueCoder Nov 09, 2010 3:18 AM
# re: ASP.NET MVC 3 Release Candidate
@CubanX 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).(from Scottgu blog)
Requesting Gravatar... CubanX Nov 09, 2010 3:34 AM
# re: ASP.NET MVC 3 Release Candidate
@BlueCoder I did :( Still same result, it refuses to install the KB fix. I may have to reinstall VS2010 completely and hopefully see if that clears it up.
Requesting Gravatar... Nicolas Nov 09, 2010 3:48 AM
# re: ASP.NET MVC 3 Release Candidate
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)
Requesting Gravatar... BluCoder Nov 09, 2010 3:59 AM
# @CubanX
Are you sure you uninstalled MVC3 Beta (and VS Tools) ASP.NET Wep Pages and Nupack before install the new RC release? because the MV3C.NET installer inculdes:
• ASP.NET MVC 3 run-time components.
• ASP.NET MVC 3 Visual Studio 2010 tools.
• ASP.NET Web Pages run-time components.
• ASP.NET Web Pages Visual Studio 2010 tools.
• Third-Party Library Package Manager (based on NuGet){Nupack}.
It is better to uninstall any previous versions of these components
Requesting Gravatar... CubanX Nov 09, 2010 4:38 AM
# re: ASP.NET MVC 3 Release Candidate
@BluCoder Thanks for all the help. I have uninstalled all the items you talked about, but I am still getting the same error :(

I think I'm going to have to go with the nuclear option of unistalling 2010 and starting over.
Requesting Gravatar... John S Nov 09, 2010 1:53 PM
# re: ASP.NET MVC 3 Release Candidate
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!
Requesting Gravatar... shiju Nov 09, 2010 2:46 PM
# re: ASP.NET MVC 3 Release Candidate
Big thanks to the great MVC team
Requesting Gravatar... Erx Nov 09, 2010 3:35 PM
# re: ASP.NET MVC 3 Release Candidate
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?
Requesting Gravatar... Anders Nov 09, 2010 4:05 PM
# re: ASP.NET MVC 3 Release Candidate
Maybe you could set up a uservoice account for ASP.NET MVC?
Requesting Gravatar... Erx Nov 09, 2010 4:05 PM
# re: ASP.NET MVC 3 Release Candidate
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?
Requesting Gravatar... mike Nov 09, 2010 4:57 PM
# re: ASP.NET MVC 3 Release Candidate
Without all the effort You make on ASP.NET MVC (like unobtrusive js), I would have moved completely to RoR some time ago.
With this release and new features, You guys keep me with .net technology. Great job!
Requesting Gravatar... Andy Nov 09, 2010 5:49 PM
# re: ASP.NET MVC 3 Release Candidate
My install on Visual Studio 2010 Ultimate on Windows 7 64bit is also blocking on install of vs10-kb2385361-x86.exe. I have successfully installed MVC3 RC on a machine with Visual Studio 2010 Express, and am aware that I need to uninstall MVC 3 Beta and WebPages components.
Requesting Gravatar... Artiom Chi Nov 09, 2010 7:22 PM
# re: ASP.NET MVC 3 Release Candidate
@CubanX, @BluCoder
Hey guys, I think I found the issue.. You have to uninstall the MVC 3 and Web Pages from your machine, but one thing I missed is the NuPack. The Beta 1 installer also installed it, and it has since been renamed to NuGet. Once I uninstalled NuPack, I managed to install the hotpatch without a hitch ^_^
Requesting Gravatar... Anders Nov 09, 2010 7:55 PM
# re: ASP.NET MVC 3 Release Candidate
Aha! ASP.NET MVC uservoice forum
Requesting Gravatar... AndreVianna Nov 09, 2010 8:16 PM
# re: ASP.NET MVC 3 Release Candidate
I've downloaded ASP.NET MVC 3 RC and the new NuGet CTP version.

When I try to install anything in the through the Package Manager Console I get the an error message. Here are two samples:

PM> nip elmah
Install-Package : Object reference not set to an instance of an object.
At line:1 char:4
+ nip <<<< elmah
+ CategoryInfo : NotSpecified: (:) [Install-Package], NullReferenceException
+ FullyQualifiedErrorId : NuGet.VisualStudio.Cmdlets.InstallPackageCmdlet


PM> nip SQLCE.EntityFramework
Install-Package : Object reference not set to an instance of an object.
At line:1 char:4
+ nip <<<< SQLCE.EntityFramework
+ CategoryInfo : NotSpecified: (:) [Install-Package], NullReferenceException
+ FullyQualifiedErrorId : NuGet.VisualStudio.Cmdlets.InstallPackageCmdlet
When I use the Add Library Package Reference in the Solution Explorer no message is displayed but the package is not installed.

I tried to revert to NuPack and it works fine but the Package list is not updated (for instance SQLCE.EntityFramework 4.0.8435.1 is not been displayed only 4.0.8402.1).

Any help?
Requesting Gravatar... Roberto Hernandez Nov 09, 2010 9:16 PM
# re: ASP.NET MVC 3 Release Candidate
Can WebMatrix Beta 2 and MVC3 RC be installed on the same box or will there be a dependency crisis?

Roberto.-
Requesting Gravatar... Koistya `Navin Nov 09, 2010 11:18 PM
# re: ASP.NET MVC 3 Release Candidate
Great news! I assume it has GoLive license
Requesting Gravatar... Stacey Nov 10, 2010 12:13 AM
# re: ASP.NET MVC 3 Release Candidate
@Sean

I agree with his statement ; New documentation would be ideal. .NET in general suffers from documentation not reflecting the new technology.

The Intellisense Feature is great. I love it to death. I feel whole again. For a while I was feeling this deepening void as the '.' key on my keyboard was feeling lonely. It kept saying 'Why am I useless, again?'

I really, really like that everything ties into jQuery now. It feels fluid and very controlled. It feels solid, stable, and I've had less browser incompatibilities in general.

The graphics for .cshtml are nice. They're much better than the 'blank file' graphics we had before that made my OCD cringe.

As for what I want to see in the future, I've spoken to you privately in emails - but I'll state it here too.

- Templating is becoming popular, it would be nice if we didn't have to lose the Razor Syntax in favor of what the Templating has to offer. You claim that the HTML helpers are orthogonal to what jQuery Templating is offering, but I think it's a good place to look at making MVC even more versatile. (look at libraries like knockoutjs.com for what I mean.)

- 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)

View Engine Builder
- Keeping convention is important, but oftentimes there do need to be minor tweaks on certain situations to the view paths. For instance, I have a specific project that requires a path structure that allows for

/controller/view
/controller/content/subview
/controller/content/subview[1]
/controller/content/subview[2]

etc.

This is easy enough to build - just wire up the paths and attach it. It wasn't difficult at all, but I think it would be really nice if there was more documentation or examples on how things of this nature can be made to work well for developers, including the impact it has on routing (the above example, for instance, has a huge [negative] impact on routing in Controllers/Areas where it is used.)
Requesting Gravatar... Portman Nov 10, 2010 1:02 AM
# re: ASP.NET MVC 3 Release Candidate
Phil,

Count this as +1 vote for Visual Studio Publish support before the RTM.

I had always assumed this would go hand-in-hand with syntax highlighting and IDE support for Razor, so was surprised to see that the RC is still not including .cshtml files when publishing.

I think a lot of smaller teams and individual developers rely on VS Publish + Web Deploy.
Requesting Gravatar... Johnny Nov 10, 2010 3:05 AM
# WebForms page Parser Error
I'm getting a Parser Error when trying to view a WebForms (aspx) page after I upgraded to MVC3. I followed all the steps in the release notes to do the upgrade and I've double checked that I don't have any references to MVC 2 anywhere in my solution. But it looks like it's finding MVC2 in GAC, and it's causing a conflict. Note that I've got another MVC project in the same solution and it doesn't seem to be having this problem. Here's the error message:

Parser Error Message: The type 'System.Web.Mvc.ViewPage' is ambiguous: it could come from assembly 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mvc\v4.0_3.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll' or from assembly 'C:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll'. Please specify the assembly explicitly in the type name.

Source Error:

Line 1: <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

Anyone else having this problem?
Requesting Gravatar... Johnny Nov 10, 2010 3:10 AM
# re: WebForms page Parser Error
In case anyone else is having this same problem, I fixed the Parser Error issue by changing the <runtime> instructions in the Release Notes to 2.0.0.0 for the oldVersion. Here's my runtime after the change.

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Requesting Gravatar... Dennis Nov 10, 2010 4:57 AM
# OutputCache suggestion
Although I like the OutputCache attribute one way it could be improved would be to be able to programatically remove entries from the cache by using a key generated by the UrlHelper instead of the LocalPath of an actual Uri.

HttpResponse.RemoveOutputCacheItem(Url.Action(...)) would simplyfy working with the OutputCache a lot.
Requesting Gravatar... hwiechers Nov 10, 2010 3:27 PM
# re: ASP.NET MVC 3 Release Candidate
Is the Codeplex site going to be updated?
Are we supposed to report bugs at ASP.net forums again?
Requesting Gravatar... Criação de Site Nov 10, 2010 10:34 PM
# re: ASP.NET MVC 3 Release Candidate
I love'd NuGet !! very good and very thanks ;)
Requesting Gravatar... Jeremy McCliment Nov 13, 2010 3:04 AM
# re: ASP.NET MVC 3 Release Candidate

Awesome, Amazing, Astounding, and 99.44% made of pure win. There's only one small issue, and it's because I'm lazy (around the office we refer to it as being a "Convenience Enthusiast"), that I wanted to ask about...


I use intellisense a lot. Knowing that intellisense will help me out, I've developed a habit of not worrying about the capitalization as I type. I'll type var foo = new stringbuilder(); knowing that intellisense will correct the capitalization on StringBuilder for me.


Imagine my dismay, then when we finally got intellisense in Razor, and it dawned on me that we've got two instances where we're typing @model -- once for the @model directive, and then again for <li>@Model.Name</li>. Unfortunately, the version we're going to type most often requires the use of the shift key. Was there any thought given to having the @model directive be something else (@setModel, for instance)? I know, it's minor, nitpicky and just plain lazy on my part -- I just don't want to have to press the shift key every single time I access the Model for a view...

Requesting Gravatar... Andrey Nov 13, 2010 7:53 PM
# re: ASP.NET MVC 3 Release Candidate
Hi,
I think syntax hilite/intellisense is great Razor, but some work needs to be done on speeding it up. I have a file with just 800 lines of declarative @helpers, and you can feel already this is a very heavy job for the real-time parser/hiliter. The delay between the keystrokes can reach 2 seconds.
Requesting Gravatar... Mario Nov 14, 2010 3:25 AM
# re: ASP.NET MVC 3 Release Candidate
Yes, finally some better caching!!
Requesting Gravatar... Chris van de Steeg Nov 14, 2010 3:58 AM
# re: ASP.NET MVC 3 Release Candidate
I noticed you ship a dll System.web.webpages.administration.dll with the webpages package. I really 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 process?
Requesting Gravatar... Bo Nov 14, 2010 8:12 AM
# re: ASP.NET MVC 3 Release Candidate
Cant get Intellisense working 100%, in razor views, only html elements listed
e.g i can list @Html.li or @Html.text only, but not @Html.ActionLink ant all aothers.
Requesting Gravatar... rekna Nov 16, 2010 2:12 AM
# re: ASP.NET MVC 3 Release Candidate (bug encoding international character in default html helpers)
There is a problem with the HTML helpers when values contain international characters. Eg. @Html.TextBox("test","Kopiëren"); renders the wrong value for the input value, ë is changed to ë.
Only when the value attribuut comes from a variable eg. @Html.TextBox("test", Model.TestValue ); the output is correct, however, it doesn't always makes sense to pass it from the view model, eg. value property of buttons...
Requesting Gravatar... Tugberk Ugurlu Nov 16, 2010 4:05 AM
# re: ASP.NET MVC 3 Release Candidate
Hi Phil,

I am now downloading mvc 3 rc and I am considering to develop a web application with mcv 3 rc and I will probably use that app on production. I am guessing that I can easily upgrade that app when the mvc 3 rtm is released. What is your opinion on that?

thank you and your team for this such an enourmous framework !
Requesting Gravatar... Adam Nov 16, 2010 6:52 AM
# ATTN: Phil
Hi Phil!

A while ago it was mentioned making the ViewData dictionary dynamic (insted of having ViewModel.)

I can understand your concearns about compatability, but since my model binders and helpers had to be re-written from MVC1 to MVC2, and then I had to change the helpers and the data annotations again from MVC2 to MVC3. I'm still having to change stuff.

Please add that change...

Adam.
Requesting Gravatar... Gleb Nov 17, 2010 5:28 PM
# re: ASP.NET MVC 3 Release Candidate
Hi Phil, congrats on another great release by MVC team!
I assume NuGet will work on every type of .NET app, be it MVC or WPF or console one?
Requesting Gravatar... blade Nov 17, 2010 11:42 PM
# # re: WebForms page Parser Error
Johnny,
10x a lot for the hint. I had the same problem after the MVC upgrade and your solution worked for me!
Requesting Gravatar... Berta Nov 19, 2010 12:07 AM
# re: ASP.NET MVC 3 Release Candidate
Attempt by method 'Microsoft.Web.Helpers.ReCaptcha.GetHtmlWithOptions(System.String, System.Object)' to access method 'System.Web.WebPages.WebPageContext.get_HttpContext()' failed.
Help!
Requesting Gravatar... jessicah Nov 19, 2010 3:40 AM
# re: ASP.NET MVC 3 Release Candidate
Razor is almost smart enough with not outputting superfluous whitespace, e.g. the following doesn't add any extra blank lines:

@{
Layout = "_MyLayout.cshtml";
}


However, @model Models.ThisIsMyModel does.

It would be nice to have that particular instance fixed to not generate a blank line either. Technically, things like the &lt;?xml version="1.0"?&gt; shouldn't have any leading whitespace, so adding a model directive breaks it.

Luckily, I can just remove the model directive after I'm doing writing my markup and it still seems to behave the right way, and that extra blank line disappears.

But seriously, don't output a blank line for any line if it a) contains code/directives that don't produce output, and b) doesn't contain anything else.
Requesting Gravatar... redsquare Nov 19, 2010 3:31 PM
# re: ASP.NET MVC 3 Release Candidate
Great work Phil & team. For v4 can we have a jquery tmpl view engine so we can use the same view client and server side. This will prevent duplication especially in a progressive enhancement environment. I would settle for a razor to .tmpl converter!
Requesting Gravatar... Martin Nov 20, 2010 9:12 AM
# re: ASP.NET MVC 3 Release Candidate
Do you monitor the performance of Mvc 3 and is it better or worse than Mvc 2 ?

Will the System.Web.WebPages and the Microsoft.Web.Infrastructure be integrated into the .Net framework in the future ? (so it is shipped together).

Could you please add a SkipValidation attribute you could use on your Action methods to make sure that your models are not validated when the Modelbinder bind the Model? (it is currently only possible to implement this in a very "hackish" way)

Is there any chance in the future that HttpContext will inherit from HttpContextBase ?
Or is there no development going on in the core ?
Requesting Gravatar... tugberk_ugurlu_ Nov 25, 2010 3:25 AM
# re: ASP.NET MVC 3 Release Candidate
hi phil,

when do you plan to release the RTM of MVC 3?
Requesting Gravatar... Feng Nov 25, 2010 10:44 AM
# re: ASP.NET MVC 3 Release Candidate
How do we make ViewModel strongly typed? I hope there's new syntax '@view' to define the type.
Requesting Gravatar... haacked Nov 25, 2010 12:18 PM
# re: ASP.NET MVC 3 Release Candidate
@Feng use the @model declaration to specify the model type.
Requesting Gravatar... arkduke Nov 25, 2010 5:43 PM
# re: ASP.NET MVC 3 Release Candidate
All,

If you have problems installing MVC3RC even if you have uninstalled MVC3Beta, you can try this:

Removed the trailing slash from the following Registry key temporarily:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\Path

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\

...becomes...

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

...run AspNetMVC3Setup. :)

Hope this helps somebody....
Requesting Gravatar... Pavel Nov 29, 2010 9:59 AM
# re: ASP.NET MVC 3 Release Candidate
Hi Phil,

We have a problem with DRY and Anti-Forgery token in ASP.NET MVC . Good description could be found here
weblogs.asp.net/...

but as one commenter said - "To me, I see no reason for this. You still have to remember to put the <%= Html.AntiForgeryToken() %> in the form. I guess if you forget, you will get an error since it will check for it by default... but in this case, I'd rather have it automatically added to my form as well. Also, I think I'd rather see each action explicitly have the [ValidateAntiForgeryToken] attribute, just so I (or another developer) know what's going on. Less DRY? Sure. Easier to understand? Yes!

Adding the one extra attribute isn't enough to make me want to DRY it up. Even if it is on every POST. But, again, I'd rather have the option to just use it by default in the form and controller - this is how Rails works."

Would be really cool to fix this really annoying issue in future releases.

Thanks
Requesting Gravatar... Matt S. Dec 01, 2010 4:14 AM
# re: ASP.NET MVC 3 Release Candidate
Hi Phil,

This is great news! I do have a general question about Razor and its output.

If the only bits on a line in my source is Razor code or a comment, will that be emitted as a blank line?

For example, consider this snippet:
<ul>
@foreach var foo in bar {
<li>@foo.Title</li>
}
</ul>

Will my output be the following:
<ul>
<li>Stuff</li>
<li>Stuff 2</li>
<li>Stuff 3</li>
</ul>


or:
<ul>

<li>Stuff</li>
<li>Stuff 2</li>
<li>Stuff 3</li>

</ul>
Requesting Gravatar... redsquare Dec 03, 2010 2:34 AM
# re: ASP.NET MVC 3 Release Candidate
ScottGu is much better at responding to comments. Why allow comments if you never reply!!! C'mon Phil
Requesting Gravatar... haacked Dec 03, 2010 8:28 AM
# re: ASP.NET MVC 3 Release Candidate
@redsquare Hey, I reply! I just take more time. :) The jQuery template engine is going to be rolled into jQuery eventually. So yeah, we'll probably include it in MVC 4.
Requesting Gravatar... MickaelDS Mar 24, 2011 5:42 PM
# re: ASP.NET MVC 3 Release Candidate
The future of web development!

http://mickaelds.blogspot.com
Comments have been closed on this topic.