我刚刚在我的网站上添加了 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 文件,这是解决方案吗?那么如何?