在配置元素system.serviceModel / serviceHostingEnvironment / serviceActivations中提供。 [英] provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

查看:93
本文介绍了在配置元素system.serviceModel / serviceHostingEnvironment / serviceActivations中提供。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我创建了WCF文件,它在我的本地系统中工作正常,但在启动后,它会抛出错误



喜欢



类型'abc.in.myService',作为服务属性值提供无法找到ServiceHost指令,或在配置元素system.serviceModel / serviceHostingEnvironment / serviceActivations中提供。



'scv'文件和相关文件在共享主机服务器中启动



其结构是



httpdocs

bin --->文件夹

myService.dll

myService.svc

web.config



在这里我打电话给像abc.in这样的网站



所以如果接入点就像abc.in那样如何定义服务名称和合同< br $>


svc文件的标记是

---------------------- ---

Hi,

I have created WCF file, it working fine in my local system, but after launch, it throws an error

like

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

the 'scv' file and related files are launched in a shared host server

its structure is

httpdocs
bin ---> folder
myService.dll
myService.svc
web.config

here i am calling a site like "abc.in"

so how to define the service name and contract, if the access point is like "abc.in"

markup of svc file is
-------------------------

<br />
<%@ ServiceHost Language="C#" Debug="true" Service="abc.in.MyService" CodeBehind="MyService.svc.cs" %><br />





我的网络配置文件是

-------------------------



my web config file is
-------------------------

<br />
<?xml version="1.0"?><br />
<configuration><br />
  <system.web><br />
    <customErrors mode="Off"/><br />
    <compilation debug="true" targetFramework="4.0"><br />
    </compilation><br />
  </system.web><br />
  <system.serviceModel><br />
    <serviceHostingEnvironment aspNetCompatibilityEnabled="True" ><br />
    </serviceHostingEnvironment><br />
    <services><br />
      <service name="abc.in.myService" behaviorConfiguration="myWCF"><br />
        <endpoint address="" binding="wsHttpBinding" contract="abc.in.IMyService"><br />
        </endpoint><br />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/><br />
      </service><br />
    </services><br />
    <behaviors><br />
      <serviceBehaviors><br />
        <behavior name="myWCF"><br />
         <serviceMetadata httpGetEnabled="true" policyVersion="Policy15"/><br />
           <serviceDebug includeExceptionDetailInFaults="true"/><br />
        </behavior><br />
      </serviceBehaviors><br />
    </behaviors><br />
  </system.serviceModel><br />
  <system.webServer><br />
    <modules runAllManagedModulesForAllRequests="true"><br />
    </modules><br />
  </system.webServer><br />
</configuration><br />









请帮助我,我正在尝试最近2天





谢谢和问候

Shaju





please help me, i am trying for last 2 days


Thanks and Regards
Shaju

推荐答案

大家好,



非常感谢



最后我找到了解决方案,只需更改端点地址并添加baseAddress 工作正常



这里是我的web.config文件

--------------- -------------------------------------------------- ----

Hi All,

Thanks lot

finally i found the solution, just change the endpoint address and added the baseAddress working fine

here is my web.config file
---------------------------------------------------------------------
<br />
<br />
<configuration><br />
  <system.web><br />
    <customerrors mode="Off" /><br />
    <compilation debug="true" targetframework="4.0"><br />
    </compilation><br />
  </system.web><br />
  <system.servicemodel><br />
    <servicehostingenvironment aspnetcompatibilityenabled="True" multiplesitebindingsenabled="True"><br />
    </servicehostingenvironment><br />
    <services><br />
      <service name="abc.MyService" behaviorconfiguration="MyWCF"><br />
        <endpoint address="http://YourSiteName/MyService.svc" listenuri="/" binding="wsHttpBinding" contract="abc.IMService"></endpoint><br />
        <br />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /><br />
        <host><br />
          <baseAddresses><br />
            <add baseaddress="http://YourSiteName/" />          </baseAddresses><br />
        </host><br />
<br />
      </service><br />
    </services><br />
    <behaviors><br />
      <servicebehaviors><br />
        <behavior name="MyWCF"><br />
          <br />
          <servicemetadata httpgetenabled="true" policyversion="Policy15" /><br />
                    <servicedebug includeexceptiondetailinfaults="true" /><br />
        </behavior><br />
      </servicebehaviors><br />
    </behaviors><br />
  </system.servicemodel><br />
  <system.webserver><br />
    <modules runallmanagedmodulesforallrequests="true"><br />
    </modules><br />
  </system.webserver><br />
</configuration><br />
 <br />







谢谢&问候

Shaju




Thanks & Regards
Shaju


这篇关于在配置元素system.serviceModel / serviceHostingEnvironment / serviceActivations中提供。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆