我使用的是VS2010 + C#+ .Net 4.0 + IIS 7.5 + Windows 7.當我打開IIS中的WCF項目的svc文件(在IIS管理器中,右鍵單擊svc文件並選擇瀏覽)時,出現錯誤像這樣,任何想法有什麼不對?禁止瀏覽WCF svc文件?
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.svc' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
這是我使用的web.config文件的內容,它是正確的嗎?
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svc" />
</staticContent>
<handlers>
<remove name="svc-ISAPI-2.0" />
<remove name="svc-Integrated" />
<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
</handlers>
</system.webServer>
</configuration>
謝謝!我應該在C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319下運行servicemodelreg?或者在C:\ Windows \ Microsoft.NET \ Framework \ v3.0 \ Windows Communication Foundation下? – George2 2010-09-24 02:48:18
我試過你的解決方案,但遇到了一個新問題=> http://stackoverflow.com/questions/3776493/loading-error-for-system-servicemodel-activation-httpmodule我很困惑爲什麼加載3.0服務時出錯模型錯誤。我的代碼是爲.NET 4.0構建的。 – George2 2010-09-24 03:24:00
我也懷疑web.config是不正確的。我已發佈web.config我原來的帖子,任何想法? – George2 2010-09-24 03:32:49