Visual Studio 不断向我发出 2 条警告:
Severity Code Description Project File Line Suppression State
Warning WCF configuration validation warning: The 'name' attribute is invalid - The value 'MyServiceLibrary.MyService' is invalid according to its datatype 'serviceNameType'. MyServiceLibrary C:\MyDrive\Flavor\Net\1.0\App\MyServiceLibrary\App.config 10
Warning WCF configuration validation warning: The 'contract' attribute is invalid - The value 'MyServiceLibrary.IMyService' is invalid according to its datatype 'serviceContractType'. MyServiceLibrary C:\MyDrive\Flavor\Net\1.0\App\MyServiceLibrary\App.config 11
这是 app.config 文件的一部分:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- 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. -->
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<system.serviceModel>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyIpc.IpcAppToService">
<endpoint address="http://localhost:8733/MyIpcAppToService" binding="basicHttpBinding" bindingConfiguration="MyAppToIPCEndpointBinding" name="MyIpc_IIpcAppToService" contract="MyIpc.IIpcAppToService"/>
<endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/MyService/"/>
</baseAddresses>
</host>
</service>
</services>
...
</system.serviceModel>
</configuration>
这是服务文件:
namespace MyServiceLibrary
{
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
public class MyService : IMyService
{
...
}
}
我错过了什么?
炎炎设计
相关分类