wcf简单问题 下班结帖!

happy664618843 2010-05-12 01:03:59
Server Error in '/' Application.
--------------------------------------------------------------------------------

The type 'WcfDemo.Student', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

下面是配置文件
<services>
<service name="WcfServiceDemo.WcfStudent">
<endpoint address="" binding="wsHttpBinding" contract="WcfServiceDemo.IStudent">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfServiceDemo/Service1/" />
</baseAddresses>
</host>
</service>
</services>


svc文件里的代码如下:
 public class WcfDataService : DataService<WcfServiceDemo.WcfStudent>
{
// This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
{
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
// Examples:
// config.SetEntitySetAccessRule("MyEntityset", EntitySetRights.AllRead);
// config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
}


高手帮帮忙!添加wcf web引用报这个错! 下班就结帖...
...全文
169 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
happy664618843 2010-05-13
  • 打赏
  • 举报
回复
不好意思 结帖了
james2222 2010-05-12
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 xupeihuagudulei 的回复:]
帮顶两下
这种WCF问题论坛里研究的人比较少
还是同样推荐你去msdn wcf中文论坛,那里的版主会耐心替你回答的。
[/Quote]
+1
happy664618843 2010-05-12
  • 打赏
  • 举报
回复
zhangmeeno 2010-05-12
  • 打赏
  • 举报
回复
搬凳子坐着帮LZ顶,顺带JF
「已注销」 2010-05-12
  • 打赏
  • 举报
回复
顶下 顶下 顶下
看那一米阳光 2010-05-12
  • 打赏
  • 举报
回复
顶下 是
lon123 2010-05-12
  • 打赏
  • 举报
回复
WcfDemo.Student 在哪里被实例化?
在wcf中Student class是否加了相应的[DataContract]?
xupeihuagudulei 2010-05-12
  • 打赏
  • 举报
回复
帮顶两下
这种WCF问题论坛里研究的人比较少
还是同样推荐你去msdn wcf中文论坛,那里的版主会耐心替你回答的。
wosizy 2010-05-12
  • 打赏
  • 举报
回复
可能是 web.config 文件不完整.不是合格的asp.net 配置文件.
也可能是 asp.net版本问题
检查.....

62,242

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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