相对 URI 不支持此操作,浏览 SVC-service 时出错 [英] This operation is not supported for a relative URI, error browsing SVC-service

查看:28
本文介绍了相对 URI 不支持此操作,浏览 SVC-service 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在浏览网站的 svc 服务时收到以下错误(在它所在的服务器上浏览).网站使用IIS7.

I get the following error when browsing to a svc-service for a website (browsing it at the server it is located at). The website uses IIS7.

This operation is not supported for a relative URI.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: This operation is not supported for a relative URI.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: This operation is not supported for a relative URI.]
   System.Uri.get_Scheme() +8045854
   System.ServiceModel.HostingManager.FilterBaseAddressList(Uri[] baseAddresses, Uri[] prefixFilters) +142
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +598
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172

[ServiceActivationException: The service '/Templates/eDemokrati/Services/eDemokratiService.svc' cannot be activated due to an exception during compilation.  The exception message is: This operation is not supported for a relative URI..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +900192
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +192830
   System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 

服务链接:链接

网站的一些 web.config:

Some of web.config for the site:

<system.serviceModel>
  <serviceHostingEnvironment>
        <baseAddressPrefixFilters>
            <add prefix="http://www.roros.kommune.no/"/>
            <add prefix="www.roros.kommune.no/"/>
            <add prefix="item"/>
            <add prefix="http://www.roros.kommune.no/templates/eDemokrati/Services/"/>
            <add prefix="www.roros.kommune.no/templates/eDemokrati/Services/"/>

        </baseAddressPrefixFilters>
    </serviceHostingEnvironment>

错误是由什么引起的,我该如何解决?

What is the error caused by and how do I solve this?

推荐答案

如异常消息所示,不允许使用相对 URI.尝试删除 prefix="item" 并使它们都成为绝对 URI.

As the exception message indicates, relative URI is not allowed. Try removing the prefix="item" and make all of them an absolute URI.

这篇关于相对 URI 不支持此操作,浏览 SVC-service 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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