Server Error in '/' Application.

xiangxingGoo 2012-05-07 04:21:41
Server Error in '/' Application.
--------------------------------------------------------------------------------

拒绝访问。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
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.UnauthorizedAccessException: 拒绝访问。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

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:


[UnauthorizedAccessException: 拒绝访问。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))]

[FileLoadException: Could not load file or assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 拒绝访问。]
DAL.AnLiServer.GetAnLinNews(Int32 num) in G:\源文件\Example\DAL\AnLiServer.cs:124
Aspx_Default2.Page_Load(Object sender, EventArgs e) +16
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207



这个网站是我上传在服务器了的 但是我在操作后台的时候有时候就出现这个错误 有时候又不会出现
...全文
1569 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
loveheronly 2012-05-09
  • 打赏
  • 举报
回复
重装IIS,重新部署
zhangdaowu5 2012-05-09
  • 打赏
  • 举报
回复
用管理员身份去更改你访问的资源文件权限。
全局变量 2012-05-09
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 的回复:]

identity impersonate="true" userName="Administrator" password="123" /> 这个没加啊
服务器那边说我的权限肯定是够了的
我在后台插入数据了之后前台马上就更新过来了
控制面板上有这个设置 我设置了最高权限了的
[/Quote]
如果只是针对个别文件的调用4搂的方法可行
果然是对服务器上的COM组件或 txt API什么的调用 就得有操作系统的大权限。
identity impersonate="true" userName="Administrator" password="123" /> 这个就是让网站拥有 Administrator这个用户的权限
xiangxingGoo 2012-05-09
  • 打赏
  • 举报
回复
还有
DAL.AnLiServer.GetAnLinNews(Int32 num) in G:\源文件\Example\DAL\AnLiServer.cs:124
他为什么要说这一句啊
怎么会有这个路劲呢 我没明白
我已经发布了的怎么还会又有我本地的路劲呢
xiangxingGoo 2012-05-09
  • 打赏
  • 举报
回复
identity impersonate="true" userName="Administrator" password="123" /> 这个没加啊
服务器那边说我的权限肯定是够了的
我在后台插入数据了之后前台马上就更新过来了
控制面板上有这个设置 我设置了最高权限了的
laokaizzz 2012-05-09
  • 打赏
  • 举报
回复
同意4楼,权限的问题
全局变量 2012-05-09
  • 打赏
  • 举报
回复
<identity impersonate="true" userName="Administrator" password="123" /> 这个加了?

拒绝访问。 (异常来自HRESULT:0x80070005 (E_ACCESSDENIED))
这个问题是我最近开发.net服务过程中遇到的 DCOM 权限问题。
运行dcomcnfg
点 组件服务-》服务-》电脑-》我的电脑-》DCOM 配置
然后继续设置就可以了。
yyl8781697 2012-05-09
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 的回复:]

权限肯定是够了的
就是在操作网站后台的时候有时候会突然出现这个错误
而且那个身份证肯定我是写不了的啊
我毕竟是要挂在服务器上的啊
[/Quote]
你在访问前台的一些页面的时候有没有数据的更新或者插入的?
我觉得应该是在访问后台 的时候遇到了数据库的操作而产生的没有权限,你可以按4L的方法试试,给你数据库还有附件存储的文件夹添加这个权限就可以了。
还有你那服务器是别人的虚拟主机的话你看主机管理网站上的控制面板页面有没有这种设置,或者叫客服来设置也可以,服务器这个服务器你可以直接用远程登录的话直接可以自己设置
xiangxingGoo 2012-05-09
  • 打赏
  • 举报
回复
权限肯定是够了的
就是在操作网站后台的时候有时候会突然出现这个错误
而且那个身份证肯定我是写不了的啊
我毕竟是要挂在服务器上的啊
anzhiqiang_touzi 2012-05-09
  • 打赏
  • 举报
回复
异常说了,IIS的IUser没有需要的权限。
按照以下步骤:
1.将你寄宿的WebSite的Authentication里面的匿名验证默认值使用“与应用池使用同样用户”
2.将你寄宿的WebSite使用的Application pool的用户设置为你的某个用户,这个用户需要有你做当前操作需要的权限,最好不要是超级用户,否则一旦website受到攻击,危害太大。
第2步的设置在Application pool的高级设置中。

net5354 2012-05-09
  • 打赏
  • 举报
回复
附加了数据库了吗?连接字符串正确吗?
孟子E章 2012-05-09
  • 打赏
  • 举报
回复
你要编译成成单一的dll,然后只上传dll就可以了,不要上传cs文件
参见VS里面的“生成”-“发布网站”
铜臂阿铁木 2012-05-09
  • 打赏
  • 举报
回复
这个很简单。

异常说了,IIS的IUser没有需要的权限。
按照以下步骤:
1.将你寄宿的WebSite的Authentication里面的匿名验证默认值使用“与应用池使用同样用户”
2.将你寄宿的WebSite使用的Application pool的用户设置为你的某个用户,这个用户需要有你做当前操作需要的权限,最好不要是超级用户,否则一旦website受到攻击,危害太大。
第2步的设置在Application pool的高级设置中。

或者

将你的IUser组放进Administrator(最好是做你需要做的操作的最小权限组)组中。
  • 打赏
  • 举报
回复
需要访问的文件夹 右键 -》安全-》添加EveryOne用户,并设置读写权限 试试
threenewbee 2012-05-07
  • 打赏
  • 举报
回复
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

把这两段英文看懂,就是你要的答案。
dalmeeme 2012-05-07
  • 打赏
  • 举报
回复
可能是没有相关权限,在iis里设置,自己找一下。
bdmh 2012-05-07
  • 打赏
  • 举报
回复
访问什么了,拒绝访问,数据库还是文件

62,268

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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