Blog: 2014 December

Implementation of “hybrid” (console or GUI) .NET applicatios

December 29, 2014, (updated on October 19, 2015), 1 comment, Software Development

Have you ever had the need to use an application (.exe) as a command line tool when started in the console (cmd.exe) and as GUI application when started from the Explorer shell? This article explains a possible implementation for this requirement. To be clear: I didn’t find the perfect solution; a Windows .NET application is either a console application or a Windows application. Either type can be used in the opposite mode, but both variants have some drawbacks. This article describes the solution which I think has the least disadvantages. The solution works by defining the application as console application […] Read more...

Tags: , , , ,

The correct handling of a WCF client’s life cycle

December 21, 2014, (updated on February 25, 2015), Software Development

The most intuitive way of handling a generated WCF client’s life cycle is by putting it into a using block: using (var svc = new MyServiceClient()) { var result = await svc.SumAsync(1, 2); } Note: You should not use static or singleton client objects. However, the problem with this code is, that IDisposable is not implemented correctly in the base class ClientBase. The problem is that the Dispose method always calls Close but Close may throw an exception. If this exception is thrown an additional call to Abort is needed but which is not made. Missing this Abort call may […] Read more...

Tags: , , ,


  Page 1 of 1