An Interesting List of Development Stuff (April 2014)

ILODS - April

In this month’s installment of the ILODS, we take a look a quite a few announcements that were made at Microsoft’s Build conference, articles to help you figure out if you are over-thinking your development projects or if you are simply blaming the guy that was there before you, the Heartbleed bug, Javascript, open-sourcing, New Orleans and much, much more.

Knowing Too Much to Code

It’s not very often that we associate experience with in inability to get something done, however it may be the case in what Scott Hanselman calls “Analysis Paralysis”. In this blog post, Scott discusses how more experienced developers might “over-think” many sometimes simple applications and make them far more complex than they need to be. He reminds us to ask ourselves “are we going to need that” throughout the development process to help curb this paralysis from affecting our productivity.

From “Potent Potables” to the Human Genome

Although it isn’t directly development-related, it’s always fun to see what development can actually result in. Any fans of Jeopardy should remember the cerebral beat-down served by IBM’s Watson to trivia wizards : Ken Jennings and Brad Rutter (primarily thanks to its insane robot buzzer reflexes). However, it now appears that Watson is now on our side and it’s opponent is a nasty one : cancer.

IBM hopes that Watson will be able to analyze millions of medical records and find correlations between cancer patients that might be impossible for human analysis to discover. Hopefully, this data-first approach may lead to new treatment methods and may help Watson solve one of our generations most challenging questions : finding a cure to cancer.

Extensions. Extensions Everywhere!

In his talk at //Build this yearMads Kristensen discussed the myriad of different tools and extensions available for Visual Studio that can help developers be more productive and in general make their lives easier. The list has extensions that cover a wide variety of topics such as productivity, templating, styling and more. I would highly recommend checking it out to see if you discover anything that makes you say “I’ve been looking for something like that!”.

And the Two Become One : Durandel and Angular Converge!

In this article, Rob Eisenberg (the creator of Durandel) discusses the differences and similarities between Durandel and the popular Angular Javascript frameworks in hopes of providing a response to “Which one should I use?”. He covers an ideal framework that merges many of the stronger features from each framework and how this convergence will help shape the futures of both of the respective libraries.

Change Your Password. Probably. 

One of the largest stories of this month has been the uprising of a nasty bug known as Heartbleed. The Heartbleed bug itself is a vulnerability within the popular OpenSSL cryptographic library and it basically leaves systems using it “exposed” and allows virtually anyone access to any secrets that might be housed behind the normally secure SSL walls if exploited.

If you are unsure if you might need to change your password or if you would like an idea at the popular systems that were affected, you may want to check out this link which details many popular sites to determine if you need to change your password. Additionally, you will want to ensure that you don’t change your password until the affected site has been properly patched and their certificates have been renewed.

Since this is a .NET specific blog, I will note that if you are using IIS then you have nothing to worry about as Microsoft uses schannel to handle all of its SSL needs.

Meet New Orleans.

This has nothing to do with the city in my home state and has everything to do with building highly-scalable Azure based applications. In this article, the ASP.NET team reintroduces project “Orleans”, which provides an approach to building high-scale applications using a service-based model. The project was used heavily within the popular Halo game series to help it achieve its massive scalability needs. It’s openly available currently, so you can head over an visit the project on CodePlex and check out if it may fit the bill for the needs of one of your current or upcoming projects.

Building Javascript Applications like a Superhero!

If you like Javascript and you have a strong desire to build them like a superhero, then this might be just the thing for you. The team at Superhero.js compiled a huge assortment of  resources relating to building and maintaining large-scale Javascript applications, organizing your code and utilizing the appropriate patterns, testing your applications and much, much more.

Introducing IdentityManager

In this post, security guru Brock Allen introduces his most recent creation : IdentityManager, a tool to help manage user identity data through the new ASP.NET Identity or his own MembershipReboot library. IdentityManager provides an extremely easy to use interface that should replace the recently departed ASP.NET Web Site Administration tool that many developers were extremely fond of in Visual Studio 2012. It supports user creation, password changes, e-mail, phone, claims and much, much more.

Passing the Blame.

Shamoon Siddiqui discusses why the latest developer at your company might seem like a wizard when compared to your previous developer. This piece covers a wide array of reasons why developers shouldn’t always be compared to one another or why one shouldn’t be necessarily blamed for decisions that were made at the time (hindsight is 20/20). It’s a solid article for any developer that can often be caught blaming others for their decisions without necessarily knowing what it was like being in their shoes.

The .NET Foundation and Open-Source

Another major announcement at the Build conference was the introduction of the .NET Foundation, a collection of open-source technologies and Microsoft’s development framework. It was established to help foster community involvement, collaboration and development with regards to open-source applications and to help bolster the relationship between Microsoft and the open-source community.

A wide range of Microsoft’s technologies within the .NET stack have already been open-sourced such as ASP.NET MVC, SignalR, Web API and even the powerful Roslyn compiler-as-a-service. If you want to dig around the source and see how some of the technologies were established, visit the link above and dive into the technology of your choice.

Additionally, the entire source of the .NET Framework is available as well that interests you and can be accessed through the Reference Source site here.

 

Debugging Deeper through Reference Source

Debugging Deepr

A little over a month ago, the ASP.NET team announced several changes and updates to the .NET Reference Source and in this post we are going to discuss how to actually integrate it into Visual Studio so that you can step into the actual .NET Framework source when debugging your applications.

What is Reference Source again?

Reference Source, if you are unfamiliar with it, was a project that Scott Guthrie and his team started back in 2007 in hopes of releasing the .NET Framework source to allow developers to easily reference it (without all kinds of decompilation and mischief) to see what was really going on under the hood. Shortly after that release, the team made a few changes that would allow developers to actually step through the source code which was a major step in a very cool direction.

One of the major difficulties with managing something that is constantly evolving like the .NET Framework is purely the fact that it is “constantly evolving”. Updating documentation usually takes time and with a project of this magnitude, it could simply be something that is “left over until the end” or simply doesn’t get done :

Reference Source circa 2007.

Reference Source circa 2007 via Scott Guthrie

Reference Source Meets Roslyn.

As part of this year’s announcement regarding Reference Source, it was mentioned that it would be joining forces with Microsoft’s latest development wonder, Roslyn.

Roslyn is a managed compiler-as-a-service that has really flipped the script in the .NET world recently. It provides all kinds of wonderful features that were simply not possible in previous years and has already been used not only by Microsoft but in many other arenas such as .NETFiddle, Bing Code Search, Semantic Merge and more. Roslyn was used to help generate a semantic index of the entire .NET Framework source to allow it to be searched through with the greatest of ease.

Currently, .NET 4.5.1 is indexed and readily available on the Reference Source site and the ASP.NET team announced a commitment to keep things updated with each upcoming release as they occur to prevent any stagnation that may have plagued the previous versions of the tool. So you can be relatively sure that whenever you are accessing the latest version of the Reference Source that it should be the latest and greatest. The improvements were not limited to just performance either.

The UI received a very stylish overhaul as well and yield some of the nicest looking documentation that you’ll come across :

The New and Improved Reference Source

The New and Improved Reference Source

Another undocumented feature is the tiny snippets of entertaining comments that you can find scattered throughout the source as well :

An example of one of the many entertaining comments throughout the source.

An example of one of the many entertaining comments throughout the source.

Putting it to Good Use.

Let’s actually put the Reference Source to use along with Visual Studio 2013 and use it to debug an application by not only stepping through our own code, but into the source of the .NET Framework as well.

To get started, there are a few changes we need to make within Visual Studio that will allow us to target the Reference Source (which will primarily consist of enabling and disabling a bunch of properties in the Options menu).

Open up Visual Studio and navigate on over to the options menu (Tools > Options > Debugging > General) as seen below :

You'll need to enable and disable the following options within the Debugging Options in Visual Studio

You’ll need to enable and disable the following options within the Debugging Options in Visual Studio

and then you are going to disable the following options :

  • Just My Code
  • Step over Properties and Operators (Managed Only)
  • Require Source Files to Exactly Match the Original Version

and enable these ones :

  • Enable .NET Framework Source Stepping
  • Enable Source Server Source

After making the changes, your options menu should look like this :

This is what your Debugging Options should look like prior to stepping through Reference Source

This is what your Debugging Options should look like prior to stepping through Reference Source

Then, you’ll need to make sure that when debugging that you are targeting the actual Visual Studio Reference Source. You can do this by visiting the Symbols area under options (Tools > Options > Debugging > Symbols) :

You'll need to access the Symbols area in order to use Reference Source when debugging

You’ll need to access the Symbols area in order to use Reference Source when debugging

From here, you’ll want to target the Reference Source symbols available at http://referencesource.microsoft.com/symbols. You’ll need to click the Add Symbols option within the Symbols area and add the previously mentioned URL :

Click the Folder icon and add the appropriate symbols reference for Reference Source

Click the Folder icon and add the appropriate symbols reference for Reference Source

What I have found to be a safer and more reliable approach however, is to simply download the source and reference it locally from the following location :

http://referencesource.microsoft.com/DotNetReferenceSource.zip

After making those changes, you’ll need to ensure that the project that you are going to be debugging is targeting .NET 4.5.1. Debugging through Reference Source is going to currently be limited to 4.5.1 and above since those are the only actual versions of the .NET source that have been indexed so far.

Looking Under the Hood.

Now that we have configured everything, let’s make a really simple program to demonstrate traveling through the source.

// Generate a collection of values (1-100)
var numbers = Enumerable.Range(1, 100);
// Order them randomly
numbers = numbers.OrderBy(n => Guid.NewGuid());
// Store these values in an array
var numberArray = numbers.ToArray();
// Sort the array
Array.Sort(numberArray);

Using the simple program above, we will create a collection of numbers, randomly order them, store them in an array and then finally sort them using a variety of methods.

Let’s place a breakpoint on the first line and run the program.

When you hit your first breakpoint, right-click on the method (in this case System.Linq.Enumerable.Range) and you should see an option within the context menu called “Step Into Specific” which will allow you to send the debugger into the .NET source for that particular method as seen below :

You can use the "Step into Specific > (Your Method)" option to debug through the .NET source.

You can use the “Step into Specific > (Your Method)” option to debug through the .NET source.

After selecting the method to step into through “Step into Specific”, you’ll see that the debugger jumps into the related .NET source and you can step through the method as you would expect within any other .NET application being debugged :

After using the "Step into Specific" option, you'll be presented with the source for your specific function, which you can debug as expected.

After using the “Step into Specific” option, you’ll be presented with the source for your specific function, which you can debug as expected.

And that’s basically all you need to know about using Reference Source within Visual Studio to debug your applications. You should be able to jump into any of the assemblies that are currently supported within Reference Source without any issue.

Considerations

A few other considerations if you are having trouble :

  • Debugging through Reference Source currently ONLY works for full versions of Visual Studio 2013 (sorry no Express versions). I’ve spoken with several members of the Visual Studio team and they are looking into possibly removing this restriction in the future.
  • Ensure that the assembly that you are attempting to step into is one of the available assemblies for debugging mentioned here.

If you still continue to encounter any errors or something isn’t working that you believe should – contact the Reference Source Feedback team via the “Feedback” link on the Reference Source page.

No April Fooling: Officially a Microsoft MVP.

mvp

April 1st is a day that is frequently dedicated to pranks, bogus news and tomfoolery.

Generally keeps everyone’s shields of skepticism on high alert and I consider myself to fall into this category. So I have to say that when I received an e-mail from Microsoft with the tagline of “Congratulations 2014 Microsoft MVP!” I was extremely hesitant (I mean what a terrible day to make an announcement on).

April Fools Joke? Nigerian Prince Scam? Or Legit?

April Fools Joke? Nigerian Prince Scam? Or Legit?

As I continued reading through the e-mail, I didn’t find any evidence that might require my bank account information or wire-transferring thousands of dollars to a Nigerian prince. In fact, things were beginning to look legitimate and that I might actually have received the award. A quick tweet to Dora Chan (the North American MVP Lead) quickly confirmed my suspicions and a small amount of celebration went down in my office :

Dora dispelling the possible April Fool's Myth.

Dora dispelling the possible April Fool’s Myth.

I was officially a Microsoft MVP for ASP.NET / IIS and I really couldn’t be more proud.

I’ve become very close with several MVPs primarily through my work in the ASP.NET Forums and I have a great deal of admiration for them. They are extremely smart and passionate people that dedicate days and hours of their lives to helping others learn and become better at what they do. I have looked up to several of these individuals every since I began contributing to the development community and I am extremely honored to be able to join the MVP ranks alongside them.

What the MVP Program Is? (this is primarily for my untechnical family members and friends)

To quote from the program’s page itself for those unfamiliar with the program :

The Microsoft Most Valuable Professional (MVP) Award is our way of saying thank you to exceptional, independent community leaders who share their passion, technical expertise, and real-world knowledge of Microsoft products with others. It is part of Microsoft’s commitment to supporting and enriching technical communities. Even before the rises of the Internet and social media, people have come together to willingly offer their ideas and best practices in technical communities.

How did you end up with one?

The simplest answer to this would revolve around the days (and likely weeks) of time that I spend in discussion groups, blogging, offline activities and contributing to the ASP.NET (and a few other) forums.

I’ve always been a fan of helping others in any ways that I could. My work on the forums has been extremely rewarding and it has yet to become tiresome (even averaging around an hour a day for a year and a half). I’ve met some great people that I can turn to for advice of my own and I’ve been able to mentor many novice developers and help point them in the right direction when they run into issues.

As far as how I actually ended up with the award… I was nominated by several users (some MVPs and some not) that encouraged me to pursue the actual award, believing that I would be a reasonable candidate for it. I was a bit hesitant at first, as I had heard the discussions behind the scenes regarding granting the award itself were extremely rigorous, but I figured “what the hell”.

So after a few months - I entered in all of my pertinent information, clicked send and basically forgot about it.

Thanks.

I am extremely honored to receive this award and it means a ton to me. So I figured I would throw out a handful of thanks since this is my blog and I can “do that” :

  • Thanks to my wife, Katie for putting up for my hours of sitting in bed with my face illuminated from a Surface as I answered questions all night.
  • Thanks to my employer, Structure X for being an awesome place to work for (and more specifically to Blane for being an incredible person to work for).
  • Thanks to my parents, obviously because I wouldn’t be here.
  • Thanks to my alma mater, McNeese State University for having a great Computer Science department that wasn’t actually afraid of Microsoft technologies like C#.
  • Thanks to the ASP.NET Forums and all of the people involved in it (the moderators, the MVPs, the management team and everyone who goes there to either ask questions or answer them).
  • Thanks to the academy, err… wrong speech.
  • Thanks to Microsoft for making a kick-ass platform like .NET that I really enjoy working on and for sending me the e-mail that brought this post about.

Finally, thanks to you, whoever you are, for reading my blog and helping make part of this possible as well. I appreciate you.

An Interesting List of Development Stuff (March 2014)

march2014

In this St. Patrick’s day installment of an Interesting List of Development Stuff, we dive into a more .NET-centric approach (with a majority of the topics at least being in the realm of .NET) but as usual, there should be something for everyone. The Roslyn compiler continues to make waves and appears in several of the articles (which we may see as a trend as it continues to grow in popularity) and there’s also a few articles pertaining to games (if that’s your thing).

Depixelizing Pixel Art

Microsoft Research is always doing cool stuff and this article is no exception. It discusses an algorithm that was developed to help smooth the appearance of pixelated images (mostly involving Nintendo-related characters) and it yielded some really neat results. I am sure that nothing excites people more than smooth pixels, but this article has everything : badass-looking video game characters (that we have always wondered what they would look like in their unpixelated glory), legit scholarly work on algorithms, splice curves and more (again decorated with video game characters) and its all packed into 8 pages.

I would highly encourage anyone interested to read through the actual paper itself and if that isn’t your thing, at least take a look at the supplemental material to see it in action.

ElasticLinq

Brad Wilson and Jim Newkirk of Tier 3 introduce their latest creation ElasticLinq, which is an open-source project that aims at integrating elastic-searching using LINQ syntax within .NET. It’s a tool that was originally developed in-house at Tier 3 to help ease the transition for developers with traditional database backgrounds to NoSQL-based databases and now hopefully it can help you make the transition as well!

How Roslyn and Azure Helped Create .NET Fiddle

I’ll use this as a pseudo-followup to my post last year on .NET Fiddle. .NET Fiddle has really taken off and added all kinds of awesome new features such as NuGet support, MVC support and all kinds the general badassery that one would look for in an online developmental sandbox. This short article isn’t so much about the merits of .NET Fiddle, but more of a look behind the scenes at how it came to be; you can think of it as a love story between Azure and Roslyn.

Open-source Projects! Come on down!

If you are a big fan of open-source software or you have an open-source project, then listen up. OSSPerks.com features a large listing of available services and APIs that are offered free of charge to open-source projects. They vary in scope but there are a lot of very well known vendors involved – so if your project needs a little extra something and your pockets are light, check it out.

There’s a new operator in town.

It looks like one of the most popular suggestions to appear within Microsoft’s UserVoice system is finally coming to fruition. The Safe Navigator operator (?.) will be likely introduced within the next iteration of C# and Visual Basic and should aid in warding off those NullReferenceExceptions that always find a way into our lives, hearts and applications.

Atom, the completely hackable Editor

The folks at github set the web ablaze with all kinds of chatter and backroom deals when discussion of their Atom editor broke out. Atom was designed as a completely “hackable” editor that could be easily extended to do – really whatever you wanted it to do. It’s still a project that is very early in its infancy, but it is something to keep your eye on.

Meet Reference Source

The great Scott Hanselman discusses another one of the recent offspring from the seemingly promiscuous Roslyn compiler in the form of Reference Source. This incredible innovation will now allow developers to step through the actual source of the .NET Framework while debugging their applications (so if you have ever wondered just what kind of sort was going down in that Array.Sort() method, here is your chance). It’s certainly a tool worth keeping your eye on – and if you want to hear and see more about it, you can check out this post from the MSDN team as well.

Walking through the Code of Games

Fabien Sanglard‘s blog is a fascinating place to visit if you haven’t been by (you can get there by just clicking the link). He has a myriad of different articles, book reviews and discussions on algorithms, but the reason I am bringing it up are his source code reviews. Now, I know that most people would cringe at reading a source code review, but these focus on actual commercial games like Doom, Prince of Persia, Duke Nukem 3D and Fabien does a great job of “skipping to the good parts”.

2048.

I’m not saying anything more about this – you’ll likely hate me if you haven’t previously discovered it. It’s digital heroin.

Introducing Bing Code Search, an easy way to find code samples from within Visual Studio 2013

Time is valuable and sometimes taking the time to open up a new browser tab to search for an example of code to do something can be a pain (because we can also be lazy). Thankfully, Microsoft’s Language Experience team created a product just for you: Bing Code Search.

bing

What Does It Do?

Released just this month as an extension for non-Express editions of Visual Studio 2013, Bing Code Search presents some very cool and useful features, which may be especially useful for experienced developers that need a quicker method of accessing examples and resources and for new developers still trying to figure out the code they need to accomplish tasks like reading files or iterating through collections.

After installing the extension in Visual Studio, you’ll see the  a small Bing logo above the native Visual Studio Intellisense. This will allow you to search for and use code examples and snippets from sites like Stack Overflow, MSDN and more without ever leaving your development environment or dragging an open browser onto another monitor :

Using the Bing Code Search to suggest possible solutions to a problem

Using the Bing Code Search to suggest possible solutions to a problem

What is going on here?

Magic!

Just kidding, but in as with most recent Microsoft innovations in the realm of development, the Roslyn compiler is involved (which is a bit magical). Basically, when you begin your search, your specific query is sent up to Bing along with several other important contextual pieces of information related to your project (such as the Project type, contextual keywords and other goodies) and then it returns a filtered and ranked set of results that might best match the code example you are looking for.

Since there isn’t a holy grail website containing all of the latest a greatest code examples, the code search will actually scour a multitude of different Q/A sites along with some other documentation and resources and compile a listing of relevant code examples that the developer can easily use either for documentation or to copy-paste directly into their project.

How Do I Use It?

The Bing Code Search extension is currently only available for Visual Studio 2013 (non-Express editions) and can be easily downloaded and installed from the Visual Studio gallery at link provided below :

If you don’t have Visual Studio 2013 or you just want to get an idea of how the service works, you can access a fully working example running below at Microsoft Research’s CodeSnippet area :

Try it out.

As a free tool that is incredibly easy to use, I would highly recommend giving it a shot if you have a non-Express edition of Visual Studio 2013 installed. It’s still a very early product and will likely continue to improve in the future (hopefully expanding to non-Express editions as well as earlier versions of Visual Studio), but it may be a great tool to consider adding to your development arsenal either as a time-saver if you are an experienced developer or as an excellent learning tool for those just diving into the development world.

An Interesting List of Development Stuff (February 2014)

february2014u

In this installment of my monthly treasure trove of development stuff, we take a slightly more .NET-oriented approach by covering several ASP.NET specific topics, resources and more. But there are quite a few other things that may be applicable to just about any kind of developers (and especially those that may be looking for a job).

Send a Valentine’s Day Math-o-Gram

In honor of Valentine’s Day, the folks over at Desmos decided that rather than sending a crummy card to your loved one, you could give them something that all women really love: math. By creating a very simple Node.js application, you can plug in different formulas and create a customizable “love graph” to send to your significant other.. or just play around with it.

Sidewaffle

No, sadly this is not some new breakfast-related concoction covered with delicious syrup. What is it however is an incredibly useful extension to Visual Studio that adds a bunch of different snippets, templates and other goodies into Visual Studio to help you become a more efficient and productive .NET developer.

Codility Training

Codility is a great site that administers short, automated programming tests for companies that are looking to hire developers. The tests can be performed in a variety of languages and they don’t simply evaluate if the applicant can solve the problem at hand, but how efficient they solved it (considering computational complexity) and if they handled edge cases as well. Now, obviously most readers of this blog are not going to be hiring managers, but Codility offers a free training area to help prepare those that are entering the job market to beef up their problem solving skills. It’s a superb resource for those of you out there that are currently in the job market and want to improve your chops.

Who needs Code Reviews?

A slightly satirical look at the benefits to productivity, developer happiness and deadlines when developers stop working about reviewing code and just start coding.

Strapfork

While it is still just in beta, Strapfork is a new visual editor for developing themes using Twitter’s Bootstrap. It aims to make the entire process of customizing and creating your own themes a cinch by allowing you to adjust every detail from gradients to typography and more. Stay tuned for more!

A Last Look at ASP.NET in 2013 and what to look forward to in 2014!

Jon Galloway covers the good times and the bad times had in 2013 by ASP.NET and how it has grown and continues to develop into a young adult (we are so proud). He reviews over all of the major improvements that have been made in the past year and details what to expect and watch for in 2014.

Do you really need jQuery?

Do you ever wonder if you really need to include that jQuery reference in your project or if there might be another very simple approach that could save you all those delicious kilobytes? Well then this is just the link for you. This site reviews over a bevy of tasks that jQuery typically handles and provides the equivalent code in pure Javascript. It’s a great resource for those that may want to slim down their sites and applications a bit if they are just using jQuery for handling things like AJAX or trivial DOM manipulation.

Nu-Gotta-Get-It

If you develop .NET applications, then you probably are a fan of NuGet (if not, go read about it and then come back when you are a fan). This site helps you find the best and most popular NuGet packages that you might be missing out on and allows you rank existing packages based on quality, documentation and more. It’s worth checking out if you are looking to incorporate a specific feature or package into your application and there are a ton of different choices out there.

Using the Pomodoro Technique and Trello to Lead a More Efficient Life

A great article by John Sonmez using the Pomodoro technique to help dramatically improve your productivity not only in your career, but also to help organize your life.

IdentityReboot and MembershipReboot

Security guru, Brock Allen introduces two of his major projects which aim to improve the existing ways that ASP.NET handles both Identity and Membership from a security perspective. If you have any qualms about weaknesses within ASP.NET and its built-in security mechanisms, you can be almost assured that Brock has addressed those in these two packages. Even if you aren’t a security expert, the introductions are worthy reads that may interest you enough to use them in the future.

When MVC5, SignalR and NuGet Just Won’t Get Along

This is obviously an exaggeration.

This is obviously an exaggeration.

Sometimes things just blow up.

If you have recently attempted to create a new ASP.NET MVC5 project (or any new Web Project within Visual Studio 2013) and decided that you wanted some of that sweet SignalR magic in your application, then you may have encountered the following error :

An exception of type ‘System.IO.FileLoadException’ occurred in Microsoft.AspNet.SignalR.Core.dll but was not handled in user code.

Additional information: Could not load file or assembly ‘Microsoft.Owin, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0×80131040)

This can easily be reproduced through the following steps :

  1. Create a new Web Application Project in Visual Studio 2013 that uses built-in Forms Authentication (Individual User Accounts).
  2. Add the SignalR package through NuGet.
  3. Attempt to add the following code to your Startup.cs file :
    public partial class Startup
    {
            public void Configuration(IAppBuilder app)
            {
                // Add SignalR Mappings
                app.MapSignalR();
    
                ConfigureAuth(app);
            }
    }

If you did everything right, then grab some popcorn because you are about to see this :

FileLoadException

Why is this happening to me?

Of all of the things to blame, we are going to choose NuGet for this one.

This is currently a known issue within NuGet. The reason for this is that SignalR and some other binaries are built with a dependency over Microsoft.Owin Version 2.0.0, however the appropriate assembly binding redirects are not occurring. This causes a problem as the latest available version of Microsoft.Owin in the public NuGet feed is greater than 2.0.0.

Okay. But how do I fix it?

There are two options here, which I have each had success with so I’ll start with the easiest approach, installing a specific updated version of Microsoft.Owin (and Microsoft.Owin.Security) and ensuring that you are properly targeting it within your web.config.

You can do this within the following steps :

  • Access the NuGet command-line tool within Visual Studio (accessible under Tools > Library Package Manager > Package Manager Console)
  • Install an updated version of Microsoft.Owin and Microsoft.Owin.Security (2.0.1, 2.1.0, 2.2.0 or any other version) using the following command :
    Install-Package Microsoft.Owin -Version 2.1.0
    Install-Package Microsoft.Owin.Security -Version 2.1.0
  • Ensure that your web.config has the appropriate <bindingRedirect> attributes to target the version you selected as seen below :
    <runtime>
       <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
           <!-- Other Assemblies here -->
           <dependentAssembly>
               <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
               <!-- Notice this targets 2.1.0.0 -->
               <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
           </dependentAssembly>
           <dependentAssembly>
               <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
               <!-- Notice this targets 2.1.0.0 -->
               <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
           </dependentAssembly>
       </assemblyBinding>
    </runtime>

The other longer and seemingly less reliable (in my experience) approach

This method appears to only work if the version of Owin that was installed through NuGet is already greater than one of the dependencies that you already have.

The second option involves creating a Console application and then add the SignalR package to it. Then copy the  bindingRedirects from the app.config file of this application to the web.config file in your previous exception-infested MVC application (as Console applications don’t have this same issue).

You really just need to update the oldVersion and newVersion attributes within the <bindingRedirect> sections for your Microsoft.Owin and Microsoft.Owin assemblies within the <assemblyBinding> section of your web.config from :

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <!-- Other <assemblyBinding> elements for your Project -->
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

to :

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <!-- Other <assemblyBinding> elements for your Project -->
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

Or more simply, change the <bindingRedirect> sections for each of your Owin-related assemblies from :

<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />

to :

<bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />

But How Do I Learn ASP.NET?

“How do I learn ASP.NET?” or “What is the best way to learn ASP.NET?” are two questions that I am frequently asked on nearly daily basis. These questions are fairly subjective and as everyone should know, there is never any “best” way to learn, but I thought I would share some of my thoughts on the topic and provide some resources for those looking to delve into the .NET world.

how-do-i-learn-dotnet

Languages

Since you need to actually know a language (at least one for humans and one for computers) before you begin your journey, it’s probably important to have an idea of what your choices are. There are primarily three main languages that you’ll encounter most often in the .NET world, so I’ll provide a few resources for each of the major ones to help you on your way :

C#

A modern, object-oriented, general purpose programming language with strong similarities to Java (if you are familiar with Java) and likely the most common language that you will see when working in the .NET world. C# is incredibly versatile and easy-to-learn and is widely supported. You should have no trouble finding examples for nearly any scenario that you would need in C#.

Visual Basic

Another object-oriented language that may be quite a bit more elusive than C# with regards to being seen or used in many modern projects. Visual Basic has a syntax that you could argue is “all its own” and it may be a bit foreign to those coming from other languages like C, C++ or Java. Nevertheless, it is still a popular language and it is still being widely used today and while it wouldn’t be my first recommendation for a .NET language to pursue, it is an option.

F#

One of the most elusive of the major .NET languages is F# and this is probably due to the fact that it is a functional language (although it can encompass object-oriented and imperative concepts as well) and it the youngest of the .NET languages. It has began to gain more traction in recent years however it would receive a bronze medal if a popularity contest was held between the three languages listed here. But if you are feeling adventurous or come from a functional programming background, it is worth checking out.

You’ll also need an actual development environment to run these in. Thankfully, Microsoft offers a free “Express” version of Visual Studio (its flagship IDE) completely free for personal and commercial usage, which you can download from the link provided below :

Books

Books typically aren’t the first thing to come to mind when searching for resources on learning a technology, but people wouldn’t write them if they didn’t work. For you page-turners out there that learn best by being away from a screen and keyboard, I’ll provide a few highly recommended options that should give you a jump start into the .NET world :

Beginning ASP.NET 4.5: in C# and Visual Basic (Beginner Friendly)

This tutorial-centric book provides a great introduction to ASP.NET and is a perfect book for both developers that are new to .NET or those that may have worked with it previously as a refresher. The author does an excellent job of not only providing code to the reader, but thoroughly explaining why the code is there and how it works. (This is also a great choice as it provides both routes in C# and Visual Basic for those that are familiar with either of the languages)

Professional ASP.NET 4.5 in C# and VB (Beginner Friendly)

Don’t let the “Professional” in the title scare you away if you are just learning ASP.NET, as this title is a great choice for an introductory book to .NET or for those that have some experience under their belts. The superstar team of authors focuses on many of the foundational concepts throughout ASP.NET and covers all of the major features available within the technology so that the reader will feel confident tackling applications both big and small.

Beginning ASP.NET Web Pages with WebMatrix (Beginner Friendly)

This book is undoubtedly the best one that I have come across on ASP.NET’s Web Pages technology that uses the WebMatrix platform, which is excellent for those just getting started in .NET. This book is extremely comprehensive as well and covers not only ASP.NET specifics, but many of the tangent web development technologies like HTML, CSS, Javascript, AJAX and basically everything you would need to develop complete and dynamic web sites.

Pro ASP.NET MVC 4 (Some ASP.NET knowledge recommended)

Adam Freeman (and Steven Sanderson) provide an excellent introduction to ASP.NET MVC and hold your hand as your create your first MVC application and then things begin to rev up a bit in a title that covers MVC in a very comprehensive way. The book not only does a superb job of explaining how MVC applications operate and how to handle just about every situation that might arise when developing an MVC app.

Professional ASP.NET MVC 4(Some ASP.NET knowledge recommended)

Written by a team of rock-stars in the .NET world, Professional ASP.NET MVC 4 is a great primer to get started with ASP.NET MVC after you have a bit of foundational work under your belt. Much like the previous title, this work covers MVC in its entirety and goes into a bit greater depth about topics that are close tangents to MVC such as jQuery, AJAX calls, dependency injection and more.

As you can see, the MVC-specific books by nature are going to have a slightly larger learning curve than a traditional “Web Forms” approach. If you are a quick learner and already have some web development experience, then you should feel right at home jumping into them, but if you are looking for titles to hold your hand and explain ASP.NET in its entirety, then you may be better off with one of the “Beginner Friendly” books above.

Resources and Tutorials

For some reading can be one of the best ways to absorb the concepts when learning a new technology, however I have found that developers tend to learn best when they actually can sit in front of a keyboard and “develop”. I’ve always thought that the best way to learn to become better at something is to do that very thing and software development is not exempt from this rule.

I’ve compiled a list of different resources and tutorial series that I would recommend anyone that is looking to learn or become more proficient in ASP.NET to consider below :

Getting Started with ASP.NET

If I only had one resource to name on this entire post, this would be it.

Coincidentally, the first resource on the list just so happens to be one that shares the name with the technology itself (asp.net) so you can probably bet that it is going to be a pretty reliable place to visit. The Getting Started area of the ASP.NET site has everything a developer of any level would need to further their knowledge: tutorials, video series, walk-throughs, examples, discussions and more. All of the content was written and developed by leading members of the .NET community or actual members of the .NET development team and the quality shows.

Microsoft Events and Hands-On Labs

An often overlooked resources for those looking to get some “hands-on” experience (even though they are through videos) is Microsoft’s Events site. It features full-length lab sessions and webcasts that cover a variety of topics for developers of all experience levels, which is great for those that prefer a more structured, instructor-led learning environment. There are 500+ different events listed under ASP.NET and the events can be accessed either on-demand or you can even participate in a live lab in progress (assuming you schedule to attend it) via web cast.

Channel 9

Channel 9 is Microsoft’s video archive of all things development and it contains thousands of videos that cover just about every aspect of Microsoft development and technology. You can find video tutorials, explanations and overviews on ASP.NET and any of its underlying sub-categories (Web Forms, MVC, WebMatrix, Web API, SignalR, SPA and more) all in an extremely easy to use and follow format that allows the viewer to easily “skip to the good parts”.

Microsoft’s Beginners Development Center

Microsoft’s Beginners Development Center is another excellent resource that not only provides a series of tutorials for ASP.NET, but it also features a crash-course on Web Development in general including an introduction to HTML, Javascript, CSS and more. If you continue to explore around the site, you’ll see that it isn’t restricted to any particular area of development and has content for web applications, desktop applications, web services and more.

Microsoft Virtual Academy

Another learning resources available from the folks at Redmond is the Microsoft Virtual Academy. The academy is a web-based, course-driven learning environment that has full courses that cover just about every major topic and technology covered by Microsoft. If you are looking to learn more about .NET or any Microsoft technology and you learn best using structured courses, then this is certainly worth checking out.

Any of the above resources would be excellent areas to focus your learning and I would recommend scouring through each of them, as you would be surprised how the teaching styles of different instructors might help you learn or understand something more effectively. I will mention it again however – if you want the most comprehensive place to look for learning ASP.NET, then visit ASP.NET :)

Supplementary Learning

While tutorials and books are excellent resources, there are a few other resources that I would recommend (if you are interested) that cover not only ASP.NET but development in general and would likely be worth checking out :

PluralSight

If you are a developer and you like instructor-led training through well-designed courses, taught by people that know what they are talking about, then you need to seriously consider investing in a PluralSight subscription. PluralSight is the premier developer training site not only for learning about .NET or Microsoft-related technologies in general, but ANYTHING development related. The courses cover a wide-range of categories and range from “FizzBuzz” and “Hello World” level to designing scalable enterprise-level system architecture.

Code Academy

Code Academy is a great resource to learn many of the the supplementary skills and technologies that are associated with ASP.NET such as Javascript, HTML, CSS, jQuery and more. These may play a bit less of a factor when you are first getting started (especially if you are working with Web Forms) but as you migrate to more advanced applications and want a bit more control over how things look, these are valuable skills to pick up.

DotNetFiddle

DotNetFiddle is a great tool to tinker with basic .NET Applications from the comfort of your browser. It supports all of the languages listed above (C#, F# and Visual Basic) and has support for easily integrating NuGet packages into your applications as well.

An Interesting List of Development Stuff (January 2014)

Development Stuff - January

Software development is a fascinating thing.

With a scope so vast and so many languages, topics and general cool things that people are doing, it can be difficult to keep up. So I have decided to start compiling a few of the links, resources, blog posts and other projects that I find “interesting” or just worth reading and putting them up on here to share with others. I don’t really plan on having any particular scope for the content and it may or may not even be related to .NET, but I thought it would be a nice addition to the blog.

Overthinking Development

Ars Technica compiled a collection of posts that stems from a question that was posed on Stack Exchange regarding how far you should plan into the future when developing software (or if you should even look into the future at all). Several developers chime in and provide different points for different scenarios in a very read-worthy article.

Kimono Labs

The folks over at Kimono Labs recently created a neat little tool that will essentially turn any website into a structured and usable API that can be stored, queried and used to create other wonderful things all from the comfort of your browser. It’s currently in the beta phase and who knows what the future might hold when it is officially released.

Choosing a Javascript MVC Framework

Craig McKeachie reviews over some of the major players in the Javascript MVC Framework game that you might encounter if you wanted to develop a sweet SPA application. He discusses some benchmark numbers, features and some things to consider when choosing one over the other.

Learnfun and Playfun

Tom Murphy, a recent PHD graduate from Carnegie Mellon decided to venture out and see if he could write some software to teach a computer to play Nintendo games and succeeded (relatively). In a series of entertaining videos, he reviews over the algorithm that he uses to “teach” the computers how to play by exposing them to a small portion of the game being played and then lets it loose and demonstrates some pretty entertaining things.

How to Not Hire a Google Software Engineer

A short-article that discusses why a start-up looking to hire one of the elusive “rock-star” developers from everyone’s favorite search engine giant failed event with a hefty “$500,000″ salary offer.

Programmers and 4K

I love high-resolution monitors, especially when I am doing anything development related. This blog post covers over why 4K is basically designed for programmers and software developers and why it may actually be cost effective to go buy one for yourself.

Algorithms and Combat

The folks over at CodeCombat, a start-up with a focus on using creative means teach development and to find talented developers through games and puzzles, review over an algorithm design contest they held and some of the results. As with most things on the Internet, if you think that you have done something in the best possible way, you are wrong (and people will love to tell you about it).

Updated .NET Releases

The ASP.NET team released a series of “.1″ releases earlier this month that featured improvements for ASP.NET MVC (5.1), Web API (2.1) and Web Pages (3.1). Each of these are available through their respective NuGet packages.

Mentoring Software Engineers

Matt Brown has a nice blog post on the process of mentoring  up-and-coming Software Engineers and some things to consider both for the mentor and the student. It’s a great article for anyone that has ever done any mentoring of fellow software developers and hopefully interests those that have not to do so.

A Year of Giving Back to the Development Community

Earlier this year I began this blog as part of a News Years resolution to give back to all of the communities that have helped me become a successful developer and I am proud to say that it was a resolution that I stuck with.

So I thought I would wrap up this year with a hastily written summary of some of the things I did this year to help make a contribution to the development world.

gb

I never would have realized how time-consuming consistently helping the community would be when I began this journey earlier this year. It was a huge investment on my part and thankfully I was able to continue on this path without my wife threatening to kill me although she did hear the “let me finish typing this one thing / post / answer” quite a bit, so I have to thank her for my current state of being un-murdered. I would estimate that I probably spent at least around 8-10+ hours a week specifically doing community-based activities and I had a great time doing it.

If I couldn’t sleep, I would hop up and write a blog post or spend a few hours answering questions or sometimes I would mash on my Surface until either the battery died (which isn’t an easy task) or I simply fell asleep (which occasionally occurred mid-answer). When I wake up I would answer questions or work on blog posts before eating breakfast or during lunch, it became a habit but in my mind, a positive one.

Let’s take a look at where I spent a majority of my time.

Asp.net

The ASP.NET Forums.

Since I spent an overwhelming majority of my time working with .NET and other Microsoft development technologies, I couldn’t really think of a better place to focus my efforts than a forum that focused on just that. I had always remembered ending up there when searching for different issues and felt that Stack Overflow was a bit too chaotic, competitive and unfocused to be my primary choice.

So beginning in January, I began answering questions and tried to avoid just blatantly posting links to other sites whenever possible. I have focused on making a genuine effort to not only answer the questions asked but also help explain exactly what is going on and recommend better methods and best practices that they should consider using in the future. As a result, many of the answers I provide often resemble tiny, well-formatted blog posts, which I hope not only benefit the original poster discover what they were looking for, but to serve as a resource for future users that may encounter the same problems.

Above all, I feel that these contributions have no only allowed me to impart some of the knowledge that I have gained over the years onto others, but it has also help sharpen my skills through teaching others and communicating with other community experts and MVPs to help all of us improve as a whole.

And I haven’t stopped since, let’s take a look at some numbers :

  • Posts since January : 9,001 (averaging ~25 posts per day)
  • Posts marked as Answer : 4,268 (averaging  ~12 answers per day)
  • Points since January : 60,542 (averaging ~170 points per day)
  • Views for posts since January : 785,212

I know that people often say that “points” are meaningless and for the most part they are. However, I do feel that they are a motivating factor for people like me to keep doing something that can often be stressful or time-consuming, but they serve as a number to let me know that I am contributing to something. All of these values were extremely helpful in setting personal benchmarks and goals to strive for to keep me going throughout the year and I am happy with the results.

During my time spent here, I have had the opportunity to meet some incredible people. The ASP.NET forums are full of Microsoft MVPs, ASP.NET Insiders, Microsoft employees and all sorts of wonderful developers with astounding accolades. The moderators always kept things clean, quickly removed any spam that might occasionally turn up and made it an enjoyable place to spend my time.

I would encourage any .NET developers that aren’t currently using these forums as a resource to head on over there, sign-up and post something if you run into any issues.

rionscode

Blogging.

I began this blog in late January and honestly didn’t really have any expectations for it at all so I have to admit that my little to no expectations were dramatically exceeded when I noticed that people were actually visiting the site. I honestly wish I could spend more time on here writing (and finishing) posts as a majority of them have been quite well received and even published and spread out on a few different sites across the internet, which is really cool.

When I initially started the blog I may have set a pace that wasn’t really realistic at 8 blog posts a month and I quickly realized that in April. I could feel myself getting burned out trying to think of new topics to cover and eventually building up some excess stress that I really didn’t need. So I took a break during the summer and have since relaxed the number of posts to a much lighter amount (2-3 per month), which I think is a maintainable target to shoot for.

Speaking of numbers, let’s take a look at some of the statistics for the site since its inception :

  • Visitors since launch : 78,032 (averaging ~239 per day)
  • Views since Launch : 124,962 (averaging ~338 per day)
  • Total Posts since Launch : 43
Month-by-month Traffic Breakdown.

Month-by-month Traffic Breakdown.

The blog has been extremely popular and has received far more traffic than I would have imagined. Many of the articles that I have posted on the site have been published and spread across the web on sites like CodeProject, Reddit and have been used within several other areas such as resource guides and magazines.

Since many of these blog posts often contain practical code and examples, I have made an effort to upload them to sites like github so that the open-source community can use them to help solve many of the problems that they have may have encountered in the past (or possibly in the future). Blogging has opened up many doors with regards to additional community involvement and I have been extended invitations for speaking events and presentations, online mentoring, guest authoring and beta testing new components and releases within the realm of .NET.

Thanks everyone that has stopped by and those of you that are reading this now, I want you to know that I appreciate you taking the time to do so.

stac

Stack Overflow.

I honestly thought when I dedicated this year to community contribution, the first site that came to mind would be Stack Overflow. It is without a doubt the largest development-oriented Q&A site on the web and it is usually where just about every question has an answer. But surprisingly, I haven’t really done much there this year apart from moderation duties as I have found the community there to often be quite aggressive and cutthroat when it comes to “rep”.

I’ve spent most of my time on the site doing this that help the community without actually posting answers. Since I currently have enough privileges there already, I tend to spend any idle time editing posts, approving edits, flagging posts and other related topics. I would encourage any users out there that have these abilities to use them as a site the magnitude of SO has a huge need for helping hands when it comes to these duties.

reallife

Real-world Contributions.

This year I have taken part in several personal development-related community projects. I was invited and currently serve on a Computer Science Advisory Board at a small public university to discuss the importance of many of Microsoft’s technologies and their practical uses outside of academia (with regards to future employment and usefulness).

I have also taken part in a variety of private mentoring sessions for younger / junior developers and recent graduates to learn the ins-and-outs of C# and the .NET environment in general. These sessions have included both one-on-one mentoring and tutoring as well as group presentations.

Previously Set Goals and Results.

In late March, I threw together another blog post that detailed some goals that I had set for myself that I thought were fairly ambitious, so since the year is basically over. Let’s see how each of the goals compare to the actual results :

  • Goal : 50,000 + Points and 7,500+ Posts on the ASP.NET Forums
    Result : 61,056 Points and 9,117 Posts

  • Goal : 4,000+ Questions Answered on the ASP.NET Forums
    Result : 4,223 Questions Answered

  • Goal : 20,000+ Reputation on Stack Overflow
    Result : 18,830 Reputation (I’m not too disappointed about this one)

  • Goal : 40+ Blog Posts
    Result : 43 Blog Posts (and 14 drafts)

  • Goal : 15,000+ Blog Visits
    Result : 124,962 Visits (I undershot this one by a mile)

Overall, 4 out of 5 isn’t too shabby.

What I learned.

Since I have a News Year’s Eve party to get to, I’ll keep this succinct and go with some bullet points :

  • Contribute even if you think you can’t. Experience is unique and two people rarely share the same experience or tackle a problem the same way. If you find a situation that someone encounters and is having difficulty with, consider sharing how you tackled or solved the problem. It can work wonders.
  • Teaching is a great way to learn. I can’t express how many things I have learned by helping others throughout this year. I know that I am a much stronger developer than I was at the beginning of this year and I would attribute much of that to the dedication that I have put into teaching others and learning along the way.
  • Helping others helps you. Since contributing in all of these different ways, countless doors have been opened for me. Speaking engagements, interviews, guest contributions, job opportunities and much, much more. I would highly recommend taking the leap and giving back if you get a chance, I can just about promise that you’ll get a return on your investment in one way or another.
  • Keep your e-mail Address private. Although I put this here in jest, I can’t tell you how many e-mails I get per day of folks asking questions outside of the forums and other areas. It’s not that I mind, but it was a little unexpected to see 20+ emails when I wake up and they are all from users asking for help.

Thanks again everyone for giving me something to strive for over the past year and thanks again for visiting.