.NET Blog

Free. Cross-platform. Open source. A developer platform for building all your apps.

Latest posts

Apr 3, 2013
Post comments count 4
Post likes count 1

Tasks, Monads, and LINQ

Stephen Toub - MSFT

A few years back, Wes Dyer wrote a great post on monads, and more recently, Eric Lippert wrote a terrific blog series exploring monads and C#. In that series, Eric alluded to Task<TResult> several times, so I thought I’d share a few related thoughts on Task<TResult> and the async/await keywords.As both Wes and Eric highlight, a monad is a triple consisting of a type, a Unit function (often called Return), and a Bind function. If the type in question is Task<T>, what are its Unit and Bind functions? The Unit operator takes a T and “amplifies” it into an instance of the type: p...

Mar 28, 2013
Post comments count 0
Post likes count 0

Tutorial Series on Model Binding with ASP.NET Web Forms

Tom FitzMacken - MSFT

I have written a tutorial series that shows how to use model binding with ASP.NET Web Forms. You might be familiar with the model binding concept from ASP.NET MVC, but with ASP.NET 4.5, model binding is now available in Web Forms applications. Model binding makes it very easy to create and maintain data-rich web pages. A lot of the manual steps of correlating elements with data properties are performed automatically. When you use model binding with dynamic data templates, you can quickly add or revise properties in your data model and those properties are correctly ren...

Mar 25, 2013
Post comments count 0
Post likes count 0

ASP.NET MVC Facebook Birthday App

Rick_Anderson

Tom Dykstra and I have published a really cool tutorial on creating a MVC FB birthday app. You can test the app out by clicking on the FB link below:https://apps.facebook.com/birthdayapp-mvc/The image below shows the birthday app.Yao Huang Lin  is the principal developer for the ASP.NET MVC Facebook library and templates and he also wrote the sample used in this tutorial (so you can be sure it’s using best practices.)The tutorial shows you how to: As always, we appreciate feedback. Follow me ( @RickAndMSFT )   on twitter where I have a no spam guarantee of quality tweets.

Mar 25, 2013
Post comments count 0
Post likes count 0

Improved search syntax on nuget.org and in NuGet Visual Studio extension

Luan Nguyen

The NuGet team recently deployed a new and very useful search capability on nuget.org, which allows you to narrow your search to a pariticular attribute of a NuGet package. For example, if you want to search for packages which contain 'elmah' within the Id, you type 'id:elmah'. (Note that this will execute a 'contains' search, not an exact match search. Which means it will return elmah, elmah.corelibrary, etc.) Similarly you can use the same syntax to search for other attributes in the package metadata. Here's the complete list of supported attributes: Note that when a search query contains spaces, the galler...

Mar 13, 2013
Post comments count 0
Post likes count 2

“Invoke the method with await”… ugh!

Stephen Toub - MSFT

I can be a bit sensitive when it comes to language and how concepts are conveyed.  I think it’s important to be accurate, even if not precise, when describing what something is or how to use it, as otherwise the folks to whom you’re communicating can easily form the wrong mental model for that thing.  Having a good mental model for something is important in then being able to reason about the thing in question and to correctly infer other uses and behaviors.That’s why I frequently cringe when I hear someone say something like “invoke the method using 'await'”.  The com...

Mar 12, 2013
Post comments count 0
Post likes count 0

Deploy a Secure ASP.NET MVC application with OAuth, Membership and SQL Database

Rick_Anderson

I’ve published a tutorial shows you how to build a secure ASP.NET MVC 4 web application that enables users to log in with credentials from Facebook, Yahoo, and Google and deploy the application to Windows Azure. This tutorial assumes that you have no prior experience using Windows Azure. On completing this tutorial, you'll have a secure data-driven web application up and running in the cloud and using a cloud database. You'll learn: You'll build a simple contact list web application that is built on ASP.NET MVC 4 and uses the ADO.NET Entity Framework for database access. The following...

Mar 7, 2013
Post comments count 0
Post likes count 0

ASP.NET Web API: Using Namespaces to Version Web APIs

Mike Wasson [MSFT]

In this post, I’ll show how to extend the routing logic in ASP.NET Web API, by creating a custom controller selector. Suppose that you want to version your web API by defining URIs like the following: /api/v1/products/ /api/v2/products/ You might try to make this work by creating two different “Products” controllers, and placing them in separate namespaces: The problem with this approach is that Web API finds controllers by class name, ignoring the namespace. So there’s no way to make this work using the default routing logic. Fortunately, Web API makes it easy to change the default behav...

Mar 6, 2013
Post comments count 0
Post likes count 0

Visual Studio Web Deployment Tutorial Series Updated for Windows Azure and LocalDB

Tom Dykstra - MSFT

This week we published an updated version of the popular 12-part tutorial series that shows how to deploy an ASP.NET web application with SQL Server databases. Here are links to the new tutorials, with notes about what’s in them and what’s new: Feedback is welcome; you can post comments here or on the tutorials themselves.-- Tom Dy...

Mar 4, 2013
Post comments count 0
Post likes count 0

Disabling Knockout Intellisense

VKichline

Update 4/4/2013: This problem is fixed in Visual Studio 2012 Update 2 (VS2012.2). If the internal JavaScript engine could not figure out the IntelliSense in one second, VS will time out instead of keep evaluating (which in some cases can slow down VS significantly).  If it happens, some KnockoutJS IntelliSense will not be shown in the editor.  There are some workarounds you can do in order to show the knockout IntelliSense in time for such cases, such as using JavaScript XML documentation comments to speed up the IntelliSense evaluation.  For example, the following green comment will bypass the JQueryUI autocompl...