Problem to browse my WCF application on iis 5.1 with xp windows
I added a mapping .svc .net 4 application configuration published my service with the profile : Service URL - "http://localhost:8732/Service1/" Site/Application - "Default Web Site/Service1" And checked the iis option
My web.config file:
<host>
<baseAddresses>
<add baseAddress = "http://localhost:8732/Service1/" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="WcfService.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
And when I try to browse my service it gives the error :
Server Error in '/Service1' Application.
Failed to access IIS metabase. 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.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
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.
S开发者_如何转开发tack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.] System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +1076 System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9 System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +301 System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51 System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath) +39 System.Web.CachedPathData.GetConfigPathData(String configPath) +704 System.Web.CachedPathData.GetConfigPathData(String configPath) +583 System.Web.CachedPathData.GetApplicationPathData() +38 System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +8782255 System.Web.Configuration.RuntimeConfig.GetConfig(VirtualPath path) +46 System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +96
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Did you check the IIS registration of ASP.NET? Check that by making sure ASPX pages do work. If not use aspnet_regiis from the correct folder that fits the framework version you are using (including 32 or 64 bits version)
Was told that we get 'Failed to access IIS metabase' error if we install IIS after intalling .NET Framework, and remedy is to re-install ASP.NET.
To resolve this error I have followed below steps 1. Stopped IIS 2. Ran below command in command prompt to re-install aspnet.
%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
Result: Start installing ASP.NET (2.0.50727). .................................................................. Finished installing ASP.NET (2.0.50727). 3. Re-started IIS and WCF service is responding without any issues.
精彩评论