我刚刚在我的网站上添加了wcf服务。 web.config看起来像这样:
<system.serviceModel>
<services>
<service name="Realstuf.Service">
<host>
<baseAddresses>
<add baseAddress = "http://ismyrealstuff/Services/" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<endpoint address ="http://ismyrealstuff/Services/Service.svc" binding="wsHttpBinding" contract="Realstuf.IService" behaviorConfiguration="FirstServiceBehaviour"/>
<!-- Metadata Endpoints -->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="FirstServiceBehaviour">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
添加了一个svc文件,并在app_code目录中添加了service.cs和Iservice.cs文件。找不到Assemblyinfo.cs文件。
当我尝试在wcftestclient中打开svc文件时“无法添加服务”错误已生成。 错误详情说:
错误:无法读取D:\ Projects \ IsMyRealStuf \ IsMyRealStuffWeb \ Services \ Service.svc。无法将文件D:\ Projects \ IsMyRealStuf \ IsMyRealStuffWeb \ Services \ Service.svc作为程序集加载。查看FusionLogs了解更多信息。无法加载文件或程序集'file:/// D:\ Projects \ IsMyRealStuf \ IsMyRealStuffWeb \ Services \ Service.svc'或其依赖项之一。该模块应该包含一个程序集清单。
如果我添加任何assemblyinfo.cs文件是否为此解决方案?怎么样?
答案 0 :(得分:0)
添加http://ismyrealstuff/Services/Service.svc
作为服务,而不是磁盘上的文件。