You are browsing the archive for Software Development.

by Editor

New NuGet.org Deployed!

December 6, 2011 in Articles, News, Reference, Software Development

So my last day at Microsoft ended up being a very long one as the NuGet team worked late into the evening to deployan updated version of NuGet.org. I’m very happy to be a part of this as my last act as a Microsoft employee. This is complete re-write of the gallery. Why a rewrite? We’ve learned a lot since we first launched, and our needs have evolved to the point where a rewrite made sense. The new implementation is a vanilla ASP.NET MVC 3 application and highly optimized to be a gallery with just the features we need. For example, we made extensive use of Mvc Mini Profiler to ensure pages made the least number of database queries as necessary. Also, the site is now hosted in Azure! What’s in this new implementation? There’s a lot of great improvements…(read more)

by Editor

Razor Donut Caching

November 26, 2011 in Articles, ASP.NET, ASP.NET MVC, aspnetmvc, News, Reference, Software Development

Donut caching, the ability to cache an entire page except for a small region of the page (or set of regions) has been conspicuously absent from ASP.NET MVC since version 2 . Mmmmm, donuts! – Photo by Pzado at sxc.hu This is something that’s on our Roadmap for ASP.NET MVC 4, but we have yet to flesh out the design. In the meanwhile, there’s a new NuGet package written by Paul Hiles that brings donut caching to ASP.NET MVC 3 . I haven’t tried it myself yet, so be forewarned, but judging by the blog post, Paul has done some extensive research into how output caching works. One issue with his approach is that to create “donut holes”, you need to call an action from within your view. That works for ASP.NET MVC, but not for ASP.NET Web Pages. What…(read more)

by Editor

Musings On Software Community

November 25, 2011 in Articles, News, Reference, Software Development

While attending Oredev 2011 , I had an interesting conversation with Corey Haines about his perception of the Ruby community as compared to the .NET community. One thing he suggested is that the .NET community is seems a bit insular and self-isolating. He noted that when he attended .NET user groups, he only saw folks he knew to be .NET developers. But when he attends Ruby, Scala, NodeJS, Erlang, etc. user groups, he sees many of the same people at these meet ups. While I’m not completely against identifying oneself as a .NET developer to indicate your primary focus, I do see what Corey is getting at. Rather than only seeing ourselves as .NET developers, it’s just as important to also see ourselves as software developers. We should recognize…(read more)

by Editor

Specs for Haacked.com

November 19, 2011 in Articles, ASP.NET, IIS, News, Reference, Software Development

Once in a while folks ask me for details about the hardware and software that hosts my blog. Rather than write about it, a photo can provide all the details that you need. There you have it. Well actually TM , my blog runs on a bit more hardware than that these days. Especially after the Great Hard-Drive Failure of 2009. As longtime readers of my blog might remember, nearly two years ago, this blog went down in flames due to a faulty hard-drive on the hosting server. My hosting provider, CrystalTech (now rebranded to be the Web Services home of The Small Business Authority ), took regular backups of the server, but I hosted my blog in a virtual machine. As it turns out, the backups did not include the VM because it was always “in use”. In order…(read more)

by Editor

Implementing an Authorization Attribute for WCF Web API

October 20, 2011 in Articles, ASP.NET, News, Reference, Security, Software Development

If you’re not familiar with WCF Web API , it’s a framework with nice HTTP abstractions used to expose simple HTTP services over the web. It’s focus is targeted at applications that provide HTTP services for various clients such as mobile devices, browsers, desktop applications. In some ways, it’s similar to ASP.NET MVC as it was developed with testability and extensibility in mind. There are some concepts that are similar to ASP.NET MVC, but with a twist. For example, where ASP.NET MVC has filters, WCF has operation handlers. One question that comes up often with Web API is how do you authenticate requests? Well, you run Web API on ASP.NET (Web API also supports a self-host model), one approach you could take is to write an operation handler…(read more)

by Editor

The Dangers of Implementing Recurring Background Tasks In ASP.NET

October 17, 2011 in Articles, ASP.NET, News, Reference, Software Development

I like to live life on the wild side. No, I don’t base jump off of buildings or invest in speculative tranches made up of junk stock derivatives. What I do is attempt to run recurring background tasks within an ASP.NET application. Writing code is totally just like this – Photo by DVIDSHUB – CC BY 2.0 But before I do anything wild with ASP.NET, I always talk to my colleague, Levi (sadly, no blog). As a developer on the internals of ASP.NET, he knows a huge amount about it, especially the potential pitfalls. He’s also quite the security guru. As you read this sentence, he just guessed your passwords. All of them. When he got wind of my plan, he let me know it was evil, unsupported by ASP.NET and just might kill a cat. Good thing I’m a dog person…(read more)

by Editor

Four Years At Microsoft

October 15, 2011 in Articles, News, Reference, Software Development

Today, October 15 2011, marks four years of being a Microsoft employee for me. As such, it’s time for a little introspection, but in many ways, Tim Heuer already introspected for me . Much of what he writes echoes my own experience, thus leaving me with less to write about. It’s the Microsoft way, or the highway. Which is conveniently located near Microsoft Way. – Photo by Todd Bishop , CC BY 2.0 Looking back in my archives, I realized I haven’t written a whole lot about what it’s like to work here. I do have a few posts such as… My announcement about being hired . I was really floored by the number of folks who commented (112) to wish me well. Thank you! Not long after, I blogged about drinking from the firehose . I blogged again at the one…(read more)

by Editor

Preventing CSRF With Ajax

October 11, 2011 in Ajax, Articles, ASP.NET, ASP.NET MVC, aspnetmvc, News, Reference, Security, Software Development

A long while ago I wrote about the potential dangers of Cross-site Request Forgery attacks, also known as CSRF or XSRF. These exploits are a form of confused deputy attack . Screen grab from The Police Academy movie. In that post, I covered how ASP.NET MVC includes a set of anti-forgery helpers to help mitigate such exploits. The helpers include an HTML helper meant to be called in the form that renders a hidden input, and an attribute applied to the controller action to protect. These helpers work great when in a typical HTML form post to an action method scenario. But what if your HTML page posts JSON data to an action instead of posting a form? How do these helpers help in that case? You can try to apply the ValidateAntiForgeryTokenAttribute…(read more)

by Editor

Prevent Forms Authentication Login Page Redirect When You Don’t Want It

October 4, 2011 in Articles, ASP.NET, ASP.NET MVC, aspnetmvc, News, Reference, Software Development

Go that way instead – Photo by JacobEnos CC some rights reserved In an ASP.NET web application, it’s very common to write some jQuery code that makes an HTTP request to some URL (a lightweight service) in order to retrieve some data. That URL might be handled by an ASP.NET MVC controller action, a Web API operation, or even an ASP.NET Web Page or Web Form. If it can return curly brackets, it can be respond to a JavaScript request for JSON. One pain point when hosting lightweight HTTP services on ASP.NET is making a request to a URL that requires authentication. Let’s look at a snippet of jQuery to illustrate what I mean. The following code makes a request to /admin/secret/data . Let’s assume that URL points to an ASP.NET MVC action with the…(read more)

by Editor

Prevent Forms Authentication Login Page Redirect When You Don’t Want It

October 4, 2011 in Articles, ASP.NET, ASP.NET MVC, aspnetmvc, News, Reference, Software Development

Go that way instead – Photo by JacobEnos CC some rights reserved In an ASP.NET web application, it’s very common to write some jQuery code that makes an HTTP request to some URL (a lightweight service) in order to retrieve some data. That URL might be handled by an ASP.NET MVC controller action, a Web API operation, or even an ASP.NET Web Page or Web Form. If it can return curly brackets, it can be respond to a JavaScript request for JSON. One pain point when hosting lightweight HTTP services on ASP.NET is making a request to a URL that requires authentication. Let’s look at a snippet of jQuery to illustrate what I mean. The following code makes a request to /admin/secret/data . Let’s assume that URL points to an ASP.NET MVC action with the…(read more)