没有名称为“calculatorServiceBehavior”的服务行为。什么意思?

evilcry2013 2012-12-25 07:10:56
没有名称为“calculatorServiceBehavior”的服务行为。我在研究WCF这个东西

private void btnStart_Click(object sender, EventArgs e)
{
host = new ServiceHost( typeof(WcfService1.Service1) );
host.Open();
label1.Text = "订票服务已启动";
}



以下是app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service
name="WcfService1.Service1"
behaviorConfiguration="calculatorServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/"/>
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding"
contract="WcfService1.IService1"/>
</service>
</services>

<behaviors>
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
...全文
127 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhujiazhi 2012-12-26
  • 打赏
  • 举报
回复
behaviorConfiguration="calculatorServiceBehavior" <behavior name="CalculatorServiceBehavior"> 不知道是不是这个原因的

13,347

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET技术前瞻
社区管理员
  • .NET技术前瞻社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧