无法加载文件或程序集“服务"或其依赖项之一.该系统找不到指定的文件. [英] Could not load file or assembly 'service' or one of its dependencies. The system cannot find the file specified.

查看:101
本文介绍了无法加载文件或程序集“服务"或其依赖项之一.该系统找不到指定的文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我一直收到此错误" 无法加载文件或程序集服务"或其依赖项之一.这 系统无法找到指定的文件."
当我在服务的web.config文件中添加此元素行时,
customUserNamePasswordValidatorType ="ProgrammingIndigo.HelloService + MyCustomUserNameValidators,服务"/>
放在http://localhost:1459/Server/service中. svc在浏览器中,我得到了上面的错误. > 服务 "
但我无法弄清楚问题出在哪里..我不知道什么 <配置xmlns ="http://schemas.microsoft.com/.NetConfiguration/v2.0"<< system.serviceModel>
< services>
< service name ="ProgrammingIndigo.HelloService"
行为配置="calculatorServiceBehavior">
<端点地址=
绑定属性="helloBinding"
绑定="wsHttpBinding"
合约="ProgrammingIndigo.IHello. />
</service>
</services>
< bindings>
< wsHttpBinding>
< binding name =" helloBinding">
< reliableSession enabled ="true"; />
<安全模式=消息">
消息< message clientCredentialType ="UserName"; />
</security>
"CalculatorServiceBehavior"
返回returnUnknownExceptionsAsFaults ="True" < ;! span style ="color:rgb(0,0,128)">
< userNameAuthentication userNamePasswordValidationMode ="自定义"
customUserNamePasswordValidatorType =''ProgrammingIndigo.HelloService + MyCustomUserNameValidators,service''/>
.serviceModel>
< system.web>
< compilation debug =" true><</compilation</compilation</</system.web>
</配置>

谢谢.

Sree

Hi All,

I keep getting this error "Could not load file or assembly 'service' or one of its dependencies. The system cannot find the file specified."
when i added this line of element in the web.config file of the service
<userNameAuthentication userNamePasswordValidationMode ="Custom"
    customUserNamePasswordValidatorType ="ProgrammingIndigo.HelloService+MyCustomUserNameValidators, service"/>
When put in http://localhost:1459/Server/service.svc in the browser i get the above error.
I know the error is coming from customUserNamePasswordValidatorType ="ProgrammingIndigo.HelloService+MyCustomUserNameValidators, service"
but i am not able to figure out what the problem is..i have no clue what service it is refering to. I have looked in the msdn but could not find out.
 

Here is my web.config file of the service.
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
      <system.serviceModel>
    <services>
      <service name="ProgrammingIndigo.HelloService"
               behaviorConfiguration="CalculatorServiceBehavior">
        <endpoint address=""
                  bindingConfiguration="helloBinding"
                  binding="wsHttpBinding"
                  contract="ProgrammingIndigo.IHello" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="helloBinding">
          <reliableSession enabled="true" />
          <security mode="Message">
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
      <behaviors>
        <behavior name="CalculatorServiceBehavior"
                  returnUnknownExceptionsAsFaults="True" >
          <serviceCredentials>
            <!--
          The serviceCredentials behavior allows one to specify a
          custom validator for username/password combinations.
           -->
             <userNameAuthentication userNamePasswordValidationMode ="Custom"
    customUserNamePasswordValidatorType ="ProgrammingIndigo.HelloService+MyCustomUserNameValidators, service"/>
             </serviceCredentials>
                </behavior>
      </behaviors>
  </system.serviceModel>
  <system.web>
        <compilation debug="true">
         </compilation>
      </system.web>
</configuration>

Thank you.

Sree

推荐答案

Sree,

服务"是system.serviceModel配置引擎查找您的customUserNamePasswordValidationType的程序集的名称.

"service" is the name of the assembly that system.serviceModel configuration engine looks for your customUserNamePasswordValidationType.

通常在配置文件中声明类型时,既要指定类的全名,也要指定程序集名称以在其中查找类型.

Often when you declare a type in the config file, you specify both the full name of your class, and the assembly name to look the type in it.

请确保主机可以加载包含customerUserPasswordValidator的资产. (GAC或\ bin目录).

Please make sure that the assebly that contains you customerUserPasswordValidator can be loaded by the host. (GAC, or \bin directory).

希望有帮助.

 


这篇关于无法加载文件或程序集“服务"或其依赖项之一.该系统找不到指定的文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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