Я разрабатываю приложение WCF в VS2010. Когда я использую встроенный в IDE отладчик для запуска хост-приложения и клиента, все работает, как задумано.
Однако, когда я запускаю два исполняемых файла вручную (переходя в папки /bin/Debug/), я получаю от клиента следующее исключение:
System.Net.Sockets.SocketException: не удалось установить соединение, поскольку целевая машина активно отказалась от него 127.0.0.1:8732
Странно то, что в файле app.config я указываю использовать порт 5000, а не 8732.
Что случилось? Заранее спасибо.
РЕДАКТИРОВАТЬ: Вот app.config для хост-приложения:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="WCFServiceLibrary.SavalotServiceObject">
<endpoint address="" binding="wsHttpBinding" contract="WCFServiceLibrary.ISavalotService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:5000/Design_Time_Addresses/WCFServiceLibrary/SavalotServiceObject/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>