2010-12-22 61 views
2

我开发了一个非常简单的WCF,使用v2.0.50727框架服务返回一个字符串 - 一个典型的HelloWorld()场景。然而,配置是一个绝对的痛苦,我真的不明白我做错了什么。请注意我是管理员使用Windows 7使用IIS7和WCF时的问题 - 甚至无法加载.SVC

所以一步一步在我的机器上,这里是我在做什么:

  1. 创建一个新的网站指向我的WCF目录。该目录包含.SVC,一个Web.config和bin目录,在它

  2. 尝试.dll和.PDB并浏览到网站:

    Config Error - Cannot read configuration file due to insufficient permissions

    因此,我给IIS_IUSRS帐户访问目录。

  3. 另一个错误:

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

    因此,我保证权限向下传播用户 - 他们是。同样的问题出现了,并再次 - 这样的时间尝试不同的东西。

  4. 我看AppPools,他们正在使用4.0新集成模式为我创建一个。我将其更改为DefaultAppPool

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

  5. 我打开ASP.NET模拟 - 通过我的用户,而不是默认的

    An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

    我改变管道Classic ASP.NET Pool(其中关闭ASP.NET安全)

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

  6. 转身ASP.NET模拟

    You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

-

请某人能引导我,什么我要去我错了吗? IIS 6只想让我马上和我在做配置的显著量只是加载.SVC

问候,

多米尼克

+0

因为.NET 3.0使用V2.0.50727 CLR,你必须要么选用或.NET 4 – 2010-12-22 18:59:59

回答

3

你并不需要添加处理程序。 SVC。当你安装.NET时会发生这种情况。

问题不在于处理程序;这是安全。 ASPNET模仿看起来像是一条红色的鲱鱼。这是一个WCF服务,对不对?也许你在吠叫错误的树。

你说你确保权利“传播下来” - 但检查。例如,当您将文件从一个目录移动到另一个目录时,该文件可以携带一个ACL,该ACL不是您希望在原始文件夹中创建文件时所期望的“继承”ACL。

检查事项:

  • IIS_IUSRS一定看过+上的物理目录
  • Bin子目录需要有IIS_IUSRS适当的权限执行权限。
  • bin子目录中的DLL需要可读
  • 您可能希望为vdir启用“匿名”访问。
  • 你需要一个web.config文件,使用适当的烫发(但你会得到一个不同的错误,如果这是问题)
  • .svc文件需要有适当的权限

一让.svc工作的一步是获取一个简单的.htm页面来加载。那样有用吗?一旦你得到了,然后加载一个简单的.ASPX页面,从bin目录中的代码。一旦你明白了,你应该能够运行.svc,没问题。

在这一点上,你只需要做WCF特定的配置。