---
title: "WCF client application crashes when accessing service"  
description: "WCF client application crashes when accessing service"  
author: "Hank Greenberg"  
published: 2013-06-19  
updated: 2013-06-19  
canonical: https://www.mindstick.com/forum/1208/wcf-client-application-crashes-when-accessing-service  
category: "ado.net"  
tags: ["ado.net"]  
reading_time: 1 minute  

---

# WCF client application crashes when accessing service

Hi Everyone,\
I have created a wcf [web service](https://www.mindstick.com/articles/895/web-service-introduction) with access to [ADO.net](https://www.mindstick.com/articles/804/connection-pooling-in-ado-dot-net) [Entity Framework](https://www.mindstick.com/articles/1566/crud-operations-using-entity-framework-code-first-approach). Hosts on IIS and have console client. Everything [works fine](https://answers.mindstick.com/qa/115732/my-software-works-fine-on-windows-10-but-crashes-on-windows-11-why).. on my computer. When I send .exe file to another its just crashes and I cant figure out why. Code of console app:\
**MyServiceClient client = new MyServiceClient();****Console.WriteLine(client.GetOrders().First().Date_Accepted.ToString());****client.Close();****Console.ReadLine();**\
My [web.config](https://www.mindstick.com/forum/183/web-config-file) file is default with no changes except of [connection string](https://www.mindstick.com/articles/328/connection-strings). Client app.config\
**<[configuration](https://www.mindstick.com/articles/13112/setting-up-the-perfect-configuration-for-your-work-computer)>****<startup>** **<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />****</startup>****<system.serviceModel>** **<bindings>** **<basicHttpBinding>** **<binding name="BasicHttpBinding_IMyService" />** **</basicHttpBinding>** **</bindings>** **<client>** **<[endpoint](https://www.mindstick.com/interview/964/what-is-metadata-exchange-mex-endpoint) address="http://93.77.254.167:9595/MyService.svc" binding="basicHttpBinding"** **bindingConfiguration="BasicHttpBinding_IMyService" [contract](https://www.mindstick.com/blog/212/wcf-contracts)="MyServiceReference.IMyService"** **name="BasicHttpBinding_IMyService" />** **</client>****</system.serviceModel>****\**Thanks in advance for any recommendations or solutions.

## Replies

### Reply by Anonymous User

Hi,\
Wrap you code in a try catch block and you will see what goes wrong.\
**try****{** **MyServiceClient client = new MyServiceClient();** **Console.WriteLine(client.GetOrders().First().Date_Accepted.ToString());** **client.Close();** **Console.ReadLine();****}****catch (Exception ex)****{** **Console.WriteLine(ex);****}****\**I hope it helpful for you.


---

Original Source: https://www.mindstick.com/forum/1208/wcf-client-application-crashes-when-accessing-service

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
