Silverlight 5和Ria服务故障排除[Web-Services-AuthenticationService.svc不存在] [英] Troubleshooting Silverlight 5 and Ria services [Web-Services-AuthenticationService.svc does not exist]

查看:169
本文介绍了Silverlight 5和Ria服务故障排除[Web-Services-AuthenticationService.svc不存在]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ria服务有两个不同版本的Silverlight 5项目。都在本地工作。旧版本(A)在部署到ISS7时有效。新版本(B)没有。版本B的用户/密码验证失败,错误包括:

I have two different versions of a Silverlight 5 project using Ria services. Both work locally. The older version (A) works when deployed to ISS7. The new version (B) does not. There is user/password authentication that fails for version B with the error:


  • 查询加载操作失败'登录。远程服务器返回错误:NotFound。

  • Load operation failed for query 'Login'. the remote server returned an error: NotFound.

在过去一周内引用各种SO和MSDN帖子,我尝试了很多故障排除技巧。将此处建议的错误日志记录添加到web.config会导致以下内容被记录:

Referencing various SO and MSDN posts over the past week, I have tried many troubleshooting techniques. Adding error logging as suggested here to the web.config results in the following being logged:


  • 服务'/ClientBin/MyApp-Web-Services-AuthenticationService.svc'不存在。

  • The service '/ClientBin/MyApp-Web-Services-AuthenticationService.svc' does not exist.

研究导致找到此论坛帖子建议使用其正在查找的名称/路径创建一个虚拟.svc文件。结果:

Researching that led to finding this forum post which suggests creating a dummy .svc file with the name/path it is looking for. The result:


  • 无法激活服务'/ClientBin/DBCRM-Web-Services-AuthenticationService.svc'由于编译期间的异常。异常消息是:'。'svc'文件中缺少'ServiceHost'指令的结束括号'& gt;'..

  • The service '/ClientBin/DBCRM-Web-Services-AuthenticationService.svc' cannot be activated due to an exception during compilation. The exception message is: The ending bracket '>' for the 'ServiceHost' directive is missing in the '.svc' file..

上述错误的详细信息并不重要,因为它是我提供的空白.svc文件。它只是证实了项目确实依赖于它的事实

The details of the above error aren't largely important as it was a blank .svc file I supplied. It merely served to confirm that fact that the project was indeed dependent on it

这是踢球者...工作版不会包含这个文件,但它不会抛出异常。

Here's the kicker... the working version DOES NOT contain this file either, yet it does not throw an exception.

在两种解决方案中,搜索任何需要该服务的参考都令人惊讶地出现了结果。 MyApp.Web.g.cs 文件都相同(运行CSDiff)并且都包含以下行:

Searching for any reference to needing the service surprisingly turned up a result in both solutions. Both MyApp.Web.g.csfiles are identical (ran a CSDiff) and both contain the line:


  • public AuthenticationContext():
    this(new WebDomainClient< IAuthenticationServiceContract>(new Uri(DBCRM-Web-Services-AuthenticationService.svc,UriKind.Relative)) )
    {
    }

  • public AuthenticationContext() : this(new WebDomainClient<IAuthenticationServiceContract>(new Uri("DBCRM-Web-Services-AuthenticationService.svc", UriKind.Relative))) { }

两者都具有相同的包/部署设置。我正在部署到文件系统,然后将文件复制到主机服务器上的IIS。

Both have the same package/deploy settings. I am deploying to a file system, then copying the files over to IIS on my host server.

问题:


  1. 设置这个.svc文件的设置在哪里?在版本A中显然不需要它,但是在版本B中。同样,文件 MyApp.Web.g.cs 是对它的唯一引用,并且它存在于两个版本中。

  1. Where is a setting that makes this .svc file a requirement? It's clearly not needed in version A, but is in version B. Again, file MyApp.Web.g.csis the only reference to it, and it exists in both versions.

MyApp.Web.g.cs 是生成的文件。 Visual Studio 2010中的哪些服务创建此文件?另外,我可以将其修改为不包括对相关的 .svc 文件的调用吗?

MyApp.Web.g.cs is a generated file. What service in Visual Studio 2010 creates this file? Also, can I modify it to not include the call to the .svc file in question?

我将开始将这两个解决方案合并在一起,以确定.svc文件在哪一点上变得必要。在此期间的任何想法将不胜感激!

I'm going to start merging the two solutions together to see at which point the .svc file becomes neccessary. Any ideas in the meantime would be greatly appreciated!

推荐答案

WCF Ria Services注册一个HttpModule以管理wcf ria服务调用。当请求到达服务器时,模块读取url并了解要实例化的服务以及要调用的方法。所以你没有找到任何.svc文件是绝对正常的。
不要乱用.g.cs你的问题不在这里。

看看你的web.config文件,你应该找到这样的行

WCF Ria Services registers an HttpModule in order to manage the wcf ria services calls. When the request arrive to the server that module read the url and understand which service to instantiate and which method to call. So it's absolutely normal that you don't find any .svc file
Don't mess with the .g.cs your problem isn't here.
Take a look at your web.config file, you should find rows like this

<system.web>
    <httpModules>
      <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
...
</system.web>

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
          <add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
...
</system.webServer>

这篇关于Silverlight 5和Ria服务故障排除[Web-Services-AuthenticationService.svc不存在]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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