# Thursday, October 11, 2012

Have you heard about the Succinctly Series? Syncfusion has produced a number of free e-Books on various subjects ranging from source control to jQuery to HTTP.  I highly recommend you pick up these free books. You’ll have to register but it’s worth it. This is an unsolicited review. Smile

So far I’ve read the Knockout.js Succintly, ASP.NET MVC 4 Mobile Websites Succinctly, PDF Succinctly and JavaScript Succinctly. They are great beginner books and very quick reads especially if you are beyond the basic level. They average around 60 pages per book with 150 pages being the biggest I’ve seen.

They seem to be rolling out a new book every few months. So far they have:

Knockout.js Succinctly

C++ Succinctly

ASP.NET MVC 4 Mobile Websites Succinctly

LightSwitch Succinctly

Javascript Succinctly

HTTP Succinctly

PDF Succinctly

Git Succinctly

jQuery Succinctly

Happy Coding! Smile

Books | Git | JavaScript | jQuery | Knockout | review
Posted 10.11.2012  #    Comments [0]  | 
# Thursday, October 04, 2012

Moving an MVC4 Visual Studio 2010 project to 2012 is so far in my experience with a small application rather quick and easy. However, if that’s all you do then your app will be missing out on the nice .Net 4.5 and Entity Framework 5 features. 

Upgrading these two items, while not terribly difficult, does have a few challenges to overcome even for my relatively small application with two projects and about a dozen NuGet packages.

Hopefully my experience will help the next person get through their upgrade faster.

MVC 3 or MVC4 Release Candidate?

If you are on MVC3 or say the MVC4 Release candidate take a look at these extra steps to take.

MVC4 & VS 2010 to 2012 Steps

Open your VS 2010 solution in 2012 and let it convert your solution.

And done… Well almost.

If you happen to be using dependencies / nuget packages, there may be a chance that these are using older frameworks.  If you were already using MVC4 in 2010 chances are then you already figured out how to direct these packages to use newer versions of their dependencies using binding redirects. 

For example MVCContrib.TestHelpers references the MVC3 runtime.  My VS10 project was already using a binding redirect so all should be good. 

I am also using the MiniProfiler and in my MVC4, 2010 project I upgraded to the Entity Framework 4.4 Prerelease.  When I did this I had to add a binding redirect since the MiniProfiler at the time was using an earlier release.

If you are having issues, you’ll have to investigate if you have a dependency using an older version of a DLL that you can use a redirect to solve.


In my case, my VS12 project with the TestHelpers stopped working even with the redirect.  I tried on my PC/laptop as well new and upgraded projects.  I can only assume it must be something wierd on my boxes.  I have been using the betas, previews and RC versions of MVC on both boxes so it just might be something related. 

The binding redirect *should* work.  However, if you run into my case, the atomic option is to download the MVCContrib source, change the reference for the TestHelpers project to use the MVC4 runtime, recompile and use the new DLL in your project.  This is what I ended up doing.

Done. If that’s all you want to do.

Upgrade Project(s) to 4.5

Right Click on each project and select properties.  Change the Target Framework to 4.5 in the Application section.

Update all packages to target 4.5

Perform a search and replace for the entire solution to replace targetframework=”net40” to targetframework=”net45”.  This will update all of your packages.config to use 4.5 targeted packages instead of 4.0.


Open your web.config and change your targetFramework=”4.0” to 4.5.  This informs IIS to also target 4.5 now.

Upgrade EF 4.4 to EF 5

Uninstall the EF package, and reinstall it via Nuget. I recommend doing this from the console/command line instead of the package GUI.  At the command line you can force an uninstall just in case you have other packages that require EF.  I originally uninstalled/reinstalled via the GUI and first removed all of my dependent projects and then added them all back in but I ran into problems with my dependent projects having issues.  I found it easier to force EF first, make sure it was all working and then investigate my other dependent packages one at a time.

You can open the console from the Tools Menu, Library Package Manager and Package Manager Console


or by typing console and hitting enter in the Quick Launch which is in the upper right hand corner of VS 2012.


The console opens in the lower middle of VS 2012 and allows you to type in nuget commands.


Type in

uninstall-package EntityFramework –Force

and then

install-package EntityFramework

Be sure to do this for all projects using Entity Framework.  You can change this by selecting the project from the dropdrown list in the console.

If all of the above was done correctly it will install version 5.0.  If it still says 4.4 something is still pointing to the 4.0 framework.


Build your solution.

If you get an error about the CompareAttribute being ambiguous reference…


Fix by Adding System.Web.Mvc. to the Compare Attribute.





Rebuild.  Congratulations.  You now have a VS 2012 MVC4 project using .Net 4.5 and EF 5.

Now for the rest

From here you should now investigate all of your Nuget Packages or external references.  Since we are now pointing to 4.5 it may be that a newer version is available.  Nuget doesn’t handle updating to the new targeted version at this point.  You’ll have to look at each package and if you know it has a newer one for 4.5 you’ll want to look at uninstalling it and reinstalling as we did earlier.

One Quick way to reinstall all the packages

You could delete all of your packages and their folders and set Nuget to restore packages.



Now the next time you recompile, Nuget will get all of the new stuff.

However, this could wreak havoc on your project.  I opted for handling my dependencies one at a time so I could deal with issues for each package one at a time. 

Happy Coding! Smile

Posted 10.04.2012  #    Comments [1]  | 
# Wednesday, October 03, 2012

I upgraded a project recently from 1.7.2 of jQuery to 1.8.2 and began testing my pages.  On one of my pages I was getting the following error:

unrecognized expression

Doing a little research I discovered that in the 1.8 release of jQuery they deprecated the :radio and other such pseudo-class selectors.  The preferred method moving forward is to use the equivalent CSS selector of [type=radio].

Here’s the jQuery 1.8 release notes and the ticket describing this change.

Why the removal?

From their radio selector page under the Additional Notes section:

Because :radio is a jQuery extension and not part of the CSS specification, queries using :radio cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. For better performance in modern browsers, use [type="radio"] instead.

And from the ticket page:

Deprecate (for eventual removal) the input type selectors: :file :image :password :radio :reset :submit :text -- They are basically aliases to [type="file"] [type="image"] but can't use querySelectorAll - I think having these selectors around in the long term future is entirely unnecessary and confusing.

Happy Coding! Smile

:radio | 1.8 | jQuery
Posted 10.03.2012  #    Comments [3]  |