Transactions in stored procedures with transaction scope

Yesterday I got a question from a collegue who had run into trouble using the TransactionScope-construct in .NET.

The case was as follows; the are programming against a database whose stored procedures they cannot change. Some of these stored procedures are using calling each other and doing so under stored procedures. When the .NET-code is calling those stored procedures and doing so under TransactionScope they run into problems. The TransactionScope is not Complete-ing and the reader they are using in the TransactionScope simply returns empty (Nothing).

OK -first and foremost; don’t mix! It’s no good idea to have two guys deciding on when you are done. So use either the excellent Transaction support given in .NET 2.0 or use transactions in stored procedures. However…

To my colleague’s defense it must be said that they cannot change the stored procedures they are using, so they are stuck. This is how you...

Read More

Error message "Could not load file or assembly 'Microsoft.VisualStudio.Enterprise.ASPNetHelper" when deploying

When we deployed our latest WCF-service we ran into this error message: Could not load file or assembly ‘Microsoft.VisualStudio.Enterprise.ASPNetHelper’.

Apparently this has to do with Visual Studio inserting stuff into the web.config (or app.config) when you ran a test under code coverage. From my goggling I find that other actions in Visual Studio might insert this also.

Here is a short posting describing the problem.

Be sure to “clean” the web.config-file that is promoted to your testing and production environments.

Read More

Design patterns

I’ve been doing some reading up on design patterns, mostly actually since I was curious on the book - Head First Design Patterns.

It is great - I can honestly say that it is the best IT-related book I’ve ever read. It is the first time (embarrassing enough) I understand some of these patterns. It covers a lot of different aspects and do just enough of deep exploration. And (not least) it is FUN - I actually laugh when I read it. When did you do that reading for example this book (which also is good, but not fun…).

However - a colleague tipped me on a great resource for pattern explanations on line: http://www.dofactory.com/Patterns/Patterns.aspx

Thanks Calle for the tip, and for borrowing the book

Read More

Running Vista

OK - for the first time I am running Vista. I am really impressed so far. Looks nice and work great - that’s how we want to have it, isn’t it? That all Mac users probably goes bananas over all the Mac-OS-rip-offs is nothing to care to much about.

Also this is my first posting using Windows Live Writer, which is Microsoft’s blog-writer program. It also seems to work great.

Let’s post and see

[UPDATE… five seconds later]

Oh yeah - it works ;)

Read More

Debugging WCF Service - the Service attribute value in the ServiceHost directive could not be found

We’ve got the “the Service attribute value in the ServiceHost directive could not be found” error message when we renamed (and moved) and .svc-file. There are not a very good support for that in Visual Studio 2008.

The error message we’ve got had to do with us forgetting to rename the class that implemented our interface for the service (the one with the operation-contract on it).

Here are the places you’ll need to search and replace when you do a rename:

  • The .svc-file itself
  • The markup-file of the .svc-file
  • The web.config of the service
  • The class that implements your service-contract interface

Then you’ll have some trouble to update the reference that the clients are using. Better remove it and then add it again.

Hmmm - not very pretty this..

Read More

Recording of Priority - DONE!

OK - the weekend has now come to an end. We are all very tired - but also happy. We made it - and most of it sounded very good also.

I think the CD will be very nice to listen to and with a strong message built into it. We have prayed for the message to be clear and for any listener to be blessed by the tone from God.

The highlight of the weekend was probably the recording of the title track Priority which came of very good. An excellent piece by Anders Beijer based on the hymn tune “Slane”. It is associated with the lyrics “Be thou my vision”.

On a personal note the last day of the recording sessions were nerve-wrecking. The only piece left to record was the euphonium solo, Journey into Peace. Things got under way very late (about 2 hours) and we...

Read More

Recording session II

Yesterday evening was the last rehearsal before the second and last recording session with my band, the Vasa Band.

We are really in a flow right now; we feel blessed and that God is with us in our efforts and the playing standard is on very high level.

I am really looking forward to the weekend which will be great fun and a lot of hard work. The pieces we are going to record are:

  • I Surrender All - a cornet solo by Andreas Holmlund
  • Priority - a “major” piece by Anders Beijer
  • Swing the pearly gates - swing piece (duh!) by Andreas Holmlund
  • Kan Kristus räkna med dig - another swing piece by Andreas Holmlund
  • Journey into Peace - euphonium solo by William Himes
  • Hawthorne march - a march from the 1920’s

I am really proud of the band and I am sure that this will be...

Read More

Find in SourceControl - Visual Studio 2008

I have found it! In the first versions of Visual Studio Team Explorer you couldn’t search for checked out files, wild cards or labels.

But now - from Visual Studio 2008 it is back. You can reach it from within the Source Control with a simple right click as shown above.

Read More

How to get rid of multiple .vsmdi-files

Here is a thing that have created a lot of confusion and frustration in our projects; when you have a Microsoft Test project under source control the .vsmdi-files gets created multiple times. In one project we have 48 of them. All under source control.

I have even been in contact with Microsoft but they only showed me a workaround that didn’t did the complete trick.

Here is a guy that seem to have solved it. Looks very promising. What you need to do is:

  • Delete all the vsmdi-files from Source Control
  • Make sure that all the developers and testers deletes all the vsmdi-files locally as well
  • Create one .vsmdi-file, by running the test locally at one workstation. Check that file into Source Control
  • Follow the steps in this article to make the .vsmdi-files become non-mergable for the Team Foundation Server project. [UPDATE] To be able to do...
Read More