ThreadAbortException

September 2011 Entries

Why NuGet for Visual Studio 2010 is so useful!

Recently I delivered a session at Virtual TechDays on why NuGet is so useful.   As a part of the demonstration, I was showcasing how it automatically allows us to update some of the external reference libraries.  Point in case, here is jQuery.

Starting Visual Studio 2008 SP1, we have been shipping jQuery and intellisense for jQuery thereof.  With Visual Studio 2010, out of the box, when we create a “File – New Project – ASP.NET Web Application” (which would create a Webforms application) it would automatically add the jQuery script files for jQuery 1.4.1 version.  This was the then latest version of jQuery when we shipped Visual Studio 2010 way back in early 2010.

With the new ASP.NET MVC 3 Tools Update that was shipped in April, this year, when you create a “File – New Project – ASP.NET MVC3 Web Application” it automatically adds references to the jQuery-1.5.1.js and the respective minified file and the vsdocs (intellisense) files.

image 

Now, jQuery is something that evolves quite faster compared to versions of Visual Studio.  So, there is no real chance that we could always publish the latest version of jQuery automatically into your projects unless we release a new version of Visual Studio every month Smile with tongue out

With NuGet, I can always use “Manage NuGet Packages”

image

and it opens up the updated versions of the NuGet Packages

image

and notice that when I click jQuery, it shows that there is a recent version 1.6.4 shipped on 22nd September available.  When I clicked install, it did 2 things.  One, it downloaded the latest bits.  It also neatly removed the existing 1.5.1 files before adding the newer ones.

image

What it did not do automatically though was changing the references for the script file in the Layout.cshtml file in the project.  That still we have to change manually.  Now, with this, I could use the latest version of jQuery available from NuGet.  Same is the case with modernizr and other open source libraries which have an agile update model.

You can download NuGet from http://nuget.org

Cheers!!!

Developing ASP.NET MVC 4 Applications on Windows 8 Developer Preview

Well, as mentioned in my earlier posts, the ASP.NET MVC 4 has Developer Preview has been released.  You might notice quite a bit of this term “Developer Preview” in 2-3 products specifically.  One, Windows 8 is now available as simply Windows Developer Preview.  Similarly, Visual Studio 11 is Developer Preview and also the Internet Explorer Platform Preview 3 is a Developer Preview, as with the case with Expression etc.,

Now, to clarify on a few things which I learnt.

The Windows 8, hereinafter referred to as Windows 8 Developer Preview comes as a download along with Visual Studio 2011 Express as described here  This edition is just for developing Metro Style applications for Windows Developer Preview using JavaScript, Visual C++, C# or VB.NET.  This does not have templates for Web enabled.

Even after I installed the ASP.NET MVC 4 Developer Preview, from here the ASP.NET MVC Templates didn’t show up in the Visual Studio 2011 Express when running from Windows 8. 

Then, I realized, there is a separate Visual Studio 2011 Developer Preview edition available for Windows 8 from here

Now, I checked by opening this VS 2011 and it had both the templates for Metro Apps as well as Web Development.  But just found ASP.NET Web Application.  Couldn’t find MVC 4 although I had installed it earlier.

Then, I removed ASP.NET MVC 4 and Web Pages 2 and the reinstalled the same.

Post that, I am able to see the templates for ASP.NET MVC 4 in Visual Studio 2011 on the Windows 8 machine.

So, put things simple, if you want to play with ASP.NET MVC 4 on the Windows 8 Developer Preview, install the Visual Studio 2011 Developer Preview in addition to the Visual Studio 2011 Express that is installed on the machine.  In fact, I checked and it had templates for Metro Style apps too.  So, I uninstalled the Visual Studio 2011 Express since I wouldn’t need two versions running on my machine.

You can also install ASP.NET MVC 4 for Windows 7 and Visual Studio 2010 from here

I get a feeling that this post is little complicated with all the naming conventions Smile so if you have a query, please post in comments and I would try to address.

Cheers !!!

 

The WebMatrix v2 Beta Release

I had written earlier about the WebMatrix v2 Beta release that happened recently at the BUILD Conference 

As I had mentioned earlier, WebMatrix is a light weight tool for Web Development, Profiling, Database management, Optimization and also deployment.  Its an end to end tool for web developers.  Web Matrix is different from Visual Studio in the sense, it doesn’t require web developers to master C#, ASP.NET and other programming techniques.  Web Matrix uses a simple Razor syntax and HTML markup for most of the operations.

Also, the power of Web Matrix lies in the open source applications repository, accessible via the Gallery.  The Gallery hosts a huge range of applications including hugely popular applications such as WordPress, DotNetNuke etc.,

image

Ok, these are things which you probably have seen already if you are working with Web Matrix.

What’s new in WebMatrix 2 Beta?

The start up screen has been much simplified with just 3 options now and the “Open Site” allows one to either open their site from their folder or a remote site or from a template with one click. 

image

Opening a remote site is a cool new feature in WebMatrix.  You can open a site that’s already running on a remote machine, make some quick changes and publish it.  So this means you don’t need to have Web Matrix installed on those servers.  All of this managed from within your Web Matrix IDE on Development machine.

The Database designer is redesigned for better work with Databases and also features the new query window where you can run queries.

But my favorite new feature is the gallery.  The gallery is the place from where you can install the NuGet packages.  Earlier installing them was a little tricky.  Here, with one click you can install your favorite NuGet package

image

Also, the default UI of the site has been improved significantly when you use the Starter Site.  When I clicked on “Templates” in the Start screen and selected “StarterSite” and gave it a name, as below

image

 

and clicked “Ok” I get a default site created.  When I simply ran the site using the “Run” Icon

image

I get a default site with the following layout.  This is the much improved layout. 

image

It automatically has the Login screen and other Account setup required for Membership Authentication.  So, is a truly powerful Starter Kit.

We will examine using some of the new features in subsequent posts.

In the meantime, if you want to install the new version of Web Matrix, Click Here

Cheers!!!

ASP.NET MVC 4 Developer Preview and Adaptive Rendering

image

The picture says it all.  Made possible uisng jQuery Mobile!  More on this in the future posts.

Cheers !!!

ASP.NET MVC 4 Developer Preview announced at BUILD

Yesterday I wrote this post but forgot to mention about something that is very close to my heart Smile ASP.NET MVC.  ASP.NET MVC has been evolving rapidly and within 2 years, we already have had 4 major releases (MVC 1, MVC 2, MVC 3 & MVC 3 Reloaded Smile)

So, it doesn’t go as a surprise that MVC 4 is on the cards and the developer preview was unveiled at BUILD Conference.  What does MVC 4 offer for web developers?

Enhanced Default Project Template

If you are bored with the vanilla blue template that comes with the “File – New – ASP.NET MVC” Project that you have been living with over the last year, here is a refresher.

Once you install the MVC 4 Developer Preview through the Web Platform Installer (direct download link is here ), you get to see an additional project template in Visual Studio 2010, while firing “File – New Project” dialog, which is “ASP.NET MVC 4 Web Application” (Trivia:  Note this is my 100th MVC Project.  Agreed around 50 of them were created but never used Smile with tongue out)

image

When you click on it, you get to see one more option other than the “Empty”, “Intranet” & “Internet” Templates

image

While MVC 3 has been good enough while rendering on mobile devices, its never the same and sometimes I have built sites which look ok but not great on hand held devices.  The new “Mobile Application” template specifically is built for MVC 4 applications that are targeted for Mobile Devices.  This is based on jQuery Mobile.

However, if we chose the regular “Internet Application” it provides the following new UI

image

 This definitely looks better than the old dark blue and white template.  Couple of things to note

1. This one uses the new “System.Web.Providers” for the default Membership configuration and automatically configures all of the other attributes such as Profile, Role, SessionState to use the “DefaultConnection” connection string.  So, there is just one place where you have to modify the connection string and all of the above settings would point to that database.

2. It uses an AJAX Login wizard so you no longer have to navigate to /Account/Logon for logging in your users (almost all sites have stopped using this legacy behavior)

It also uses Adaptive rendering to render it better on smaller form factors such as phones and hand held devices, using jQuery Mobile.

Few more enhancements such as Recipes, Asynchronous Controllers etc., provide better development experience.  I am examining some of those and would write individual  posts on each of these.   Meanwhile you can get a high level overview of the same in this whitepaper

Also, you can watch Phil Haack’s session at BUILD on MVC 4 Developer Preview

Cheers!!!

The BUILD Conference

What a week it has been!  The BUILD Conference just concluded http://www.buildwindows.com/?WT.mc_id=aff-n-in-loc—hr  and there were tons of announcements.  This is one of the reasons I am passionate about this company.  Even when I was outside Microsoft, the momentum and the focus they have on Developer audience simply amazes me and they continue to do it, years later.

Windows Developer Preview

BUILD is a developer conference which premiered the first Windows Developer Preview bits.  Clearly, the developers get to see it for first and there have been a reported 500,000 downloads of the bits already and its only going to increase over the days.

While the official release is way ahead in the future, the developer preview has created enough excitement among developers, ISVs, partners and consumers.  Windows Developer Preview also premiers the Metro style UI and development tools which provide a refreshed or reimagined Windows experience.  Right from Windows 1, programming for Windows has been a breeze for developers and this release is no exception.

Also the experience of Windows on Slate and hand held devices is something new and refreshing for long time Windows users.

Watch the BUILD Day 1 keynote for more information on Windows Developer Preview http://channel9.msdn.com/events/BUILD/BUILD2011/KEY-0001?ocid=aff-n-in-loc--hr

Web Matrix

We released Web Matrix Beta close to more than an year ago.  The first web developer friendly tool which doesn’t require you to master the Framework, Toolkits and other controls for developing simple websites.  Web Matrix is a tool for web developers and designers who want to develop web applications quickly.  The power of web matrix doesn’t lie in the tool itself but with the plethora of starter kits and popular applications that it offers from the start up screen.  For example, you could just open up a DotNetNuke or WordPress source code, customize it and publish your own version, right out of the Web Matrix tool.

You can watch intro videos on Web Matrix from http://www.microsoft.com/web/webmatrix/?WT.mc_id=aff-n-in-loc—hr

This BUILD also marks the Beta release of Web Matrix v2 with much improved tooling support for building websites.  The version also comes with ASP.NET Web Pages v2 version.

You can watch the Web Matrix v2 session at http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-825T?ocid=aff-n-in-loc--hr

The landing page for downloading the v2 version of Web Matrix, is at http://www.microsoft.com/web/webmatrix/next/?WT.mc_id=aff-n-in-loc--hr

Internet Explorer 10 Platform Preview 3

The Internet Explorer team has been as agile as one would imagine compared to the previous releases (IE7, IE8 => IE9).   With multiple platform preview releases, IE9 RTM’ed in March this year and immediately we had IE10 Platform Preview.  We also had a subsequent PP in June.  Now, IE10 PP3 is out, but currently limited to Windows Developer Preview build.  The earlier Platform Previews can be downloaded for Windows 7.  But if you want the PP3 of IE10, you get to download it along with Windows Developer Preview.

The Developer Preview can be downloaded from http://ie.microsoft.com/testdrive/Info/Downloads/Default.html?WT.mc_id=aff-n-in-loc--hr

Watch the IE10 PP3 & HTML5 sessions in MIX at http://channel9.msdn.com/Events/Build/Build2011?sort=sequential&direction=desc&term=internet+explorer&ocid=aff-n-in-loc--hr

Windows Azure

Yet another of our offerings that keeps getting updated very quickly is the Windows Azure platform and tools.  The SDK refresh happened just a while back in August.  Now, with BUILD we have a new version of the Windows Azure Tools for Visual Studio 2010 and the SDK available.

This SDK promises improved development fabric, publishing options and many more enhancements.

You can read about the new features at

http://blogs.msdn.com/b/windowsazure/archive/2011/09/15/announcing-windows-azure-sdk-1-5-windows-azure-tools-for-microsoft-visual-studio-2010-and-new-service-management-features.aspx?ocid=aff-n-in-loc—hr

and download the new Windows Azure SDK bits from http://www.microsoft.com/windowsazure/sdk/?WT.mc_id=aff-n-in-loc--hr

Finally

As much as I want to write about everything, I want to leave it to the experts to talk and offer you links for the sessions rather than providing everything in text.  So watch all the sessions that happened at BUILD from

http://channel9.msdn.com/Events/Build/Build2011?ocid=aff-n-in-loc—hr

As we begin a new journey with the new set of releases, its yet again an exciting time for Developers and I am with you in starting to experiment all of these!

Cheers!!

FIX for Windows Update Error Code 80240016–Windows update failed since other updates are being installed currently

I kept getting this error whenever I try and do a Windows Update.  This used to happen, particularly if I haven’t done a WU for a very long time.  The usual suspects are anti-virus, firewall and sometimes, pending windows updates which would get resolved when I do a restart of the machine.

I am running a Windows 7 SP1 64 Bit OS.

This time, I connected a machine after almost 6 months and had a truck load of windows updates to be done.  I tried restarting multiple times but every time, I run the WU wizard, it fails with Error Code 80240016 stating failure “since other updates are being installed currently”  I for sure knew, there are no other updates running Smile

Did a bit of research and found this URL http://www.digwin.com/windows-update-fails-with-error-code-80240016-0 where some anonymous user (God Smile) has provided the steps to stop and start the WU Service.  So the steps here, to save you from reading all over again

1. Click “Start” type “cmd”

2. Select the “cmd” icon, right click and select “run as administrator”

3. Accept the dialog that comes up (if it requires entering credentials, do the same)

Basically we now are running the command prompt in an elevated mode (relevant for Windows Vista & Windows 7)

4. Type net stop wuauserv

5. Wait for the WU service to stop and the command prompt to regain focus

6. Type net start wuauserv

7. This would start the service again.

It would also prompt a restart of your machine if there were pending existing updates intalled

Post that, you can check for updates and install without any issues.

Small stuff, worth a lot!!!