高分求教:.net framework2.0 问题。

Playmaster 2007-11-29 03:43:02
我在浏览器中打开网站(一个简单的企业网站)下的default.aspx网页时出现下述错误信息,是什么原因引起的,如何解决?

应用程序中的服务器错误。
-------------------------------------------------------

访问 IIS 元数据库失败。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Web.Hosting.HostingEnvironmentException: 访问 IIS 元数据库失败。

用于运行 ASP.NET 的进程帐户必须具有对 IIS 元数据库(如 IIS://servername/W3SVC)的读访问权。有关如何修改元数据库权限的信息,请参见 http://support.microsoft.com/?kbid=267904。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:


[HostingEnvironmentException: 访问 IIS 元数据库失败。]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3609834
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +169
System.Web.CachedPathData.GetConfigPathData(String configPath) +382
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3503459
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189

-----------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.832; ASP.NET 版本:2.0.50727.832
...全文
752 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
Playmaster 2007-11-30
  • 打赏
  • 举报
回复
内容太长,先贴部分

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\WEB.CONFIG

<?xml version="1.0" encoding="utf-8"?>
<!-- the root web configuration file -->
<configuration>
<!--
Using a location directive with a missing path attribute
scopes the configuration to the entire machine. If used in
conjunction with allowOverride="false", it can be used to
prevent configuration from being altered on the machine

Administrators that want to restrict permissions granted to
web applications should change the default Trust level and ensure
that overrides are not allowed
-->
<location allowOverride="true">
<system.web>
<securityPolicy>
<trustLevel name="Full" policyFile="internal" />
<trustLevel name="High" policyFile="web_hightrust.config" />
<trustLevel name="Medium" policyFile="web_mediumtrust.config" />
<trustLevel name="Low" policyFile="web_lowtrust.config" />
<trustLevel name="Minimal" policyFile="web_minimaltrust.config" />
</securityPolicy>
<trust level="Full" originUrl="" />
</system.web>
</location>

<system.net>
<defaultProxy>
<proxy usesystemdefault="true" />
</defaultProxy>
</system.net>


<system.web>
<authorization>
<allow users="*" />
</authorization>

<browserCaps userAgentCacheKeyLength="64">
<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</browserCaps>

<clientTarget>
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
<add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.1)" />
<add alias="downlevel" userAgent="Generic Downlevel" />
</clientTarget>

<compilation defaultLanguage="c#">
<assemblies>
<add assembly="mscorlib" />
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="*" />
</assemblies>
<buildProviders>
<add extension=".aspx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".ascx" type="System.Web.Compilation.UserControlBuildProvider" />
<add extension=".master" type="System.Web.Compilation.MasterPageBuildProvider" />
<add extension=".asmx" type="System.Web.Compilation.WebServiceBuildProvider" />
<add extension=".ashx" type="System.Web.Compilation.WebHandlerBuildProvider" />
<add extension=".soap" type="System.Web.Compilation.WebServiceBuildProvider" />
<add extension=".resx" type="System.Web.Compilation.ResXBuildProvider" />
<add extension=".resources" type="System.Web.Compilation.ResourcesBuildProvider" />
<add extension=".wsdl" type="System.Web.Compilation.WsdlBuildProvider" />
<add extension=".xsd" type="System.Web.Compilation.XsdBuildProvider" />
<add extension=".js" type="System.Web.Compilation.ForceCopyBuildProvider" />
<add extension=".lic" type="System.Web.Compilation.IgnoreFileBuildProvider" />
<add extension=".licx" type="System.Web.Compilation.IgnoreFileBuildProvider" />
<add extension=".exclude" type="System.Web.Compilation.IgnoreFileBuildProvider" />
<add extension=".refresh" type="System.Web.Compilation.IgnoreFileBuildProvider" />
</buildProviders>
<expressionBuilders>
<add expressionPrefix="Resources" type="System.Web.Compilation.ResourceExpressionBuilder" />
<add expressionPrefix="ConnectionStrings" type="System.Web.Compilation.ConnectionStringsExpressionBuilder" />
<add expressionPrefix="AppSettings" type="System.Web.Compilation.AppSettingsExpressionBuilder" />
</expressionBuilders>
</compilation>

<healthMonitoring>
<bufferModes>
<add name="Critical Notification" maxBufferSize="100" maxFlushSize="20"
urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00"
maxBufferThreads="1" />
<add name="Notification" maxBufferSize="300" maxFlushSize="20"
urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00"
maxBufferThreads="1" />
<add name="Analysis" maxBufferSize="1000" maxFlushSize="100"
urgentFlushThreshold="100" regularFlushInterval="00:05:00"
urgentFlushInterval="00:01:00" maxBufferThreads="1" />
<add name="Logging" maxBufferSize="1000" maxFlushSize="200" urgentFlushThreshold="800"
regularFlushInterval="00:30:00" urgentFlushInterval="00:05:00"
maxBufferThreads="1" />
</bufferModes>

<providers>
<add name="EventLogProvider" type="System.Web.Management.EventLogWebEventProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
<add connectionStringName="LocalSqlServer" maxEventDetailsLength="1073741823"
buffer="false" bufferMode="Notification" name="SqlWebEventProvider"
type="System.Web.Management.SqlWebEventProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
<add name="WmiWebEventProvider" type="System.Web.Management.WmiWebEventProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
</providers>

<profiles>
<add name="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00"
custom="" />
<add name="Critical" minInstances="1" maxLimit="Infinite" minInterval="00:00:00"
custom="" />
</profiles>

<rules>
<add name="All Errors Default" eventName="All Errors" provider="EventLogProvider"
profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00"
custom="" />
<add name="Failure Audits Default" eventName="Failure Audits"
provider="EventLogProvider" profile="Default" minInstances="1"
maxLimit="Infinite" minInterval="00:01:00" custom="" />
</rules>
Playmaster 2007-11-30
  • 打赏
  • 举报
回复
谢谢楼上诸位,周末送分。
symbol441 2007-11-30
  • 打赏
  • 举报
回复
应该也不至于,如果你的程序在本地调试是没有任何问题的
试着把你的你的程序发布在其它机器上试试能不能正常运行.
如果可以,很明显那就是你的IIS配置的原因.如果不行,再重装也不迟.
Playmaster 2007-11-30
  • 打赏
  • 举报
回复
会不会是安装别的软件把原来的配置破坏掉了?
我装过delphi2007,后来又卸载掉了。

还有,我是先装的vs 2005(含.net framework 2), 后来才装的IIS。
是不是应该次序反过来? 我得卸了.net 重装?


:(
symbol441 2007-11-30
  • 打赏
  • 举报
回复
在未测试任何以前存在的应用程序的情况下,请不要更改信任级别.
具体的我对这个也不是很清楚.这应该是程序自身配置就存在问题
试试重新生成再发布吧.
jiahuafu 2007-11-30
  • 打赏
  • 举报
回复
web.config文件肯定有错
symbol441 2007-11-29
  • 打赏
  • 举报
回复
无法识别的配置节 system.net。 (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config line 27)
----
贴上完整的web.config看看
symbol441 2007-11-29
  • 打赏
  • 举报
回复
把你的web.config完整的代码贴上来
Playmaster 2007-11-29
  • 打赏
  • 举报
回复
谢谢,有效果了。

那个问题没有了,新问题来了, :)

应用程序中的服务器错误。
---------------------------------------------------

配置错误
说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。

分析器错误信息: 无法识别的配置节 system.web。

源错误:


行 13: -->
行 14: <location allowOverride="true">
行 15: <system.web>
行 16: <securityPolicy>
行 17: <trustLevel name="Full" policyFile="internal" />


源文件: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config 行: 15



显示其他配置错误:


无法识别的配置节 system.net。 (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config line 27)


--------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.832; ASP.NET 版本:2.0.50727.832



说明: 我不是在vs2005下调试程序,我是把程序目录设置成本机IIS的虚拟目录。
然后在浏览器里输入http://本机IP地址/虚拟目录名/default.aspx,然后运行的。
Playmaster 2007-11-29
  • 打赏
  • 举报
回复
试了,我把NETWORK SERVICE之间的空格去掉了,变成了NETWORKSERVICE,问题依然存在。

若不去掉空格,则执行效果如同 aspnet_regiis /? ,只显示命令选项。
symbol441 2007-11-29
  • 打赏
  • 举报
回复
帮你搜了一下,你试试看


1、打开CMD,进入 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2、输入 aspnet_regiis.exe -i
3、先关闭你的VS2005。
4、打开 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files 找到你刚才调试的程序的名字的目录删除它。
5、关闭IIS服务器,重开一次。
6、用IE浏览一下你的程序,问题解决。
symbol441 2007-11-29
  • 打赏
  • 举报
回复
你的计算机上面没有这个用户的么?
那试试

aspnet_regiis -ga NETWORK SERVICE
Playmaster 2007-11-29
  • 打赏
  • 举报
回复
楼上:
用户“aspnet”不存在.
symbol441 2007-11-29
  • 打赏
  • 举报
回复
试试

aspnet_regiis -ga aspnet
Playmaster 2007-11-29
  • 打赏
  • 举报
回复
操作系统是Windows XP sp2。网站使用VS 2005开发的,数据库用SQL Server 2000。

以前在另外一台Windows 2k的机器上没出过这样的错误。

我执行了%WINDIR%/MICROSOFT.NET/FRAMEWORK/V2.0.50727/ASPNET_REGIIS.EXE
-ga Administrator后,问题依然存在。

我一直是用Administrator登录的。
ljleager 2007-11-29
  • 打赏
  • 举报
回复
http://support.microsoft.com/?kbid=267904

17,740

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧