我创建了一个 WCF 服务并将其托管在 Windows 服务中。使用 Visual Studio 测试此服务效果很好,我可以使用它。现在我已经在一台 PC(称为 PC1)上安装了该服务,并使用另一台 PC(称为 PC2)我希望能够发现它并使用它。我想我将不得不修改 app.config 文件来实现这一点。
这是我当前的 app.config,我需要修改什么才能让它在其他联网计算机上工作?我猜基地址是一个开始?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<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="WcfAVOLibrary.AVOs">
<endpoint address="" binding="wsDualHttpBinding" contract="WcfAVOLibrary.IAVOs">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/WcfAVOLibrary/AVOs/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false 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>
哦,我正在运行.Net 4.5