2013-12-18

Debugging a WCF service issue

A common scenario is your web service failing, but no application errors occur (assuming that you are catching all exceptions and logging them, that is). This is what I usually try:

2013-08-28

Where in the world is WCF Test Client?

I keep myself making that question on a new VS install.

It's tipically here:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\WcfTestClient.exe

Although it will change according to your Visual Studio version (i.e. "10.0") and CPU architecture (i.e. "x86").

2013-08-09

Mocking an internal interface with Moq

If by some reason you need to Mock an internal interface using Moq, you might get the infamous exception while running your unit tests:
System.TypeLoadException : Type 'ISomething`1ProxyRandomGuid' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=YetAnotherGuid' is attempting to implement an inaccessible interface.

Assuming that you already added the InternalsVisibleTo from your library to your unit test project, you'll also need to add an InternalsVisibleTo to DynamicProxyGenAssembly2. However, unlike the author in the blog post, in my machine it only works if I remove the PublicKey, something like:

[assembly:InternalsVisibleTo("DynamicProxyGenAssembly2")]