Anything related to the .NET framework
15 Sep 2011

Windows 8: How to get it working

(Update 1) Note: This relates to the Windows 8 Developer Preview, your mileage may vary and this may change.

This post is here to help you, and me, by sharing solutions that I am finding while trying to get Windows 8 running for a professional developer. I am using a HP 8510w laptop so some things maybe specific. This will be updated randomly and will be more like a live blog than a polished post.

(Update 1) As I update this I will prefix new content with (Update #) where # is the update number. The latest ones will be in bold.

Problems & Solutions


I have a NVidia Quatro graphics card and to get it working correctly with Win8 (rather than the basic graphic driver) I needed to use the BETA driver from: Beta and Older Driver Versions – I used the Verde 285.27 Driver and that worked just fine, everything else was broken in one way or another.

(Update 5) This just worked with the Windows 8 Community Preview

.NET 3.5

imageA bunch of apps use .NET 3.5 or earlier so I needed that. To install it you must install it via the Turn Windows Features On/Off  option in the control panel (it’s under Programs). I had a BUNCH of issues (error 0x800F0906) getting it to work as it needs to download it which I think are proxy related. Once I downloaded via 3g it finally came down (took an hour Sad smile).

(UPDATE 2) Tried this via a transparent proxy and it worked too. Seems it is related to proxy servers that require basic authentication.

(UPDATE 4) Finally found a solution Smile Thanks to Zayd Kara for helping me with this:

Copy the SXS folder from the Windows 8 ISO to the C:\Temp folder.

Then run: dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:c:\temp\sxs /LimitAccess


Metro Style Apps Don’t Run


(Update 1) Found the error message in the Event Log (Application and Services Logs –> Microsoft –> Windows –> WwaHost –> Admin)

Windows Web Application Host has encountered an unexpected exception. The error is number 0x8007000E.


(UPDATE 2) One of the best new features in Windows 8 is the ability to reset your machine without affecting your files. I did this and this solved all my issues image

(UPDATE 4) The cause of this is the DLink modem software for my 3G modem. It is screwing up com. No idea why, and no way around it. That’ll teach me to use a 3g modem that doesn’t work with the natively Windows 7/8 mobile internet support.

Windows Phone Developer Tools

The 7.0 RTM release will NOT install at all. The 7.1 RC will install so you may need to get that one.

YOU MUST install .NET 3.5 first (see above). Once installed I didn’t have any emulator options and trying to run it would cause: HRESULT: 0x89721800

I resolved this by deleting “%LOCALAPPDATA%\Microsoft\Phone Tools\CoreCon\10.0” (source for that App Hub Forums)

The emulator option appeared but now when I try to run it, it crashes Windows 8 with a BSOD related to vmm.sys – no solution yet.

(UPDATE 2) I have tried everything and nothing seems to help. Resorted to using a Windows 7 boot from VHD to be able to run these tools Sad smile

(Update 5) Solved:

Microsoft Security Essentials

It would not install because of a compatibility issue Sad smile Downloaded it again from the website, which doesn’t tell you version numbers and the file size looked the same, but this newer one did work fine.

(UPDATE 2) Paul Adare pointed out on the forums that this is included now out of the box, so not needed Smile 

Switch to Live ID

Not working, error 0xD00000072 – suspecting proxy again.

Install of Visual Studio 2010 Offline Documentation

Completely failed, no idea why.


D-Link 3G Modem

It could not find the drivers, so I had to go to device manager, select the unknown devices –> Right click –>  Update Driver –> Browse my computer –> C:\Program Files (x86)\D-Link Connection Manager\drivers\64bit\WIN7

Then it found and installed the drivers for the 3G modem

(Update 1) Visual Studio 11 Express for Windows Developer Preview

Cannot build or run Metro Style apps.

Designer is failing with Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))

And running them fails with Unable to activate Windows Tailored application

I suspect this is related to the Metro app issue above.


(Update 1) Internet Explorer 10

Two interesting issues, one browsing our intranet which runs on HTTPS any content from HTTP fails to load and there is NO option to allow it.


Second issue is in the IE desktop mode there is no tooltips Confused smile 


However the solution is to run the Metro Style Internet Explorer, and it shows tooltips… and they are LOVELY:


(Update 3) SharePoint

I am referring to connecting to SharePoint server using IE 10, in short – it is horrid for anything other than basic browsing. I have installed Chrome to get around this.

(Update 3) Windows Server AppFabric

imageI needed Windows Server AppFabric installed so I could do development, however AppFabric does not install on Windows 8 Sad smile

To work around this I waited for the error to appear, then browsed to the extracted files (the moment you click ok on the error it cleans itself up) and used the expand command to extract the msu file which you can find in the packages folder.

That gets me a cab file which I extract again and that produces another 1 996 files. In there I used the file search to find the assemblies I needed to get the code to build, won’t run but at least I can code Smile

(Update 4) HP LaserJet 4250 Printer

I have this printer on the network but it was horrid trying to get Windows to see and work with it. The trick was to download the actual PCL6 drivers from the HP website. This has all the options to set it up and it works fine now Smile

(Update 5) This just worked with the Windows 8 Community Preview

Things that just worked

For balance here are application that have been installed with no issue.

  • Visual Studio 2010 + SP1
  • Firefox 6
  • Chrome (what ever the latest is)
  • Windows Live Writer
  • TweetDeck
  • Office 2010 + SP 1
  • (Update 1) VLC
  • (Update 3) Pull

There is also some more info in the comments!

08 Sep 2011

.NET 4, do you know the new features? - Top 10 most useful features


More in this series can be found in the introduction.

In the past two posts we have looked at the negative (top 10 least known, top 12 most useless) so lets switch to the positive side and see what is on the list for top 10 most useful features.

This is worked out by those who knew the feature and indicated it was useful using the same ratio as explained in the in top 12 most useless post.

CLR/BCL: IsNullOrWhiteSpace

Useful Ratio: 21 : 1

Introduction: We have had IsNullOrEmpty on string for a while but in .NET 4 we have the added IsNullOrWhiteSpace which checks for Nulls, empty strings or strings of just white space.

Thoughts: Easy to see why this is useful, it covers more scenarios than the old one, it is easily discoverable and it solves a difficult problem (I do not think many people understand all the white space charters).

More Info:

CLR/BCL: Stream.CopyTo

Useful Ratio: 19 : 1

Introduction: You have two streams, you want to copy from one stream to another one, which previously took 6 lines of code, a loop and 3 variables now uses 1 line of code and always works.

Thoughts: A common problem and a great solution and is easily discoverable because the method name is exactly what you would be looking for.

More Info:

CLR/BCL: Enum.HasFlag

Useful Ratio: 17 : 1

Introduction: Enumerator has support for bitwise operations but previously has involved a fairly unintuitive calculation. I think that it was so unintuitive that some people have never even realised bitwise operations were supported. Now we have a single method which makes it VERY easy.

Thoughts: Making the hard easy and making it very discoverable – the factors of all these top useful functions!

More Info:

CLR/BCL: Enum.TryParse

Useful Ratio: 7.6 : 1

Introduction: Going from a string to an enum has been possible in the past but it has never been a fluid experience. No support for generics and not easy to to handle bad data easily. TryParse solves those by brining generics into it and providing a response to tell you if it succeeds.

Thoughts: I think this is a BIG problem for many developers and this is a great and useful solution.

More Info:

CLR/BCL: TimeSpan parsing improvements

Useful Ratio: 5.7 : 1

Introduction: Parsing strings into timespans is not easy, there is many ways to type in time ranges and it has been difficult for people to get right constantly… until .NET 4!

Thoughts: I am surprised at how highly this is up the list, it is useful but ranked this high surprises me as I do not think many people use TimeSpan’s in business systems.

Update: Mark Stacey on Twitter provided some good business use cases I didn't think of (Tweet 1, Tweet 2): "Absolutely. Business process stuff ~ loan applications, time since call was logged, tons of others. Especially where multiple applications work in process."

More Info:

CLR/BCL: MemoryCache

Useful Ratio: 5 : 1

Introduction: MemoryCache is a per process in memory cache for your application which is VERY easy to use regardless of application type – prior to .NET 4 only ASP.NET had an in memory cache. There is also some low plumbing that makes it possible to have the cache stored to other locations, like files or SQL.

Thoughts: This is one of only two features in this list that also appeared in another list, in both cases the top 10 unknown features. This brings joy to me since it means that the issue here is discoverability because once you know it – you find big value in it Smile

More Info:

CLR/BCL: string.Join

Useful Ratio: 4.7 : 1

Introduction: Join allows us to concatenate an array of strings together with a specific separator character in place.

Thoughts: This is very useful, as there is often times you need to loop over strings and build up another string. Think of in line SQL generation with a WHERE clause! Very useful stuff.

More Info:

Parallel: Parallel Extensions

Useful Ratio: 3.7 : 1

Introduction: Writing code that runs across cores has not been easy and the parallel extensions make it easy to understand how when thinking about normal for or foreach looping structures as it provides implementations of those looping structures which do run across multiple cores.

Thoughts: A fantastic edition to the framework and a much needed one to help solve the issue of having multi-core machines but the complexity of threading not being worth the effort. Why this is came in so high compared to the other two new additions in parallel (TPL was ranked 14th most useful & PLINQ 22nd) is odd but maybe because this is the easiest of the three to understand.

As a side not this is the only one of the most useful top 11 that I didn’t cover in my .NET 4 Baby Steps series which really makes me proud since it shows I was on target for that series.

More Info:

CLR/BCL: 64bit identification on Environment class

Useful Ratio: 3.5 : 1

Introduction: The environment class has been enhanced to have two new properties which help if the OS is 64bit and the process running is 64bit.

Thoughts: This also appeared on the top 10 unknown feature list, so really highlights that developers are either not thinking about 64bit at all but when they do, the tools they need are available.

More Info:


Useful Ratio: 3.2 : 1

Introduction: Lazy allows you to wrap a class (target class) in another class (Lazy<T> class) and gain lazy constructor calling on the target class.

Thoughts: Very nice feature, but I am surprised it did this well on the useful list as I see this as a bandage to a bad design solution. Proper use of patterns and planning in code should prevent usage – but I’ve been known to be wrong so tell me in the comments why you see this as useful!

More Info:

07 Sep 2011

.NET 4, do you know the new features? - The 12 features the majority thinks are useless.


More in this series can be found in the introduction.

Another interesting statistic was that only 12 of the 61 features are rated useless, in other words more people thought those features were useless than useful.

This is really good, because this really means that about 80% of the new features are seen to be useful and thus that was a good spend of resources for Microsoft.

I am measuring this in a Useful Ratio – Number of people who think it is useful compared to number of people who think it is useless. For examples:

  • 1 : 1 – For every one person who thinks it is useful, one person thinks it is useless
  • 2 : 1 – Two people think it is useful for everyone that thinks it isn’t.
  • 0.5 : 1 – Half a person thinks a feature is useful compared for everyone who thinks it is useless.

CLR/BCL: Addition & Subtraction with IntPtr & UIntPtr

Useful Ratio: 0.3 : 1

Introduction: Adds an offset to the value of a pointer.

Thoughts: The first feature to appear on more than one list, as it also appeared on the top 10 least known. So this brings up an interesting though – you either don’t know of this or you think it is shit. My views of why this is useless is the same as why it is unknown, the use case for this is TINY!

More Info:

CLR/BCL: Complex Number Support

Useful Ratio: 0.3 : 1

Introduction: Complex numbers are a specific mathematical concept especially for doing graphs, vector calculus and other things that are pretty specialised.

Thoughts: .NET 4 also included another new construct called Tuple and .NET has had KeyValuePair for ages and this seems very similar to those (from the perspective of someone without university math). All it gives compared to the other two are some easier math functions. So easy to see why it is not that useful as it is easy to implement those on Tuple or KeyValuePair.

More Info:

WPF: Touch Support

Useful Ratio: 0.4 : 1

Introduction: WPF now supports input from touch, like you can touch buttons and text boxes etc…

Thoughts: This feels very similar to System.Device.Location which is hampered by the lack of hardware that supports the feature.  WPF is doubly hurt because Silverlight is competing with it and has touch support already.

More Info:

CLR/BCL: Side by Side (SxS) CLR's in the same process

Useful Ratio: 0.6 : 1

Introduction: Prior to .NET 4 you could not allow two different CLRs (i.e: 1.0, 1.1 or 2.0) in exist in the same process.

Thoughts: I hit this a few times with ASP.NET where two sites ran in the same AppPool and one site was running 1.1 and the other 2.0 and there would be a failure.

This was primarily put in also to allow plug-ins built in different CLR’s run in the same application.

Besides the ASP.NET issue I’ve not seen a need for this, it really feels like plumbing for future applications.

Update: Mike posted in the comments a great use case I didn't think of, which adds more value for this feature.

More Info:

WPF: Text Rendering Stack

Useful Ratio: 0.6 : 1

Introduction: WPF previously rendered text differently to how Windows did, this is where the perception of it being blurry comes from. As part of Visual Studio 2010 they used WPF and spent considerable time improving the text rendering.

Thoughts: I don’t get this, it means that WPF is better looking and it costs nothing for you. Maybe the issue is because it costs nothing people see the value as nothing?

More Info:

ASP.NET: CDN Support

Useful Ratio: 0.7 : 1

Introduction: Microsoft has a large content delivery network which contains many scripts that web sites use, like jQuery. Using a CDN can significantly improve performance of your website.

Thoughts: Reasons why I think people don’t like this:

  • Internal only applications cannot benefit from this.
  • People prefer other CDN’s – as there are a few BIG ones now.
  • People don’t trust a CDN

If you can use this this, you should, it is a simple switch to turn it on.

More Info:

CLR/BCL: ETW Support

Useful Ratio: 0.8 : 1

Introduction: ETW, Event Tracing for Windows, is a feature of Windows for doing logging at the kernel level. It is brilliant as you can do THOUSANDS of messages per second with VERY low CPU usage. With .NET 4 we have CLR support for this so understanding what is happening in the CLR along with our applications becomes very easy.

Thoughts: We have been able to write to ETW since .NET 3.0 – all this is is support for the CLR events, so really you need to be debugging performance issues in the CLR.

More Info:

ASP.NET: Grid & List Row Selection Persistence

Useful Ratio: 0.8 : 1

Introduction: Allows the selected row in a list or grid to be persisted automatically over post backs.

Thoughts: Simple for why this is not seen as useful: People who care use ASP.NET MVC

More Info:

CLR/BCL: Primary Interop Assembly Embedding

Useful Ratio: 0.9 : 1

Introduction: PIA’s (Primary Interop Assemblies) are mappings between COM+ API’s and .NET. Similar to header files in C. These are exposed as separate assemblies and in .NET 4 you can embed just the code you use in your assembly as part of the build rather than requiring the separate assemblies.

Thoughts: I don’t think this is important at all – we have learnt to include the assemblies we need with our solution so embedding code is just a solution to a problem that didn’t exist.

More Info:

CLR/BCL: SortedSet

Useful Ratio: 0.9 : 1

Introduction: SortedSet is a class for doing sorting, similar to SortedList or SortedDictionary. However where the old ones internally use a hash table, this uses a binary tree and thus gets some FANTASIC performance in many situations where the others would have bad perf.

Thoughts: I don’t think there is enough understanding of patterns with .NET developers – we are too quick to just use what Microsoft gives us and move along. So there isn’t enough people thinking about the pattern for their data structures so they see this as a solution to a solved problem. Those that do care, already have built their own code for this problem.

More Info:

WPF: Windows 7 Integration (System.Windows.Shell)

Useful Ratio: 0.9 : 1

Introduction: Building a WPF application and want to take advantage of new Windows 7 features like the taskbar, quick launch or overlays? It is easy with the System.Windows.Shell.

Thoughts: I don’t get why this isn’t more popular, it is a VERY useful set of tools. Maybe people just don’t like WPF?

More Info: Rudi Grobler has a series on this:

ASP.NET: Routing for WebForms

Useful Ratio: 0.9 : 1

Introduction: ASP.NET MVC brought us routing support so that we can direct URL’s to specific content based on a convention or a configuration. With .NET 4 we get support for this in WebForms.

Thoughts: WebForm developers don’t care about this, they have never needed it and don’t need it now. I see the big market for this is actually hybrid scenarios where you using WebForms and MVC in the same system… a VERY small market.

More Info:

06 Sep 2011

.NET 4, do you know the new features? - Top 10 Least Known Features

More in this series can be found in the introduction.

image_thumb[2]We start off with the features that people just did not know about. I measured this on percentage, i.e. percentage of people who answered that they did not know about feature X.

The top 10 features in the dark are:

CLR/BCL: Microsoft.Win32.RegistryView

Percentage of People that Didn’t Know (PPDK): 90%

Introduction: On the 64-bit version of Windows, portions of the registry are stored separately for 32-bit and 64-bit applications. There is a 32-bit view for 32-bit applications and a 64-bit view for 64-bit applications.

Thoughts: If you just write to or read from the registry in your application you do not need to specify this. This means this feature is really only needed by people opening registry values for Windows or other applications, a very specific usage, so not surprised by this finding.

More detail:

CLR/BCL: Addition & Subtraction with IntPtr & UIntPtr

PPDK: 85%

Introduction: Adds an offset to the value of a pointer.

Thoughts: I can’t think of a scenario for the usage of this that most business application devs would care about – maybe it is useful doing interop or game dev. So not surprising it very unknown.

More detail:

CLR/BCL: System.Device.Location

PPDK: 84%

Introduction: Allows you to talk to GPS sensors that Windows 7 supports.

Thoughts: Most Windows 7 machines, laptops, desktops etc… do not have a built in GPS yet so not surprising this isn’t well known. It is a pity since it is an awesome feature to include in applications and can work with a software GPS like GeoSense for Windows.

More detail:

CLR/BCL: 64bit identification on Environment class

PPDK: 83%

Introduction: There is two new Boolean properties on System.Environment, one tells if the OS is 64bit and the if the process is 64bit.

Thoughts: Not sure why this isn’t better known – maybe people just don’t care about 64bit vs. 32bit or maybe people are not optimising for the operating system.

More detail:

CLR/BCL: Improved NGen sub-system

PPDK: 82%

Introduction: NGen is the sub-system or command line which compiles your assemblies from IL to machine code and can result in start up performance improvements.

Thoughts: This is a very specialised system and I have never seen anyone except Microsoft use it. So not surprised at all that people do not know of it.

More detail:

CLR/BCL: New options in Environment.SpecialFolder

PPDK: 80%

Introduction: This is used to help find the path to those special folders (think My Documents, which changes from profile to profile for example) and is used in conjunction with the GetFolderPath (see below).

Thoughts: There 25 new options, and some are just useless (Windows & Fonts for example: if you know the System drive they are ALWAYS <system drive>:\Windows & <system drive>:\Windows\Font respectively this is because Windows is has to be installed to a folder called Windows), but many others are very good and useful especially the x86 specific folders if you on a x64 OS & support for new Windows 7 features, like common folders.

So why it is so unknown is beyond me – this is GOOD STUFF!

More detail:

CLR/BCL: ETW Support

PPDK: 80%

Introduction: ETW, Event Tracing for Windows, is a feature of Windows for doing logging at the kernel level. It is brilliant as you can do THOUSANDS of messages per second with VERY low CPU usage. With .NET 4 we have support for this in our applications and support to log information from the framework, like garbage collections.

Thoughts: Even though this is brilliant and powerful but logging is solved problem. So this really is only used or needed by people with some massive performance issues and I do not believe most developers are working on solutions at that scale.

More detail:

CLR/BCL: GetFolderPath improvements

PPDK: 80%

Introduction: GetFolderPath is used with Environment.SpecialFolder (above) and the improvements to create the folder and control verification if the folder is created.

Thoughts: The GetFolderPath additions are a new overload so if you were using it prior to .NET 4 it may look the exact same, so this could just be a discoverability issue.

More detail:

CLR/BCL: MemoryCache

PPDK: 79%

Introduction: MemoryCache is a per process in memory cache for your application which is VERY easy to use regardless of application type. There is also some low plumbing that makes it possible to have the cache stored to other locations, like files or SQL.

Thoughts: WHAT THE HELL PEOPLE!? Don’t you people use caching?! I don’t get this at all, not even slightly. If you have an idea why this is so unknown, please share with me in the comment.

More detail:

CLR/BCL: GUID Parsing Improvements

imagePPDK: 77%

Introduction: This is a way to parse a string in and have it converted to a GUID, regardless of the format of the GUID.

Thoughts: I just don’t think people need to do parsing of GUID’s that much and so it isn’t needed that much.

More detail:

05 Sep 2011

.NET 4, do you know the new features? - Introduction

imageAs part of my work ahead of Microsoft Tech·Ed Africa 2011 I did a online, anonymous poll to see how well known are the new features in .NET 4, and over the next few days I thought I would share my findings.

The poll asked you to state for feature X: Do you know it? And if you do know it, is it a useful feature?

I listed 61 features that are new in .NET 4 – which pretty much covered the length and breadth of it. There is some consolidation, like ALL of Workflow is one item but WF4 is a rewrite so pretty much is one BIG new feature and some other aspects of consolidation.

I suspected a fairly high rate of known features because .NET 4 was released 16 months ago (12 April 2010) and it has been demo’d and talked about a lot - even I have done a talks on the new features. However the ratio of unknown to known is 1.2 : 1 – so while there is a close parity, there are more are unknown than known, which surprised me a bit.

I have broken up talking about the results into a series, because I want to talk about each feature briefly so a single post would have been MASSIVE.

Below are links to the other parts of the series:

Finally I want to say a BIG thanks to everyone who answered and those who shared links on social networks and with friends!

The raw data can be found below.

File NET 4 Feature Data.xlsx12.99 KB
02 Sep 2011

Lightswitch is on SALE!

Nurt img1Very different from my normal ramblings but I thought worth a quick post, Microsoft has Lightswitch on sale at the moment for 33% off the price! This is a world wide offer so you can get it via your distributors, LARS or from the Microsoft Online Store.

So if you are looking to get started in Lightswitch, NOW IS THE TIME!

30 Aug 2011

OLE DB is dead, long live ODBC

imageMicrosoft has announced that OLE DB with regards to SQL Server has entered the end of it's life - it has about 7 or 8 years left and "Denali", the next version of SQL Server, will be the last version to support it. The recommendation is to use ODBC going forward.

The reasoning is pretty sound to me:

  1. Better cross platform support - yip Microsoft cares about cross platform.
  2. Better clound support - No surprise that Microsoft cares about the cloud.
  3. I am also assuming that budget is part of this, providing OLE DB & ODBC is two dev teams, two test suites etc… Just doesn’t make sense. Rather consolidate and spend the savings elsewhere.

It is important to note that other OLE DB providers and OLE DB itself are still continuing, we are just talking about SQL Server.

Have a look at the picture to the right only two out of the seven are affected by this announcement, that means there is still a big investment in it and I doubt we we will see OLE DB going away completely anytime soon.

Microsoft has produced a helpful guide to migrating which you can get below.

29 Aug 2011

Nugget: String concatenation compiler optimisation

William Brander responded to my last nugget on compiler optimisation with a tweet about another one:


So what does that look like? Let’s look at the code we type:

string interesting = "first";
interesting += " second";
interesting += " third" + " forth";
interesting = interesting + " fifth";
interesting = interesting + " sixth" + " seventh";

And this optimises the concatenation to a single line and drops the variable. Interesting use of braces for fifth & sixth though, when I switched += to =.


Console.WriteLine(("first" + " second" + " third forth") + " fifth" + " sixth seventh");