Archives
-
My wife and I recorded a Christmas song: Twelve Days of the Partridge
Since 2007, my wife and I have been contributing a song to the Familyre Christmas compilation albums. You can download this year's for free, and you can play them all online on Bandcamp. My wife had written original songs each previous year; this year I suggested we just record a classic like The Twelve Days of Christmas.
-
Working around a Powershell Call Depth Disaster With Trampolines
I just posted about an update to my NuGet package downloader script which included a few fixes, including a fix to handle paging. That sounds boring, but wait until you hear about the trampolines.
-
NuGet PowerShell Downloader Update - Adding Failed Download Retries, Better Paging Support
I previously posted a NuGet PowerShell downloader script, which is handy for downloading a local NuGet repository. There are several common uses:
-
A look back at the ASP.NET site through the years
While writing up the release post for the new ASP.NET website, I started thinking about the site's changed over the years, and that lead me on a brief excursion through the Wayback Machine history of the ASP.NET home page. Here are some highlights:
-
ASP.NET website redesign: Now with less Beta, more Live
Back in October, I posted about the beta release of the ASP.NET website redesign at beta.asp.net. Since then, we've listened to a lot of great feedback, ruthlessly evaluated a huge catalog of content, and continued to reorganize things so you can more easily find useful content. That redesign just graduated from beta to live today.
-
Leveraging Background Services and Agents in Windows Phone 7 (Mango)
Earlier this month at DevConnections, I gave a presentation on Background Services and Agents in Windows Phone 7. The next week, I got to join Jesse Liberty on his podcast interviewing Peter Torr, a Prinicpal Product Manager on the Windows Phone team who's written a lot of great content about this exact subject.
-
15 Pragmatic JavaScript Tips for ASP.NET Developers
The goal here is pragmatic tips - things you can use right away. Three or four are specific to ASP.NET Web Forms, the rest are pretty cross-cutting and in some cases apply to any web development platform. These are pragmatic tips, not advanced JavaScript development or coding practices, although I did sneak in a bit of SignalR, Node.js, and CoffeeScript at the end. If you're looking for coding practices, I'd highly recommend Elijah Manor's MIX11 talk: Good JavaScript Habits for C# Developers.
-
Using Node.js in an ASP.NET MVC application with iisnode
Node.js is an event-driven I/O server-side JavaScript environment based on the open-source V8 Javascript engine. It's really easy to run it on Windows now, and if you run it under iisnode, it's actually running under a standard IIS Handler, which means you can integrate it directly into ASP.NET applications.
-
Taking a look at the HTML5 video use in the Bing video homepage
I've always liked the pictures on the Bing homepage. In late September, they started occasionally replacing the picture with an HTML5 video. The Bing team blogged about it, and included an interesting video from the managing editor for the Bing homepage that talks about how they select photos and why they're going to start adding the occasional video backgrounds.
-
ASP.NET website redesign beta: What's changed, why, and how you can make it better
We're happy to announce the beta release of something we've been quietly working on for a while now: a redesign for the ASP.NET website (http://asp.net). You can browse directly to it at http://beta.asp.net, or if you're on the http://asp.net site you can click on the "Try the NEW beta site" link in the header.
-
ASP.NET MVC 4 Overview - Part 2: Default template changes and Adaptive Rendering using Viewport and CSS Media Queries
This is Part 2 of a series overviewing changes in ASP.NET MVC 4. In Part 1, we looked at installation and new options in creating a new project. In Part 2, we'll look at changes to the default project template and how it uses adaptive rendering to optimize the display for the end user's browser dimensions.
-
ASP.NET MVC 4 Overview - Part 1: Installing ASP.NET MVC 4 and creating a new project
I'm starting a series going through some new features in ASP.NET MVC 4. I may accidentally build a working application along the way, for some value of working. Probably not, though. The main goal is to overview what's in ASP.NET MVC 4.
-
Jon talks ASP.NET MVC 4, ASP.NET 4.5, ASP.NET Web Pages 2, and Visual Studio 11 on Jesse Liberty's "Yet Another Podcast"
Jesse Liberty interviewed me about all the new Developer Preview releases for web developers. He asked me a lot of great questions over the course of a 45 minute interview.
-
Get the scoop on the ASP.NET 4.5, ASP.NET MVC 4, ASP.NET Web Pages 2, and Visual Studio 11 Developer Previews
We just announced a lot of great new information about ASP.NET 4.5, ASP.NET MVC 4, and Visual Web Developer 11. Here's an overview of what's available, how to get it, and some of the top features.
-
Writing Technical Books
I just posted about my experiences writing my third technical book, Wrox Professional ASP.NET MVC 3, along with Phil Haack, Brad Wilson, and K. Scott Allen. We had a general discussion on the latest episode of Herding Code with the Wrox MVC 3 book authors and Jesse Liberty, author of three dozen odd books.
-
Wrox Professional ASP.NET MVC 3 - A look back, a request for input, and a treasure hunt for a free copy
Professional ASP.NET MVC 3 has been available on Amazon for a few weeks now. It's had a pretty wild ride so far, including being listed as the top selling book Programming book on Amazon, followed by the Kindle version in second place. For a few crazy days, it was one of the top 1000 books across all of Amazon - take that, Herman Melville!
-
An introduction to CoffeeScript
I first heard about CoffeeScript over a year ago, when we talked to Chris Williams about JsConf 2010, but it's really blown up lately. The official CoffeeScript website, CoffeeScript.org, sums it up beautifully:
-
My ASP.NET news sources
I just posted about the ASP.NET Daily Community Spotlight. I was going to list a bunch of my news sources at the end, but figured this deserves a separate post. I've been following a lot of development blogs for a long time - for a while I subscribed to over 1500 feeds and read them all. That doesn't scale very well, though, and it's really time consuming. Since the community spotlight requires an interesting ASP.NET post every day of the year, I've come up with a few sources of ASP.NET news.
-
The ASP.NET Daily Community Spotlight - How posts get there, and how to make it your Visual Studio Start Page
One really cool part of my job is selecting the articles for the Daily Community Spotlight, on the home page of the ASP.NET website. The spotlight highlights a new post about ASP.NET development every day from a member of the ASP.NET community. You can find it on the home page of the ASP.NET site, at http://asp.net
-
Submitting a drive-by commit to a GitHub project in under 5 minutes
I recently mentioned how I contributed C# syntax for CodeMirror; what I didn't talk about was how incredibly easy it was. I think the biggest obstacles to open source contribution are:
-
Herding Code podcast update: 3 years, 115 episodes and 25TB of traffic later...
Back in May 2008, K. Scott Allen accidentally called my on Skype, and we joked that we should start a podcast. And then we did - we roped in Kevin Dente and Scott Koon since the four of us tended to argue quite a bit on Twitter anyways - and kind of figured it out as we went along. Along the way, we've recorded 115 episodes (pretty much an entire week of audio), discussed the comings and goings of myriad technologies, and had the opportunity to talk to some incredible guests.
-
Using CodeMirror to add C# syntax highlighting to an editable HTML Textarea
I wanted to display some C# code in an html <textarea> control that was displayed in an ASP MVC 3 application using @Html.TextArea():
-
Getting Mono compiler output in a web application using StreamReportPrinter
I've been continuing my experiment with Mono's compiler as a service in an ASP.NET MVC application and making pretty good progress. One of the difficulties I ran into along the way was in troubleshooting compiler errors when I'd deployed the application. Almost all of the content and documentation on Mono.CSharp is in a console application / REPL scenario, which doesn't help in tracking down errors in a web application.
-
C# and VB.NET - Differing namespace conventions
Recently, while reviewing the VB.NET translation of the MVC Music Store tutorial, I noticed that none of the controllers / models / classes in general have namespaces. I was going to blow up on the person who did the translation like a bad FxCop, but I fired up a new MVC 3 / VB.NET app and saw the project template doesn't use namespaces, and that the New Controller wizard doesn't use a namespace, etc. After checking with the ASP.NET team, I decided to post the VB.NET source code without explicit namespaces in each class, because that's how the code would look if you followed the steps in the tutorial.
-
Dynamic ASP.NET MVC 3 models using Mono’s Compiler as a Service
I had an idea for an interactive MVC sample which will let you see the scaffolded editor and display for a model. I thought about a few ways to do this, the first being Mono’s compiler as a service. So far it’s a partial success – the model scaffolding works, but the attributes don’t (very possibly my mistake).
-
Tips for avoiding e-mail disasters
There's something about hitting the send button on an e-mail that remind me of some important detail, such as:
-
Copying Windows Live Writer accounts to another computer
I'm setting up a new laptop and needed to copy my Windows Live Writer accounts over. I've run through the Writer "add a blog" wizard so many times over the years and always wondered if there were a less tedious way to add all my blog settings at once. I first looked at an Import and Export Wizard for Windows Live Writer program, but it didn't seem to work. It turns out that it's pretty simple to do this manually using a registry file.
-
MVC Music Store Updates - MVC 3 Tools Update Features, Scaffolding, Save Points, VB.NET Code
The latest drop of the Mvc Music Store tutorial cover the ASP.NET MVC 3 Tools Update, Scaffolding, Entity Framework Code First, SQL Server CE, and more. Additionally, this drop includes a VB.NET translation of the finished project as well as save points how the code should look when you complete each section.
-
Looking at how the ASP.NET MVC Authorize interacts with ASP.NET Forms Authorization
ASP.NET MVC includes an [Authorize] attribute, which when placed on any controller actions will forbid unauthorized access. The AuthorizeAttribute allows you to specify a list of roles or users, like this:
-
Preventing Javascript Encoding XSS attacks in ASP.NET MVC
I just posted about cross-site scripting, or XSS attacks, in ASP.NET - take a quick look at that post for some background on XSS attacks. I wanted to take a deeper look at Javascript Encoding XSS attacks. They're a particularly tricky form of XSS, since Javascript encoded values are valid HTML and will pass through default HTML encoding. Here's an example - let's assume we want to add a special welcome message to our home page if a UserName parameter is present so we can send out personalized links to the site in an e-mail promotion. We start by modifying the HomeController / Index method:
-
Using AntiXSS 4.1 Beta as the Default Encoder in ASP.NET
Cross-site scripting attacks, or XSS, are a common web application vulnerability in which an attacker uses your website to present malicious code to another user. OWASP sums it up like this:
-
Better ways to watch the MIX11 videos, Part 2: PowerShell
I just posted about my favorite way to watch videos: streaming the playlist at high speed using VLC. But there are times where you'd like a local copy of the videos, too, e.g. watching them while commuting without internet access.
-
Better ways to watch the MIX11 videos, Part 1: VLC
I'm still catching up on all the great content at MIX 11. There is a ton of great content - 116 videos when I last looked. Scott Hanselman already posted a great summary of ways to get and watch them. With this many videos to watch, though, you might want to bring out some big guns, and that's what this post is all about.
-
Hear me talk about MVC 3 on Jesse Liberty's Yet Another Podcast
Jesse Liberty interviewed me about ASP.NET MVC 3 recently on Yet Another Podcast. It was a lot of fun being a guest on a podcast for a change. Here are some of the highlights:
-
Comparing MVC 3 Helpers: Using Extension Methods and Declarative Razor @helper Syntax
HTML Helpers provide a clean way to encapsulate view code so you can keep your views simple and markup focused. There are lots of built in HTML Helpers in the System.Web.Mvc.HtmlHelper class, but one of the best features is that you can easily create your own helpers. While you've been able to create your own helpers since MVC 1 using extension methods, the Razor view engine gives you a new option to create helpers using the @helper keyword.
-
ASP.NET MVC 3 Roundup of Tutorials, Videos, Labs, and other Assorted Training Materials
I've answered the "Where can I learn about MVC 3" question enough that it's time for a blog post.
-
Web Platform Installer bundles for Visual Studio 2010 SP1 - and how you can build your own WebPI bundles
Visual Studio SP1 is now available via the Web Platform Installer, which means you've got three options:
-
Converting a Powershell script to a NuGet command
Last week I posted about the NuGet.Downloader package, which had begun life as a Powershell script. If you've got a Powershell commands that you'd like to make available in NuGet packages, here's how.
-
Nuget.Downloader package - Download a local NuGet repository using Nuget
NuGet supports multiple feeds, running against either a server or a simple folder / fileshare. See Phil Haack's post explaining both options for more information. I'm a big believer in running your own local NuGet feed for a lot of reasons - offline access, control over updates, and as an absolute must-have for demonstrations and training. I previously wrote up a NuGet Powershell script which pages through the NuGet OData feed and downloads local copies of the packages. It's a little more complex than you'd guess, since the script needs to follow redirections and page links, plus I added in some options to skip downloads for features you've got, only grab the most popular X packages, etc.
-
Tips on installing Visual Studio 2010 SP1
UPDATED 3/14/2011 with Web Platform Installer links
-
Generating EF Code First model classes from an existing database
Entity Framework Code First is a lightweight way to "turn on" data access for a simple CLR class. As the name implies, the intended use is that you're writing the code first and thinking about the database later.
-
IE9 RC fixed the “Internet Explorer cannot display the webpage” error when running an ASP.NET application in Visual Studio
One of the obstacles ASP.NET developers faced in using the Internet Explorer 9 Beta was the dreaded “Internet Explorer cannot display the webpage” error when running an ASP.NET application in Visual Studio.
-
Download mvcConf session videos with a PowerShell script (should work with other Channel 9 feeds, too)
I tweaked my NuGet downloader PowerShell script to handle the Channel 9 media feeds, so you can grab a local copy of all session videos in the format of your choice:
-
mvcConf 2 - All session videos are up, time for a recap
Thanks for making mvcConf 2 a much bigger success than we'd ever anticipated! mvcConf grew out of the C4MVC meetings, with the first mvcConf event in July 2010. Following that event, we talked about what went well and what we'd like to do for the next event, and we all agreed that we wanted to go for it and see how big we could expand. Here's how the progression went:
-
Learn ASP.NET MVC 3 with the MVC Music Store tutorial
Now is a great time to learn ASP.NET MVC. ASP.NET MVC 3 combined with NuGet have made the start-to-finish process of building out a website a lot simpler. If you’d like to see what’s new in ASP.NET MVC 3 and NuGet, or if you’ve never done ASP.NET MVC development, I think the MVC Music Store is a great place to start.
-
Top 10 reasons to get excited about mvcConf (the Virtual ASP.NET MVC Conference) on February 8, 2011
mvcConf is a free, all day community run virtual conference on 2/8/2011. If you haven’t registered yet, grab one of the last remaining tickets quick – they’re going fast!
-
Downloading a local NuGet repository with PowerShell
Update: This is now available as a NuGet package - NuGet.Downloader.
-
Preventing Open Redirection Attacks in ASP.NET MVC
ASP.NET MVC 3 includes a new change in the the Account Controller to prevent open redirection attacks. After explaining how open redirection attacks work, I'll This tutorial explains how you can prevent open redirection attacks in your ASP.NET MVC applications. This tutorial discusses the changes that have been made in the AccountController in ASP.NET MVC 3 and demonstrates how you can apply these changes in your existing ASP.NET MVC 1.0 and 2 applications.
-
FIX: WCF Data Service with Entity Framework Code-First DbContext doesn’t accept updates
The Entity Framework Code First DbContext doesn’t expose the interfaces to support updates when exposed via WCF Data Services. Attempting to save changes results in a fault with the message "The data source must implement IUpdatable or IDataServiceUpdateProvider to support updates." The fix is to alter your WCF Data Service to expose the DbContext's underlying ObjectContext and to disable proxy generation.
-
Web Camps India
I had the opportunity to help lead two Web Camps in India with James Senior in November.
-
ASP.NET MVC 3–What’s in it for you?
ASP.NET MVC 3 was released on January 13. You've probably seen the blog posts, especially:
-
Entity Framework Code-First, OData & Windows Phone Client
Entity Framework Code-First is the coolest thing since sliced bread, Windows Phone is the hottest thing since Tickle-Me-Elmo and OData is just too great to ignore.