Home avatar

Thoughts and code

NServiceBus, SQL Server, and DTC

This exception drove me nuts:

System.Transactions.TransactionException: The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025) —> System.Runtime.InteropServices.COMException: The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025)

This blog post solved it and made my day. Thank you.

DTC was disabled on SQL Server machine, which caused messages sent via NServiceBus to fail when NSB service was trying to process them in transactional manner agains SQL Server. As blog post above says, Microsoft post explains how to address the issue.

NServiceBus Gotcha - NServiceBus.Host.exe Can’t Locate IConfigureThisEndpoint

Unhandled Exception: System.InvalidOperationException: No endpoint onfiguration found in scanned assemblies. This usual ly happens when NServiceBus fails to load your assembly contaning IConfigureThisEndpoint. Try specifying the type explicitly in the NServiceBus.Host.exe.config using the appsetting key: EndpointConfigurationTypeScanned path: C:\SearchFeedingService\
   at NServiceBus.Host.Program.ValidateEndpoints(IEnumerable`1 endpointConfigurationTypes)
   at NServiceBus.Host.Program.GetEndpointConfigurationType()
   at NServiceBus.Host.Program.Main(String[] args)

First I googled stackoverflow. Handy, but was not my case as I had only one implementation of IConfigureThisEndpoint, same .NET version, and everything was packaged. Then I found this post, which helped a lot – I had to explicitly tell NSB what type implements IConfigureThisEndpoint. Not sure why this was happening.

Keymaps For R# Plugin

If you are starting with R# (which you should definitely consider in case you are a professional .NET developer and not use an alternative), this plugin might be helpful to start with all the shortcuts.

Moq with NameValueCollection

Mocking HttpRequest and HttpResponse is not complicated with HttpRequestBase and HttpResponseBase introduced in ASP.NET. I had to mock ServerVariables property of HttpRequest and run into an issue – I was accessing an indexer property and didn’t know how to do this. Gladly, ran into a post that mentioned that indexer is actually utilizing a virtual Get() method. Reflector has confirmed that.

image
image

image
image

Great! Now indexer can be mocked.

Join.me

Working with remote team members can be sometimes challenging. Working with temporary team members is even more challenging. IT can sometime get in your way when you need screen sharing, and you need it fast. Typically I’d go first with the official route – IT provided service (in case company provides that service or has acquired it), VNC (if IT supports it), or something else, more creative.

Working with a particular vendor yesterday, I had to share something really quick and didn’t have a way to do so. They have asked me to go to join.me and click “share”. Boy I got excited by simplicity – within seconds we had screen sharing/controlling going on. No heavy client installation, just a lightweight thin application, no registration, invitation is easy to create, multiple users connecting, sharing mouse/keyboard. And all this for free. Love it.

Happy 2012

Life is a book. Each one of us is an author. Every year is a chapter. Every New Year eve we wish to start fresh, to begin a new chapter in our life. Let me wish you to live your next year in a such way, that you would be proud to add another chapter to your life book, proudly looking at the passing year and building on top of that many other chapters, full with love, happiness, great achievements, and people so dear to your heart.