Lars Wilhelmsen

Microsoft Connected Systems MVP

Skip to: Content | Sidebar | Footer

WCF Test Client doesn’t speak Norwegian…

22 June, 2010 (10:24) | Bug?, WCF | By: larsw

…at least when it comes to handling of decimal numbers – and it probably goes for all other non-English locales that doesn’t use period as the decimal delimiter. If you look closely at the screenshots below, you’ll notice that I’ve entered 2500,00 – that is two thousand comma zero zero in Norwegian. 250000 – two hundred and fifty thousand - gets generated in the SOAP request. If I try to enter 2500.00 (with a period as the delimiter) the UI validation logic tells me (correctly) that it’s an invalid number. Switching to the en-US locale in the Regional settings in Windows, and it behaves normally (e.g. input 2500.00 – output 2500.00 in the SOAP message).

Sigh…

SNAGHTML21f13e78

SNAGHTML21f0fd25

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Windows Workflow Foundation 4.0-related blogs

9 June, 2010 (10:54) | Blogging, Blogroll, WF | By: larsw

I’ve compiled a list of bloggers who seem to focus on WF4.0. Please post a comment if you have any blogs I’ve missed.

Matt Winkler [MSFT] http://blogs.msdn.com/mwinkle/
Kushal Shah [MSFT] http://blogs.msdn.com/kushals/
Ron Jakobs [MSFT] http://blogs.msdn.com/rjacobs/
The Activity Designer [MSFT] http://blogs.msdn.com/tilovell/
Request/Reply [MSFT] http://blogs.msdn.com/endpoint/
Zafar Mohammed [MSFT] http://blogs.msdn.com/mimran/
The .NET Endpoint [MSFT] http://blogs.msdn.com/endpoint/
Cathy Dumas [MSFT] http://blogs.msdn.com/cathyk/
Say wwhhhaaaat? [MSFT] http://blogs.msdn.com/patcarna/
Go with the Flow [MSFT] http://blogs.msdn.com/b/flow/
Maurice de Beijer [MVP] http://msmvps.com/blogs/theproblemsolver/
Alan Smith [MVP] http://geekswithblogs.net/asmith/
CloadCasts http://www.cloudcasts.net/
Richard Seroter [MVP] http://seroter.wordpress.com/
Richard Blewett [MVP] http://www.dotnetconsult.co.uk/weblog2/
Damir Dobric [MVP] http://developers.de/blogs/damir_dobric/
Zulfiqar Ahmed http://zamd.net/
Chris Craft [MSFT] http://blogs.technet.com/b/chriscraft/
The Workflow Element http://www.theworkflowelement.com/wf-40/
Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Solution: Add Service Reference does not always work properly in WF4 scenarios

3 June, 2010 (10:03) | Visual+Studio, WF, Workaround | By: larsw

Now, the title is a bit cryptic, so let me elaborate; earlier this week, I noticed that when I tried to add a service reference to a WCF Workflow service in the same ASP.NET Web Application, I didn’t get the expected result; custom activities for the service operations in the toolbox (when designing another WF Service).

Investigating further, I created a Workflow Console Application and checked if I got the same behavior; no – it worked perfectly. Same happened when I tried it with WCF Workflow Service Application / Declarative Service Library (Visual Studio templates).

Putting one and one together, I guessed that it had something about the definition of the project template. Visual Studio projects has a concept of ProjectTypeGuids that enables/disables specific features for a project once added. A couple of years ago, I noticed that I had to add a specific GUID in order to wire in the “F5 experience” when debugging WCF libraries.

When comparing the GUIDs set in one of the working projects with the ones in the ASP.NET Web Application, I noticed the following (magic number):

{32f31d43-81cc-4c15-9de6-3fc5453562b6}

I retrofitted the GUID in the Web Application, added a service reference to a workflow service;

wfdialog

Building the project and presto! — custom activities for the service operations in the toolbox.


Now, this isn’t just a problem that can happen when using Workflow Services, it can also happen (as I’ve already mentioned) to WCF projects, test project et cetera too. My suggestion to Microsoft is that they in the future add an section somewhere in the Options pages where it is possible to turn on/off features like this one, so developers don’t need to turn autistic and start remembering a large set of project type GUIDs :-) (Oh, no offense to devs (or others) that actually are autistic).


Thanks @mwinkle for putting me in touch with the Add Service Reference guys, even though I found the workaround first :-)

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Migrating Work Items from one TFS Project to another

5 May, 2010 (09:37) | Migration, TFS2010 | By: larsw

Recently, we upgraded our Team Foundation Server from 2008 to 2010 at work. Long overdue getting rid off some custom TFS Project templates, we were eager to use the new MSF for Agile 5.0 template. Now, we knew on beforehand that we couldn’t just upgrade existing team projects, so we had to come up with a migration plan.

First, we copied the Team Project Collection and “archived” a copy (NNN_Archive). Next, we created a dummy TFS Project with a Source Control root folder, and moved all the source code from all the existing projects into it. Next up, we created new team projects based on the aforementioned project template, and moved the source code back into the right folders in the VC tree.

Warning: We believed that doing it this way, we would preserve the VC history. Bummer! It did not! But since we had the archived TFS collection, we decided we didn’t want to revert to the backup, but just change to the other collection if we need to check the VC history in the future.

Next off, our architect and scrum masters wanted to migrate the work items from the archived collection to the new projects, so I had to brush off the dust of my TFS API skills and create a piece of throw-away code that would do the job.

Now, instead of just throwing away the code, I’m guessing that other people might need to do the same thing, so I’ve shared the source here.

You will have to tweak the source code to get it to work; the SOURCE_COLLECTION and TARGET_COLLECTION uri’s need to be set, as well as the TargetProjectName.

You will also have to tweak the WIQL query to return the work items you want to migrate – if you’re up for it, it shouldn’t be too hard to generalize the utility so that it would read the variables including the wiql from a configuration file.

Next up, you will have to adjust the MigrateWorkItem() method so that it copies the correct fields (optionally mapping to other field types in the new WI schema). The source code will copy attatchments – something that you also probably want to do. If you use the Links tab today, you will have to code up something that will lift over the links as well.

When you start the utility, you will be prompted with:

“Create [A]reas/Iterations or [M]igrate (Ctrl-C to quit)?:

The reason I did it this way, is that if you create the areas/iterations in the same pass as the work items, you will have to pause execution (Thread.Sleep) to ensure that the items has been commited to the TFS before the Work item is saved – IMO the two-pass strategy is cleaner.

Hope someone can reuse the code,

Cheers,

–larsw

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Countdown to Microsoft PDC 2009 – part 2

9 November, 2009 (22:32) | Conferences, Microsoft, PDC'09 | By: larsw

image In the first installment of this pre-PDC blog post series, I published the list of the sessions I’ll likely attend and a list of sessions that would be cool to see, but that isn’t really target material (for me).

Microsoft has now published the time & location of each session, and I must say that I’m (at least at the moment) quite disappointed that www.microsoftpdc.com lacks two important features:

  • Export to Outlook / ICS. Both for single sessions and the possibility to link the whole My Sessions view into Outlook.
  • An Outlook-ish calendar view, that visualize conflicting sessions (Just like my normal Outlook calendar – when my coworkers book me for three different meetings at the same time ;-) ).

That said, I hope Microsoft hasn’t revealed all features of the PDC website yet.

Since I haven’t found the floor map for LACC on www.microsoftpdc.com (yet), I’ve scanned the floor plans from PDC ‘08. Click the picture to bring up a larger version. Note that the layout of stands/booths in the Expo area are probably different from what it will be this year.

LACC_floor_plan

Since it’s getting closer to my departure, I’ll put up a list of stuff I’m bringing both for the trip and stay – hopefully, there may be a trick or two for a first-timer travelling to a large conference.

  • Be sure to bring your passport if you’re traveling in from another country. If you’re a resident of a country in the European Union, or another country that is covered by the ESTA Visa waiver “program”, you need to register yourself here before you travel.
  • Business Cards – network, share and LinkedIn later.
  • Money / credit cards – Mo’ money, mo’ problems? Tips: bring at least two major credit/debit cards (VISA, Eurocard, Amex) and leave one your hotel room’s safe.
  • Sun glasses / Hat / Sunscreen. Here in Norway it’s mostly dark at this time of the year, but in LA, the sun is hot – protect yourself from those nasty UV rays.
  • Pocket camera / phone: voice/txt/twitter et cetera.
  • Computer(s): I’m bringing my Dell Precision M4400 and Latitude E4300. The latter is perfect to bring to the LACC at daytime – the first one is my portable workstation. I have a US power chord to my laptop’s power supplies – it’s always a hassle to bring an extra power converter to the conference center.
  • Fiber, fiber, fiber. Well – how should I put it? The American (conference) diet SUCKS. No fiber – and a lot of sugar. I need my fiber, or I’ll turn up constipated and grumpy.
  • Omega-3, Ginseng, vitamins: when traveling, remember to super charge on extra vitamins etc. An exhaustive week with jet lag and activities from 6 in the morning to late night does something to your body.
  • Sleeping aids; I’ve found some prescription-free sleeping aids that are available in the drug stores (in the US). Be sure to buy some before you leave.
  • NoDoz caffeine pills. Generally, I don’t like to pop these – but I bring them for emergency situations.
  • A good carry-on laptop bag that you can’t stuff more than a tiny computer in is at least vital to me. I’m not sure if it is to you – YMMV.

Warning: coming up is an ugly formatted HTML table with some pictures to give you a mental note if some of the items you shouldn’t forget at home :-) Mouse-over will give you a description of each item.

US power chord to your laptop's power supply. Passport - here's mine. NoDoz caffeine pills & Antibac disinfection fluid My favorite laptop carry-on from my friends in Microsoft
OMEGA-3, Melatonine, Prescription-free Sleeping Aid, Ginseng Crisp bread - FIBER!    Nutrition additive: more FIBER! Multi-power converters - shielded & unshielded

 

A last note before I end this blog post; I love TripIt as a tool to organize my trips – it’s also great for sharing information with people you’re traveling with – or people that may be in the neighborhood during your stay.

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Countdown to Microsoft PDC 2009 – part 1

1 November, 2009 (21:22) | Conferences, Microsoft, PDC'09 | By: larsw

imageSo, we’ve reached November 1st – the day after Halloween and it’s only 15 days to the PDC! (Woohoo! :-) )

I’m travelling with two of my colleagues and we’re staying at the Omni from the 14th, send me a message (typically on Twitter: larsw) if you want to hang out before / during the conference.

A couple of days ago (give or take) Microsoft enabled the “My Sessions” feature at www.microsoftpdc.com, and today I’m presenting my first draft of my planned session list. I’m already sure of two things; a) I’ve overbooked, and b) during in the “fog of war” I won’t make it to all of the sessions.

Since I’m a Connected Systems guy, it shouldn’t come as a surprise for anyone that my session list is very CS-centric, but my #2 priority is to attend sessions about features/technology that I really want to learn more about (e.g. where I’m more or less a n00b now :-)

Since the sessions aren’t “mapped out” yet (at least not on the public site) I’ll have to wait a bit before I can do the hard prioritization.

First priority (in no particular order)
Developing REST Applications with the .NET Framework

Don Box, Henrik Nielsen

ADO.NET Data Services: What’s New with the RESTful Data Services Framework

Pablo Castro

Application Server Extensibility with Microsoft Project Code Name “Dublin” and Microsoft .NET Framework 4

Nicholas Allen

Data Programming and Modeling for the Microsoft .NET Developer

Don Box, Chris Anderson

Windows Workflow Foundation 4 from the Inside Out

Bob Schmidt

What’s New for Windows Communication Foundation 4

Ed Pinto

Queuing and Publish/Subscribe in a Heterogeneous Environment

David Ingham, John O’Hara

Microsoft Project Code Name “M”: The Data and Modeling Language

Don Box, Jeff Pinkston

Building Data-Driven Applications Using Microsoft Project Code Name "Quadrant" and Microsoft Project Code Name "M"

Chris Sells, Douglas Purdy

Scaling Your Data Tier with Microsoft Project Code Name “Velocity”

Murali Krishnaprasad

Spice Up Your Applications with Windows Workflow Foundation 4

Matt Winkler

Workflow Services and “Dublin”

Mark Fussell

Second / lower priority (In no particular order)
Microsoft Semantic Engine

Naveen Garg, Duncan Davenport

Rx: Reactive Extensions for .NET

Erik Meijer

Infer.NET: Building Software with Intelligence

John Guiver, John Winn

Code Contracts and Pex: Power Charge Your Assertions and Unit Tests

Mike Barnett, Nikolai Tillmann

Axum: A .NET Language for Safe and Scalable Concurrency

Niklas Gustafsson

Introduction to Microsoft SQL Server 2008 R2 StreamInsight

Torsten Grabs

Now, I’m pretty, pretty sure that when I sum up after the PDC, the list of sessions that I’ve actually attended will be quite different :-)

From browsing through the 22 pages of sessions, I’m a bit disappointed that we won’t see Anders Hejlsberg on stage (at least not in a normal session).

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

TFB210602: Failed to copy.

27 October, 2009 (21:01) | Bug?, Continuous+Integration, Microsoft, TFS2010, Workaround | By: larsw

Build error: Value cannot be null. Parameter name: path1.

Now that’s a cryptic title, right?

First of all; a big thanks to Jason Barile/MSFT that set me in contact with Aaron Hallberg that in turned found a workaround for the bug I’m about to describe.

Second; The bug is fixed in MSFTs trunk version of TFS 2010, so you don’t need to run over to connect.microsoft.com to report it.

With the release of the Visual Studio 2010 and Team Foundation Server 2010, I thought it would be cool to check out the new TFS Basic mode running locally on one of my laptops.

I was amazed that the whole installation process took only about 20 minutes – something that is way better than the near-nightmare scenario of installing a full TFS 2005 or 2008 (I haven’t tried to setup a full scale TFS 2010 yet).

In addition to the TFS 2010 itself, I also installed the Team Build Controller and Team Build Agent locally on the same laptop (and of course Visual Studio 2010 Ultimate).

I imported a small pet project / demo I’m working on into the source control, and set up a build definition for it so that I could do continuous integration builds when checking in future changes.

Right-click.
Queue new build…
Building…
Bang. Build Error :-(

Now, I tried all sorts of things to try to figure out what caused the build failure, and I got some input from Jason Barile, that didn’t work out either (turned out that I’ve set the build server’s working directory to the same directory for it to drop the result to).

Luckily, I twittered my need for someone that could take a look at my problem, and that’s where Jason entered the scene; we did a SharedView session, and as I’ve already written, we didn’t get very far. But Jason works with a brilliant guy named Aaron, that was more than willing to take a look at the problem too.

We did a SharedView where we discussed what I’ve already tried, and tried to narrow down the possible things that could mess up my build. After checking up a bit internally, Aaron came back with a small piece of source code we checked out locally; a bit of code that tries to infer the location of MSBuild.

Well, it  turned out that when it parsed a value from the registry (or something) it took my current regional settings into account, and here in Norway we use , (comma) as a decimal separator – something that is different from the US standard; . (period.

The fix for it was to hardcode the path to msbuild in the BuildTemplate.xaml file that is actually the workflow that is used by the build server. Aaron sent me a version that I plugged in – and bam! Green build!

Thanks again Jason & Aaron – I love the openness a great attitude of every MSFT employee I’ve met so far :-)

The modified .xaml file can be downloaded from here.

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Easier Unit Testing of WCF Services with ServiceTestContext

8 September, 2009 (10:42) | .NET, TDD, WCF | By: larsw

Hi, and apologies for being so awfully quiet the last couple of months. Expect the traffic to pick up again (I’ll explain the silence in a blog post later).

Now, when unit testing WCF Services, I’ve often ended up with cluttering my tests with a lot of plumbing code to wire up the SUT; that is – the WCF service I want to exercise.

Now, being a lazy guy, wiring up (redundant) plumbing code again and again, I often end up trying to extract the essence and put together a tool or helper class.

So, this is my first shot of a fluent helper class that lets you test your WCF services.

The screenshot below pretty much sums up the functionality. It should be pretty self explaining; You end up writing an Action<TContract> implementation that acts as the client.

It will wire up an OperationContextScope automatically, but it can be disabled if you don’t need it.

ShouldReturnHttp200

The state/quality of the code is “Proof of Concept” and can be found here.

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Moving the blog to a new hosting provider

22 May, 2009 (13:21) | Blogging | By: larsw

Hi,

I’m about to move the blog to a new more sane hosting provider that wordpress.com. If the blog is temporarily out of order, please go to the alias for this site larsw.wordpress.com instead. Thank you.

Update 2009/06/02: Transition to the new hosting provider should now be done. Please contact me if experience any errors.

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone

Amazon–; BookShelf++;

15 May, 2009 (11:54) | Books, Computer+Science, Patterns, Refactoring, Semantic+Web, TDD | By: larsw

From time to time, I need to “restock” my book shelfs, e.g. order a batch of Computer Science-related books from Amazon.

I placed a new order on Thursday and hopefully I’ll get them all during the week to come.

image xUnit Test Patterns: Refactoring Test Code
Author: Gerard Meszaros
Hardcover, 833 pages
Published: 2007
image Continuous Integration: Improving Software
Quality and Reducing Risk

Authors: Paul M. Duvall et al.
Paperback, 336 pages
Published: 2007
image Refactoring to Patterns
Author: Joshua Kerievsky
Hardcover, 400 pages
Published: 2004
image Semantic Web Primer
Authors: Antoniou et al.
Hardcover, 288 pages
Published: 2008 (Second edition)

So, if the math’s correct, that’ll be 1857 pages of fun to get through this summer :-)

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • Digg
  • Google Bookmarks
  • DZone