Back to WinForms...It was a user control which calls a service, I knew that if I wrap the service call inside a ComponentModel.DesignMode, I could get away with the service call being called at design time and the designer throwing me exceptions...Now this is not an issue at all when your are designing the control, cos' Visual Studio does not create an instance of the user control that is being designed, instead it creates a base class, UserControl, this is also true when you designing a form, a Form instance is created. Therefore .ctor of the control being designed is never called, so doesn't the service call.Now if I drag an drop this control (ctrl1) into another a control(ctrl2), the control's DesignMode property is true, but if I now drag the ctrl1 into a form, the DesignMode of ctrl1 is false.This basically means that ctrl2 is sited in the form and not ctrl1, makes sense right?.There are two work around that you can use to avoide this...1) See if the current process that is hosting the form is devenv, This is not a flexible solution, as this will not work if you open your view in a different environment.2) Use the LicenceManager class to see if we are in DesingMode or runtime.
There came one of those questions from the client whether to use II7 hosting or windows service hosting for WCF services. I tried recollecting a few points and thought of writing it down. WCF applications can be hosted in 2 main ways - In a Windows service - On IIS 7 and above When WCF was first released, IIS 6 did not support hosting WCF applications that support Non-HTTP communication like Net.TCP or Net.MSMQ and developers had to rely on hosting these services on Windows Services. With the release of IIS 7, it was possible to deploy these Non-Http based applications also on IIS 7. Following are the benefits of using IIS 7 to host WCF applications Less development effort Hosting on Windows service, mandates the creating of a Windows service installer project on windows service and writing code to instantiate the service, whereas the service could just be hosted on IIS by creating an application on IIS, no further development is needed, just the service implementa...
Comments
Post a Comment