code & chips

general programming stuff…

Posts Tagged ‘.NET

WCF Setup Problems

leave a comment »

WCF has to be one of the most frustrating technologies I have ever used.  The problems I encountered tonight were in the setup.  Like most things development, the trick is in the setup.  Unfortunately, I spend a lot of time tweaking the settings on my new development machine install, but I never remember or even note down the tweaks I made to get things to work.  So when I rebuild my machine, I am back to square one.

The WCF configuration has too many things that not only look the same, but the declarative nature – while flexible – in most cases is just a pain in the ass and I found it easier to simply hard code the values as in my experience, they rarely change.

Anyway, setting up my WCF IIS host on a new development machine proved to be more involved than I initially credited it would be.

When setting up the IIS host for a WCF library you will need to create an SVC file.  But, this file extension may not be recognised by IIS – making things ‘tricky’. So here are some things to look out for in order:

  • Try installing the ASP components from the Windows Components in Programs & Services.
  • Try ServiceModelReg -ia to install all the WCF components onto your machine.
  • Try asp net-regiis -i to install the handler configurations to IIS.
  • Sometimes you get a problem where you do not have permissions to run the web application from the current – normally – default application pool.  So try setting the user account to LocalSystem in IIS for the corresponding application pool.

Written by Kam

August 19, 2011 at 12:43 am

Posted in Uncategorized

Tagged with ,

Delay/Test Signing Assemblies and Testing

leave a comment »

Note to self:

When delay/test signing your assemblies remember to run the follwing command before running unit tests:

sn -Vr myAssembly.dll

All my unit tests were failing because the .NET framework – and so the test runner – would not allow me to load an assembly that it considered to be tampered.  Delay/Test is essentially tampering, by signing the public key and allocating space for the private key.

So make sure to run the above command to configure the .NET framework to skip strong name verification for the delay/test signed assembly or application.

That was 2 hours wasted…..

Written by Kam

July 31, 2011 at 12:34 am

Posted in Uncategorized

Tagged with ,

Follow

Get every new post delivered to your Inbox.