Scott Hanselman

One ASP.NET: Nancy.Templates for Visual Studio

May 6, '13 Comments [32] Posted in ASP.NET | Open Source
Sponsored By
NancyFX inside Visual Studio

I hope you've updated to Visual Studio 2012.2 and picked up Web Essentials because we're continuing to add goodness all the time. As we march forward with the One ASP.NET vision, so does the community. One of the major goals has been to make it easier for the community to not only make templates but also live alongside ASP.NET templates as peers. This has been historically hard. It's still too complex, in fact, but it's easier than before. I'm hoping that one day soon making templates will be as easy as making and sharing NuGet packages.

Not only is most of ASP.NET open source, but so are the Azure SDKs, NuGet and more. However, there's a large and rich world of open source frameworks and projects that some companies never get to use either because their company isn't into Open Source or because they won't use code that doesn't come from Microsoft.

Additionally, Microsoft, IMHO, has done a poor job (as a collective) letting developers know that there are options and options are good. Personally, I don't care if you use Entity Framework, or Web Forms, or MVC or Web API. You can use NHibernate, Nancy, Simple.Web, ServiceStack and OpenRasta. It makes no difference to me or my organization. If you are happy and using .NET, then I'm happy and that's great. Microsoft want you to use Azure and Windows, I'm sure, but after that ultimately the rest is just the details of your stack. You should explore the options available and work within your organization to be successful.

On the topic of options, NancyFx is an open source web framework for .NET that uses the Ruby Framework "Sinatra" as its inspiration. (Get it? Frank Sinatra's daughter is Nancy Sinatra.)

A few days ago (with some gentle prodding, and some great team effort) the NancyFx team created a VSIX to integrate the NancyFx Web Framework into the Visual Studio project dialog. (You can also get NancyFx from NuGet, of course.)

It's totally simple from your point of view, as it should be. Download the VSIX, and double click on it. Done.

Installing NancyFX into Visual Studio

Now, in Visual Studio, just File | New Project and  you've got more choices!

NancyFX in the Visual Studio File New Project Dialog

Nancy is a very lightweight and flexible framework for web sites and services. You don't even need ASP.NET proper. You can self-host in your own services or exe, or host within ASP.NET. You can use Razor syntax or choose other View Engines.

Here's Hello World:

public class SampleModule : Nancy.NancyModule
{
public SampleModule()
{
Get["/"] = _ => "Hello World!";
}
}

Interesting and very concise convention, eh? The Get["/"] syntax is a route, saying that an HTTP GET for / should be handled by this => anonymous method. It's all C#, mind you!

Here's the next step, passing a model into a View:

 public class SampleModule : NancyModule
{
public SampleModule()
{
Get["/"] = parameters => {
var person = new Person {
Id = 1,
Name = "Scott Hanselman",
Content = "Lorem ipsum...",
Tags = {"c#", "aspnet", "oss", "nancy"}
;

return View["Index", person];
};
}
}

Nice, eh? Very familiar if you're comfortable with ASP.NET MVC and general MVC-style frameworks. 

If you want to return Json, you can take an object and call AsJson() like this:

Get["/person"] = parameters =>
{
var person = new
{
Id = 1,
Name = "Scott Hanselman",
Content = "Lorem ipsum..."
};
return Response.AsJson(person);
};

UPDATE: I am reminded by commenters that Nancy now supports Content Negotiation ("conneg") and will automatically return the format that the client requested. This means if your HTTP headers say "accept: application/json" then you'll get JSON back automatically. Lovely, and no need for the AsJson() (unless that's what you wanted).

There's samples you can see at http://samples.nancyfx.org and you are encouraged to add your own sample. Just File | New Project, and make a Nancy Demo Application and follow the instructions.

NancyFx has a great community of users and you'll  often find them chatting on Jabbr or in their Google Group. There's even a Resharper Plugin for Nancy. Nancy also runs nicely on Mac with Mono and MonoDevelop.

Kudos and congrats to the Nancy team for being awesome, and for making these templates.

Related Links


SPONSOR: Big thanks to the feed sponsor this week, Ext.NET (seriously, check out their demos, really amazing stuff!) - Quickly build modern WebForm and MVC (including RAZOR) Apps for ASP.NET. Free pancake breakfast with all purchases!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Penny Pinching in the Cloud: Enabling New Relic Performance Monitoring on Windows Azure Websites

May 2, '13 Comments [13] Posted in ASP.NET | Azure
Sponsored By
New Relic view of my Website

I've been looking for ways to save money running my (now 12) websites in the cloud lately. Getting insights from logs has been helpful, but I really want more details as to what my app is doing so that I might do less of it. Remember the secret of scaling an application.

Have your app do as little as possible. If you do nothing, you can scale infinitely.

I like to use tools like Glimpse to profile my apps, check database calls, and explore what's really going on. If you like application insights you may be familiar with New Relic. They are a clever system that profiles apps of all kinds, including sites ASP.NET and Azure.

I tweeted this afternoon for folks to hit my site and help me test New Relic. My lovely friends on Twitter promptly DDOS'ed my site and I respect them all the more for it.

You can actually see my site getting loaded up in this chart, and see when I scaled up within Azure and switched from Shared to Reserved. The orange instance is shared, and the blue is a NEW instances when I switched to a Reserved VM. At this point, I had enough power to weather the storm. Thanks Twitter!My site getting beaten on

How did I setup New Relic on my Web Site? New Relic happens to have an office in Portland (where I live) so I went to visit today. Coincidentally (true story) their support for Azure Web Sites has sneaked out from a closed beta to an open one recently, so I decided to hide out and see if I could add New Relic performance and application monitoring to the Hanselminutes.com podcast site.

Adding New Relic to your Azure account

Login to the Azure Portal, click on New, then Store, then New Relic from within the Store.

Adding New Relic to my Azure Portal

Pick the free plan. You can have a free plan forever, they say. It doesn't include some "bells and whistles" and a storage of large amounts of historical data, but is otherwise quite functional. Plus you get a free 14-day trial (no credit card needed) of their Pro stuff.

Screenshot (19)

Create the Add-On. They tell me the Data Center Location for New Relic doesn't matter, as you are just going to get a license key.

NOTE: If you already have a New Relic license key and existing billing relationship the you don't have to use the store or add an add-on. You can use your existing license key. However, I want my billing centralized, so any bill from New Relic will go through my Azure account. It's up to you.

Adding New Relic

Now, from within the Azure dashboard, click the new New Relic node. You can click Manage to automatically move over (and automatically single sign on) to the New Relic system dashboard. Note also the Connection Info button there. We'll need that in a minute.

New Relic within the Azure Dashboard

If you click Manage and head over to the New Relic side you'll get a Welcome Message but you won't actually SEE anything interesting until your app has successfully made its first call to their system. You can check out their .NET docs if you like. They are in flux and not entirely accurate, but they'll get there.

We need to setup our Azure Website with some environment info, then add the New Relic NuGet package.

Staying with the Azure Portal, go to the Web Site you're going to instrument, and click Configuration and setup these Configuration Values. This hooks up the New Relic production profiler to the CLR. You can keep this running all the time, and it's easy to turn off.

Add these name/value pairs:

  • COR_ENABLE_PROFILING - 1
  • COR_PROFILER -{71DA0A04-7777-4EC6-9643-7D28B46A8A41}
  • COR_PROFILER_PATH - C:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll
  • NEWRELIC_HOME - C:\Home\site\wwwroot\newrelic

Your app settings will look like this in your website config within the Azure Portal:

Azure Website Config with New Relic

Make sure you not only Save your config, but also (at least once) do a complete RESTART for New Relic to get a chance to hook in.

Add New Relic to your Web Site

Install the NewRelicWindowsAzure Nuget package using the NuGet Package Manager Console using this command:

Install-Package NewRelic.Azure.WebSites

The website for Hanselminutes.com is running on ASP.NET Web Pages and was written with WebMatrix so I used the NuGet GUI. You can tell that this package JUST got uploaded at the time of this writing as there's only 11 downloads!

New Relic NuGet Package

Install this package and it'll lay down a few DLLS and your newrelic.config file. Go into the newrelic.config and copy in the license key from Connection Info (remember that? It's in the Azure Portal and pictured above) into the  config file. Also update your Application Name to some useful value as that's going to identify your site in the New Relic dashboard.

Here I am publishing my site up to Azure. Only the NewRelic agent dlls that I just NuGet'ed in to my app are being published (and a random jpg I forgot).

Publishing the New Relic Agent to Azure

Once I deployed the site and hit it, I could see Hanselminutes appear within the New Relic system.

Hanselminutes within NewRelic

Here's some of the data I could access now! I can see an updated graph of where my time is being spent, both server side AND browser side.

Response Time

I can see which pages load fast and which don't, and exactly why.

Screenshot (45)

I can see SQL Queries and how long they took, what connections were opened...

Screenshot (48)

And deep timelines showing not just where my time was spend in my application, but also where it was spent in the .NET Framework AND CLR itself!

Screenshot (50)

And of course, I can see Stack Traces of problems with my code.

Screenshot (53)

This just scratches the surface, really, but I'm stoked I was able to get the free New Relic tier setup on Azure Websites in just about 10 minutes. I found two spots where four SQL calls could possibly be collapsed into one. I also found a common (and dumb, on my part) ArgumentNullException that I'd been missing for weeks.

I'm pretty impressed with their offering. I think the Pro Tier is a little spendy for the small indie developer, but cheap for the pro dev. I'd like to see a $5 or $10 tier for small hobbyist sites but for now, Free is going to serve me very nicely.

Now I'm going to go and instrument my other sites!

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

CDNs fail, but your scripts don't have to - fallback from CDN to local jQuery

April 30, '13 Comments [46] Posted in ASP.NET | Javascript
Sponsored By

CDN issues in the Northeast

There's a great website called http://whoownsmyavailability.com that serves as a reminder to me (and all of us) that external dependencies are, in fact, external. As such, they are calculated risks with tradeoffs. CDNs are great, but for those minutes or hours that they go down a year, they can be super annoying.

I saw a tweet today declaring that the ASP.NET Content Delivery Network was down. I don't work for the CDN team but I care about this stuff (too much, according to my last performance review) so I turned twitter to figure this out and help diagnose it. The CDN didn't look down from my vantage point.

I searched for things like "ajax cdn,"microsoft cdn," and "asp.net cdn down" and looked at the locations reported by the Twitter users in their profiles. They had locations like CT, VT, DE, NY, ME. These are all abbreviations for states in the northeast of the US. There were also a few tweets from Toronto and Montreal. Then, there was one random tweet from a guy in Los Angeles on the other side of the country. LA doesn't match the pattern that was developing.

I tweeted LA guy and asked him if he was really in LA or rather on the east coast.

Bingo. He was VPN'ed into Massachusetts (MA). I had a few folks send me tracerts and sent them off to the CDN team who fixed the issue in a few minutes. There was apparently a bad machine in Boston/NYC area that had a configuration change specific to the a certain Ajax path that had gone undetected by their dashboard (this has been fixed and only affected the Ajax part of the CDN in this local area).

More importantly, how can we as application developers fallback gracefully when an external dependency like a CDN goes down? Just last week I moved all of my Hanselminutes Podcast images over to a CDN. If there was a major issue I could fall back to local images with a code change. However, if this was a mission critical site, I should not only have a simple configuration switch to fallback to local resources, but I should also test and simulate a CDN going down so I'm prepared when it inevitably happens.

With JavaScript we can detect when our CDN-hosted JavaScript resources like jQuery or jQuery UI aren't loaded successfully and try again to load them from local locations.

Falling back from CDN to local copies of jQuery and JavaScript

The basic idea for CDN fallback is to check for a type or variable that should be present after a script load, and if it's not there, try getting that script locally. Note the important escape characters within the document.write. Here's jQuery:

<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js"></script>
<script>
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='/js/jquery-2.0.0.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>

Or, slightly differently. This example uses protocol-less URLS, checks a different way and escapes the document.write differently.

<script src="//ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-2.0.0.min.js">\x3C/script>')</script>

If you are loading other plugins you'll want to check for other things like the presence of specific functions added by your 3rd party library, as in "if (type of $.foo)" for jQuery plugins.

Some folks use a JavaScript loader like yepnope. In this example you check for jQuery as the complete (loading) event fires:

yepnope([{
load: 'http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js',
complete: function () {
if (!window.jQuery) {
yepnope('js/jquery-2.0.0.min.js');
}
}
}]);

Even better, RequireJS has a really cool shorthand for fallback URLs which makes me smile:

requirejs.config({
enforceDefine: true,
paths: {
jquery: [
'//ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min',
//If the CDN location fails, load from this location
'js/jquery-2.0.0.min'
]
}
});

//Later
require(['jquery'], function ($) {
});

With RequireJS you can then setup dependencies between modules as well and it will take care of the details. Also check out this video on Using Require.JS in an ASP.NET MVC application with Jonathan Creamer.

Updated ASP.NET Web Forms 4.5 falls back from CDN automatically

For ASP.NET Web Forms developers, I'll bet you didn't know this little gem. Here's another good reason to move your ASP.NET sites to ASP.NET 4.5 - using a CDN and falling back to local files is built into the framework.

(We've got this for ASP.NET MVC also, keep reading!)

Fire up Visual Studio 2012 and make a new ASP.NET 4.5 Web Forms application.

When using a ScriptManager control in Web Forms, you can set EnableCdn="true" and ASP.NET will automatically change the <script> tags from using local scripts to using CDN-served scripts with local fallback checks included. Therefore, this ASP.NET WebForms ScriptManager:

<asp:ScriptManager runat="server" EnableCdn="true">
<Scripts>
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
</Scripts>
</asp:ScriptManager>

...will output script tags that automatically use the CDN and automatically includes local fallback.

<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
(window.jQuery)||document.write('<script type="text/javascript" src="Scripts/jquery-1.8.2.js"><\/script>');//]]>
</script>

<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.24/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
(!!window.jQuery.ui && !!window.jQuery.ui.version)||document.write('<script type="text/javascript" src="Scripts/jquery-ui-1.8.24.js"><\/script>');//]]>
</script>

What? You want to use your own CDN? or Googles? Sure, just make a ScriptResourceMapping and put in whatever you want. You can make new ones, replace old ones, put in your success expression (what you check to make sure it worked), as well as your debug path and minified path.

var mapping = ScriptManager.ScriptResourceMapping;
// Map jquery definition to the Google CDN
mapping.AddDefinition("jquery", new ScriptResourceDefinition
{
Path = "~/Scripts/jquery-2.0.0.min.js",
DebugPath = "~/Scripts/jquery-2.0.0.js",
CdnPath = "http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js",
CdnDebugPath = "https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.js",
CdnSupportsSecureConnection = true,
LoadSuccessExpression = "window.jQuery"
});

// Map jquery ui definition to the Google CDN
mapping.AddDefinition("jquery.ui.combined", new ScriptResourceDefinition
{
Path = "~/Scripts/jquery-ui-1.10.2.min.js",
DebugPath = "~/Scripts/jquery-ui-1.10.2.js",
CdnPath = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js",
CdnDebugPath = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.js",
CdnSupportsSecureConnection = true,
LoadSuccessExpression = "window.jQuery && window.jQuery.ui && window.jQuery.ui.version === '1.10.2'"
});

I just do this mapping once, and now any ScriptManager control application-wide gets the update and outputs the correct fallback.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
(window.jQuery)||document.write('<script type="text/javascript" src="Scripts/jquery-2.0.0.js"><\/script>');//]]>
</script>

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
(window.jQuery && window.jQuery.ui && window.jQuery.ui.version === '1.10.2')||document.write('<script type="text/javascript" src="Scripts/jquery-ui-1.10.2.js"><\/script>');//]]>
</script>

If you want to use jQuery 2.0.0 or a newer version than what came with ASP.NET 4.5, you'll want to update your NuGet packages for ScriptManager. These include the config info about the CDN locations. To update (or check your current version against the current) within Visual Studio go to Tools | Library Package Manager | Manage Libraries for Solution, and click on Updates on the left there.

image

Updated ASP.NET Web Optimization Framework includes CDN Fallback

If you're using ASP.NET MVC, you can update the included Microsoft.AspNet.Web.Optimization package to the -prerelease (as of these writing) to get CDN fallback as well.

Get Optimization Updates by "including PreRelease"

Note that I've on the Updates tab within the Manage NuGet Packages dialog but I've selected "Include Prerelease."

Now in my BundleConfig I can setup my bundles to include not only the CdnPath but also a CdnFallbackExpression:

public static void RegisterBundles(BundleCollection bundles)
{
bundles.UseCdn = true;
BundleTable.EnableOptimizations = true; //force optimization while debugging

var jquery = new ScriptBundle("~/bundles/jquery", "//ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js").Include(
"~/Scripts/jquery-{version}.js");
jquery.CdnFallbackExpression = "window.jQuery";
bundles.Add(jquery);
//...
}

Regardless of how you do it, remember when you setup Pingdom or other availability alerts that you should be testing your Content Delivery Network as well, from multiple locations. In this case, the CDN failure was extremely localized and relatively short but it could have been worse. A fallback technique like this would have allowed sites (like mine) to easily weather the storm.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

How to enable Google Now for iOS devices (iPhone, iPad) with Google Apps for Business Accounts

April 29, '13 Comments [23] Posted in Musings
Sponsored By

Google Now for iOS

I've got GAFYD (Google Apps for your Domain) running mail for hanselman.com and managing Google logins for the family. (There's 14 of us.)

Google Now (that's the fancy cards and predictive assistant) for iOS was just released (you can download Google Now here) and integrated into the Google Search app for iPhone and iPad.

If you install it and log in with your Google Apps account, you'll get an error that "your administrator hasn't enabled Google Now for your domain."

You'll need to (or your admin will need to) turn it on for your Google Apps Domain. It just takes a moment.

Note that you're changing this setting under Android but it affects iOS as well, which is why it's so unintuitive.

Google Apps for Business, Education, and Government: Google Now needs to be turned on by an administrator before it can be used.

If you are an administrator, you can enable Google Now for users in your organization by following these steps:

  1. Sign in to your Google Apps control panel.
  2. Go to Settings > Mobile > Org Settings > Android settings.
  3. Click the checkbox next to Enable Google Now to turn on Google Now.
  4. Click Save.

Here's a screenshot describing the flow, as it's not obvious.

Click Settings, Mobile, Enable Google Now

It took about 10 minutes for the setting to propagate. You may also need to force-quit the Google app for it to pick up the new setting. Your mileage may vary, but this IS how you enable Google Now, regardless of device.

I hope this saves you time and frustration. Pass it on.

UPDATE: If you've updated to the new console, the location in the new console is: https://admin.google.com/AdminHome#ServiceSettings/notab=1&service=mobile&subtab=org

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Review: The Lenovo X1 Carbon Touch is my new laptop

April 27, '13 Comments [108] Posted in Hardware | Reviews
Sponsored By

 

I have a new primary laptop and it's the Lenovo X1 Carbon Touch. It's an Intel Core i7 3667U running at 2 GHz. I got 8 GB of RAM and a 240 GB SSD. The integrated graphics are the Intel HD Graphics 4000 running a 14 Inch screen. It also has Bluetooth 4.0 (nice!) as well as Intel a/b/g/n WiFi.

The X1 Carbon Touch is super thin

Feel

First, it feels pro. It feels like a Lenovo, and I've always been a fan. You either love them or not. I do. Since my first T60p they've never done me wrong, and this one is no different. If you like Lenovo, you'll like this machine. If you're a discriminating business user who wants power and portability, you'll appreciate this Ultrabook.

The Lenovo X1 Carbon Touch Keyboard

The keyboard initially looks weird and a little "chiclet-y" and I assumed it would be uncomfortable to use and very much unlike the Lenovo keyboards of legend. You're likely familiar with the classic look and feel of ThinkPad keyboards. Once you're competent on a ThinkPad keyboard you expect to be good on any of them.

While it's different, with its ever-so-slightly concave "smile" keys, they have the same travel and quality feel of any Lenovo. I have had no trouble getting used to the keyboard. I'd say now after some weeks I prefer this keyboard to the previous version.

Ultrabook Size and Weight

Stacked from thin to not: Lenovo X1 Carbon Touch, MacBook Pro, Lenovo W520

That's the X1 Carbon Touch on the top there, then a 2011 MacBook Pro, and finally a Lenovo W520 on the bottom.

The W520 is 1.5" thick and weighs 5.75 lbs with the 9 cell battery. While the 1080p screen was nice, carrying this beast all over the world DID tire me out. Add a few more pounds for an AC adapter that weight a pound itself, your phone and accessories, and you had a 10lb backpack pretty quickly.

The MacBook Pro weighs 5.6 lbs with a native 1400x900 screen. I tried using this as my primary for a few months and while the hardware build quality is top-notch, I found myself pawing at the screen unconsciously. More on this later, but once you really add touch as a complementary input option, you'd be surprised how often your brain assumes every machine has touch.

The X1 Carbon is super thin (slightly less than 3/4 of an inch), and light enough (just 3.4 lbs) to hold comfortably with one hand and faster than the W520. Sold. The major trade-off was 1600x900 resolution (rather than a full 1080p) and the lack of a third USB port, but its light weight is a daily joy. It's not quite half, but FEELS half as light as the W520 and MacBook Pro. It's only a 13.5" screen, but I have quickly adapted to it. Plus, I can run a large monitor (or they say, 3 with the USB Dock when it shows up) without trouble.

Out and About

Seriously, all laptops should be this thin and light. There's just no reason anymore for a 6 to 10 lb laptop and I said as much in my post "My next PC will be an Ultrabook."

I can truly see why MacBook Air folks are so enthusiastic. All Ultrabooks have an "Air" about them. When you can throw your 3lb Ultrabook in a Messenger Bag and it's no heavier than a few magazines, you're much more likely to carry it around. Add in 6(ish) hours of battery and you can comfortably move around before you have to plug in. Even better, somehow this thing charges FAST. Just 30 minutes of charging has topped me up 50-70%. I had a 20% low battery after a flight, plugged in while eating at the airport for a half hour, then ran to the next flight and I was more than 70% and able to work the next flight too. I'm getting >4 hours working hard, and have gotten as much as 6 with low brightness and just browsing or watching movies.

One of the USB ports will provide power to one device so you can charge your phone while the laptop is off. I love laptops with this feature. It saved me just last week while travelling. You can also charge the laptop with a phone connected so everyone gets charged.

The X1 also has a SIM slot for a 3G connection, although I've never met someone who used this. It worked fine with my AT&T 3G SIM but considering that I can tether from almost any device including my phone, plus the wide availability of sharing devices using 4G or LTE, this is a slot on this laptop you'll never fill.

Touch

Let's get real about touch a minute. Here's what I said before:

Don't knock a touchscreen until you've used one. Every laptop should (and will) have a touch screen in a year. Mark my words. This nonsense about how your arm will hurt assumes that you're only using it. A touchscreen is complementary not primary. I use it for pinching, for scrolling web pages, and for launching apps. It's much faster to just touch the icon than to mouse over to click one.

This X1 Carbon isn't a tablet, nor is it trying to be a tablet. It's a fantastic fast and light Ultrabook with a touch screen. Say what you will about Windows 8 and it's fullscreen interface, but I maintain that the addition of a touchscreen is as significant as the addition of a mouse. Similarly, when voice input is 100% reliable, adding voice will be equally as significant.

Three great input methods are better than two. I move from keyboard to mouse to touch smoothly.

Type type, mouse, swipe, type type, touch, click.

Sorting slides, moving files, swiping to the previous app, but most of all, scrolling around. Sometimes I use the two-finger scroll down gesture via the touchpad to scroll but often I hold my right hand around the screen and scroll down with my thumb. Often I'll pinch to zoom. It's extremely comfortable.

Reviewers and journalists need to understand that these computers aren't made for them. They are made for my kids and the touch generation. Touch screen MacBooks are inevitable. It will happen. Touchless is next after that.

If you do mobile device development, running these emulators with a touch laptop is a joy. Let me rephrase. Get a freaking touch screen, mobile developers. Touch on your laptop will make you happy every single day.

Learn to integrate touch into your existing keyboard and mousing style and you'll be faster and more effective than ever. If you use just one input method, you are missing out.

Dongles Galore

I also bought the requisite dongles including a Mini DisplayPort to VGA Adapter and Mini DisplayPort DVI. If you like wired network access, you'll also need the USB 2.0 Ethernet Adapter. Other than having to carry them around in my bag, dongle life is what it is. I'd rather have a slim laptop on a few adapters than continue to carry the Lenovo W520 I've been carrying.

I have ordered the Lenovo Think Pad USB 3.0 Docking Station but it hasn't arrived yet. I will update this review once it arrives. The docking station adds 5 USB 2.0 ports and an additional USB 3.0 port. It also includes Gigabit Ethernet.

This Docking Station also includes two (2) DVI ports which brings the number of monitors this laptop can run up to four. Well, three external (two DVI, one DisplayPort) and the built in LCD. It runs my 24" LCD over DVI today famously and without any trouble at all. I've also presented with this laptop using the VGA adapter and had exactly ZERO problems. The Display Drivers and adapters are rock solid.

Screen

There's been a lot of discussion about the screen on the X1 Carbon Touch. There's a protective film later over the screen and it really bothers some people. Some folks have successfully pried it off with some patience. Honestly, I noticed it for a day and then I stopped caring. I've spoken to folks who have said it was irritating enough that they sent the laptop back. Others just don't care. It's a clear, clean, bright screen and I'm happy with it.

X1 Carbon Touch Screen

X1 Carbon Touch Screen

It's not retina, but it's a great clear screen with great brightness and excellent horizontal viewing angles. It's a solid 14". I am surprised at the size of the W520 now that I've adapted to the X1.

Phrasing it differently, the X1 is a great mobile workstation. The W520 is a great workstation that can be moved occasionally.

The Good

It's really fast. I got the i7 processor version and it's fast. The 240gig SSD is lovely and devoid of hiccups. Visual Studio starts in 5 seconds cold, and 2 seconds warm. It runs Hyper-V nicely, and I've also run the x86 Android Emulator full speed as well as the Windows Phone emulator.

If you look at the WEI (Windows Experience Index) you'll be disappointed by the 5.5 Desktop Graphics performance, but I'm starting to think that this score should be thrown out. 2D graphics performance, while measureable, just isn't easily noticeable in day to day business use. We care about scrolling around in large documents, Excel, big PDFs, long web pages. The Intel integrated video in the X1 Carbon Touch is more than adequate. It's even pretty good in 3D games, handling games like TorchLight II very nicely if you turn antialiasing down just a smidge.

WEI for the Lenovo X1 Carbon Touch - 7.1, 7.4, 5.5, 6.4, 8.1

Tiny Happy Features

There some other nice features that are small but important that make this a great business machine.

  • A decent 720p HD integrated Webcam. I've used it with Skype and Lync and it works great. I wish it was angled slightly higher but that's a nit.
  • It has not only hardware volume buttons (which we expect) but also a hardware microphone mute button with an LED indicator which is great for long conference calls.
  • It boots up fast and sleeps very reliably. It reboots only when a Windows update requires it. I can close it and put it in my bag without concern.
  • A hardware Airplane Mode switch. This is not just a "turn off devices hard" button but it's integrated with Windows 8 and turns off all radios with a hardware switch. Also nice for saving batteries.
  • Good quality mics. I don't like doing conference calls or video conferencing with just a laptop's microphone but this one is better than usual.
  • Integrated TPM (Trusted Platform Module) so I can BitLocker my C: drive easily, and I have. I also get DirectAccess and a virtual Smart Card so I don't need to use VPN and am always logged into work. Super convenient.
  • Integrated Fingerprint login. I used to use this all the time on my W520 but for some reason I've been using the Virtual Smart Card lately. Still it's a nice login feature and I've had good experiences with it before.
  • One combination headphone/mic plug. Most good laptops have this now. You can use a good pair of headphones (or your iPhone headphones) and get mic and headphones in one. This detection is integfrated with the audio system.
  • Integrated SD card slot.
  • It's SO quiet. I sometimes wish it wasn't silent so I could know what it was doing.

And finally, one piece of software that came with it that I thought would suck but didn't - the Dolby Home Theater software. It actually has some nice presets for movies, VOIP, and music that definitely improve the output (or perception of output) of the speakers.

The Bad

The touchpad is the worse part of this device. Initially I hated it. They've removed the small textured touchpad I love from the W520 with it's buttons on the bottom, and replaced it with a new glossy glass touchpad. It's the lack of buttons on the bottom that's killing me. I keep bumping the touchpad while I'm using it and the cursor jumps.

It took me a few days to realize why this was happening, then I realized that I historically cursor with my index finger and rest my thumb on the bottom of the touchpad. With other ThinkPads there are buttons at the bottom that my thumb rested on. With the X1, I was resting on the touchpad itself. This just took a week of conscious thought and it's cool now, but be prepared for that "changeover" time as you teach yourself where to place your fingers while mousing. I'm interested in other X1 Carbon owners' thoughts on the touchpad in the comments.

The Carbon Touch has a much larger touchpad than the W520

I had to fiddle with the touch settings a little as well, as I move fast. I recommend power users turn down the duration you need to press and hold in order to activate a Right Click action. I also turn on the "Touch Feedback" so you can actually see the results of your touch. It's meant for presenters, but it's really nice to get the visual feedback that the system has recorded your touch.

Modify the Touch Settings to optimize your X1 Carbon Touch

The X1 Carbon Touch can also get a little hot. You'll only notice this if you are really a LAP-top person (and I'm not) but even now as I write this I'm running two instances of VS, PhotoShop and a Virtual Machine in Hyper-V doing Windows Update within a Windows 7 VM. It's not going to burn me, but it is definitely hot.

Finally, I did have one day with a really lousy Wi-Fi driver while I was travelling. The MGM Grand Hotel in Las Vegas had a wireless network that this Intel Wi-Fi card just hated. I was getting lockups and it was generally bad. However, I switched to using a 4G hotspot and updated the driver and never saw the issue again. Moral - Make sure you're using tested and reliable "out of the box" drivers. I am sticking with the drivers from Windows Update for important things and Lenovo System Update for non-essential drivers. I'm also finding the SD card (Ricoh) driver to be a little suspicious so I'm keeping it disabled in Device Manager when I'm not using it.

I recommend you uninstall ALL random software (there's not too much) that Lenovo puts on it except the Lenovo System Update. I use this for only for drivers and small utilities that give you things like on-screen caps lock notifiers.

The only other thing I really wish this laptop had was an extra USB port. There's one USB 3.0 and one USB 2 port and I really needed a third USB port recently while presenting. I used the USB to Ethernet adapter along with my USB Arc Touch Mouse and was stuck. I needed a third post for a the presenter remote. This is a small irritant, but I noticed it.

Conclusion

This is a very solid touch Ultrabook that I'm currently using as my main machine. The Lenovo X1 Carbon Touch has replaced my Intel Ultrabook which has been passed on to my wife. My Lenovo W520 is currently my emergency backup machine and is weighing down my bookshelf. I'm taking this device everywhere I go and when I'm not at home it's my primary development machine.


Sponsor: The Windows Azure Developer Challenge is on.  Complete 5 programming challenges for a chance at spot prizes, Stage prizes and the Grand Prize. Over $16,000 is up for grabs with 65 chances to win!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.