Tracing Not Working

This was a really annoying error. Again the lack of installed entity framework inside the project caused the service to be unusable. All the services worked in VS but not after deployment. I've added tracing to my application. Guess what? It didn't work. I had no idea what was happening. After researching it turned out...

Using Tracing with WCF Service Log

Using tracing can be very beneficial especially when the application has already been deployed and we need to figure out why it doesn't work. Useless errors of type: 500 don't give any meaningful results, so I decided to use System.Diagnostics to help me track down the errors. Logging There are two important (and very simplifed...

“An existing connection was forcibly closed by the remote host” error in WCF service

That was an interesting one. There was only one method in the service that was causing that. On stackoverflow there were several pointers, but all of them were pretty useless. It turned out that its all about iheritance of [DataContract]. I had a simple service that was returning an object:

From there there was...

Returning HttpError Response in WCF

Today I had to throw an HttpException but it turned out the on the WCF side this only returns Error 500. Whenever you throw a HTTPException you need to catch it in your service:

Automated WCF RESTful System Testing with VS

I discovered a bit of a hack for automatically system test WCF services just using unit tests. Although, this is not the best testing practice, it does allow to quickly verify the behaviour of the service under several circumstances which are not easily 'testable' with simple unit tests e.g. authorized/unauthorized. Unfortunately, VS doesn't allow to...

Request Error - Posting HTML to a WCF via jQuery

I created a simple WCF service for handling jQuery calls (RESTful). The service was handling data from the website one of which was raw HTML. The HTML was sanitized on the server before being saved in a database. However, whenever I made a call to the server, it greeted me with the iconic error: Request Error....

The process cannot access the file '' because it is being used by another process

I was building a simple web system which relied on XML files. On initiation, the system would open the XML config file, read it and include other XML files defined in it:

The operation was done within a WebForm and it worked just fine. I also had a WCF service whose job was to...