tag:blogger.com,1999:blog-89502341386291751492024-03-05T05:18:40.785-08:00GoNetDotNetTechnology information sharing worldwide.SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.comBlogger58125tag:blogger.com,1999:blog-8950234138629175149.post-78052275093330682152018-05-29T04:02:00.000-07:002018-05-29T20:09:36.085-07:00How to restart an azure service on regular interval using script or cronjob
Introduction
This post is about implementing a web-job in azure which will restart a service on a predefined interval. When restarting a service on a predefined interval clearly says that there is some problem with the implementation, we may rely on this as an emergency measure until we tackle the problem. Here we will ignore the implication behind it but will focus on how to get this done. To SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-55574909527431393582017-08-10T01:24:00.000-07:002017-08-10T06:06:05.328-07:00[Solved] How to handle log4net RollingFileAppender logging from multiple application instances
Introduction
Logging is one of the very important factor in any application. You require it to analyse what when and how things went wrong. It serves as the log of the application. But when you have multiple instance of the same application running in parallel, then you don’t have the purpose served properly by the logging mechanism as it will be writing all SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-54269761836514984612017-05-08T21:42:00.000-07:002017-05-08T21:42:50.620-07:00A handy alternative to Alias in windows command
Introduction:
A recent encounter in windows server where a need for a folder alias was unavoidable, we made a discovery that unlike linux, folder alias is hard to achieve in windows command for windows version less than windows 10. Though it is achievable, it is hard to achieve when the target directory path is dynamic. This lead to a search for the alternative to deploy in this SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-81250477455553156312016-12-14T23:33:00.000-08:002016-12-14T23:56:54.728-08:00[Solved] WCF Application failing on windows 10 made me doubt tcp port sharing
Introduction
I started on this issue when I had my WCF service times out when I am trying a normal socket connection. This was running fine in windows 8. We had a keep-alive WCF call which tells the server that the client is still active. For this we need the port sharing to be enabled on the machine. I was on an impression that the port sharing was not working and because of whichSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com1tag:blogger.com,1999:blog-8950234138629175149.post-2429041933873170182016-07-22T05:16:00.000-07:002016-07-22T05:16:51.004-07:00[Article] How to test an application in limited network bandwidth.
Introduction
It is important that we test an application in all network conditions. This is because we may want to put demand on a system or device and measure its response to determine a system’s behavior under both normal and anticipated peak load conditions. This makes sure that the application is robust enough to handle all the network conditions before we roll out to users. It wouldSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-35810679772098832642016-02-04T00:01:00.001-08:002016-02-04T00:28:01.252-08:00[Article] Setting up SQLite and EntityFramework in VisualStudio
Introduction
In this article I will explain in detail how to setup SQLite with EntityFramework. Setting up SQLite and EntityFramework is straight forward but when I tried, it turn out that the version available at the time when this article was written is not really straight forward. So I thought of sharing this in the form of an article. In this article we will see how we could SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-25499221368579621442015-10-20T22:53:00.001-07:002016-01-03T03:17:42.414-08:00[Article] How to run multiple WCF services under one website in IIS 8 where each service is running on separate app-domain
Introduction
Starting with IIS 7, we can have IIS hosting application which can run on separate App-domain. Running application on separate App-domain is required when we need application to work in isolation i.e. to prevent applications in one application pool from affecting applications in another application pool on the server. An application can have several virtual SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-35452182428487804812015-10-20T03:33:00.000-07:002016-01-03T03:18:50.121-08:00[Solved] How to know if the window state has changed to maximized in WPF.
Introduction
In this post we will see how we can identify if the application has been maximized or it is restored to normal state. We will use the Resize event equivalent in WPF which is SizeChanged event. We will subscribe to this event and will check the window state to identify if the window has been maximized or it is restored to normal.
SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-29783529810229246192015-10-17T07:00:00.000-07:002016-01-03T03:20:25.793-08:00[Article] How to host a WCF service in IIS 8
Introduction
Here in this article we will see how to configure and host a WCF service in IIS 8. When we want to expose our service to internet, hosting it in IIS is the easy and effective way to do it. When you host it in IIS, it comes with all the added advantage of the web server. If you don’t want to host in IIS, you could still do that with a console application running in aSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-31079637197026826552015-10-12T08:08:00.002-07:002016-01-03T03:20:01.716-08:00[Article] How to host a WCF service in console application using wsHttp binding.
Introduction
In this article we will see how to host a wcf service using the wsHttpBinding. When you use http, you would normally host it in IIS, but if you would like to host it in a console application, you could follow this article. Here we will try to host a service with a wsHttpBinding and will expose a MEX endpoint in order to expose the metadata so that any tool which can SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-45589345344631086512015-10-06T04:06:00.000-07:002016-07-19T11:39:42.566-07:00[Solved] How to show a message box before the application main window is launched.
Introduction
There are scenarios where we have to show a standalone message box even before the application main window is launched. In such scenario, we need to do something different. Say if we have a composite application with a bootstrapper, and we want to show some error while running a bootstrapper, it may look difficult because we don’t have a parent window. In suchSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-25021921277768257842015-09-30T23:57:00.002-07:002018-05-23T22:51:58.915-07:00[Article] Continuation of WPF Wizard control.
Introduction
This post is a continuation of [Article] WPF Wizard control with MVVM support. Here I am trying to address some of the concerns people have regarding wizard control. This include
1. How to share/collect data from each view.
2. How to control the navigation or how to validate before navigation.
To know more on the basics, please refer to the parent article.&SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com8tag:blogger.com,1999:blog-8950234138629175149.post-63913827061129999912015-09-22T01:12:00.000-07:002015-09-22T01:13:40.073-07:00[Article] Consuming self-hosted WCF service by Creating WCF net.tcp and net.pipe proxy at runtime and by custom proxy, without adding service reference.
Introduction
In this article we will see how to call a WCF service without adding a service reference. In this article we will see two ways of calling WCF service method. One is to call the WCF service method on the fly and second is by creating a custom proxy without the help of SvcUtil or any other tool. We will be using a two way service in this article.
Background
This SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-12175360889096329882015-09-22T01:01:00.000-07:002015-09-22T01:12:57.745-07:00[Article] How to Create One way WCF service with Callbacks and consume it in client using custom proxy.
Introduction
There are cases when an operation has no return value, and the client does not care about the success or failure of the invocation. To support this sort of fire and forget invocation, WCF offers one-way operations. In this article we will see how to create a one way service which responds to client via callback.
Background
In this article we will see how to SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-50846351827593745452015-06-08T01:00:00.000-07:002015-10-14T08:18:42.034-07:00[Article] How to cancel a running task and to make sure it always cancels.
Introduction
In this article we will see how we can cancel a running task. Task class in .net library is extremely useful when you want to handle thread. Developers don’t have to create or maintain thread explicitly. Methods executed by a Task typically execute asynchronously and it uses background threads from the thread pool. There is no direct way of SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-90183670365730943282015-06-07T23:47:00.003-07:002015-07-11T23:28:40.061-07:00[Solved] How to hide a console of a console application from showing up while the program is still in execution
Introduction
While I was working with WCF service application, I came across a situation where I am hosting my WCF service in a console application and I don't want the console application to show up when my service is up. I fixed it this by Pinvoke a call to FindWindow() to get a handle to your window and then call ShowWindow() to hide the window. I have created a sample code to show howSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-14286316871205868512015-06-07T23:40:00.002-07:002015-06-07T23:40:50.984-07:00[Solved] Solution files bind to TFS but files edited from visual studio are not showing in pending changes.
Introduction
This error can happen when you use Microsoft Team Foundation Server(TFS) and if you don’t have proper binding files. This can happen if the solution is new in TFS and there are no binding files associated with it. You can easily fix this. To fix it, you have to go to
File -> Sourcecontrol-> change source control.
Click on the project which don’t have binding and say bindSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-40345510043511507152015-06-07T23:36:00.004-07:002015-06-07T23:36:48.313-07:00[Solved] Cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.
ContractFilter mismatch at the EndpointDispatcher
A "ContractFilter mismatch at the EndpointDispatcher" can happen because the client could not process the message because no contract claimed it. This can happen because of the following reasons:
Your client and the service have different contracts in between.
Your client and service is using a different binding in between.
Your client's andSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-74331663557143226682015-06-07T23:34:00.000-07:002015-06-07T23:34:09.892-07:00[Solved] How to track WCF errors and exception
Introduction
This post is for those who are working with WCF and at times sulking because of errors which does not show up and who spends lots of time debugging what is going wrong with their service and client.
I was working with a WCF service and I came across a situation where my client application is trying to connect to service via proxy and client is waiting for the call to return and SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-36246283040984025012015-06-07T23:26:00.001-07:002015-06-07T23:26:46.541-07:00[Solved] An endpoint configuration section for contract could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.
Introduction
This fix explained here is helpful if you are using WCF and when you try to access the service, the client throws an exception like "An endpoint configuration section for contract ‘YourContract' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name".
How to fix thisSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-26700007450283703422015-06-07T23:20:00.001-07:002015-06-07T23:20:20.266-07:00[Solved] How to use Resource Dictionary in WPF and How to call Resource Dictionary from xaml.
Introduction
WPF applications support rich media and graphics, this require styles and styles can be reusable across different window or element in WPF. Here we need a mechanism by which we can share this style across different window or say application. By adding the style in application resource file, we can share it across windows in application but not across application. Here reusable SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-53735327383073806792015-06-07T23:05:00.000-07:002015-06-07T23:07:55.439-07:00[Solved] How to bind a command to WPF XAML button from Data template.
Introduction
This post will help you in binding a command to a button, where the button is defined in a template say a data template. With normal command binding it won’t work. We need some sort of workaround to achieve this.
How to fix this.
Here the requirement is to bind a command to an element which is defined in a template. When we do a normal command binding, it is not SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-78618743248405218642015-06-07T23:00:00.001-07:002015-06-07T23:00:44.286-07:00[Solved] Mixed mode assembly is built against version 'v2.0.*' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
Introduction
In this post we will see how to fix the exception due to mixed mode assembly while working with version 4.0 of runtime.
Background
I was working with a project which uses an older mixed mode assembly and I got an exception like mixed mode assembly is built against another version of the runtime and cannot be loaded in the 4.0 runtime without additional configuration informationSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0tag:blogger.com,1999:blog-8950234138629175149.post-68907337689318405162015-06-07T22:57:00.000-07:002015-06-07T23:01:16.604-07:00[Solved] The type or namespace name 'Data' does not exist in the namespace
Introduction
In this post we will see how to fix the exceptions like this which hapens even after adding proper dll(s). Here in this post we will see how to fix exception, "The type or namespace name Data does not exist in the namespace Microsoft.Practices.EnterpriseLibrary (are you missing an assembly reference?)"
Background
I was working on a project when I encountered one exception which SmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com3tag:blogger.com,1999:blog-8950234138629175149.post-56143208429998082472015-03-08T20:48:00.002-07:002015-03-08T20:48:53.076-07:00[Solved] Could not resolve this reference. Could not locate the assembly "Microsoft.Office.Interop.Outlook, Version=14.0.0.0
Introduction
You may experience this error if you try to compile a visual studio solution/project where it is referring to this Microsoft.Office.Interop.Outlook from GAC. This could also happen in a build server where you don’t have outlook installed. You may feel like you hit the dead end where you are forced to install the licensed Microsoft office tools. But we have another alternative whichSmsSackhttp://www.blogger.com/profile/17824304837217715202noreply@blogger.com0