【问题标题】:403 Forbidden with Built-In VS 2008 Web Server403 Forbidden with built-in VS 2008 Web Server
【发布时间】:2010-10-31 18:54:24
【问题描述】:

我有一个 ASP.Net webapp,我想在其中使用不同的本地帐户进行测试。所以我创建了该帐户,但随后在使用该帐户登录时开始出现 403 Forbidden。这是使用 VS 2008 内置的 Web 服务器 (Cassini)。一位同事建议授予该用户帐户对我所做的项目文件的权限。我还给了 ASPNET 用户相同的权限,以及对 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET 文件,杀死并重新启动 WebDev.WebServer.EXE,并清除缓存,但无济于事.我在下面的事件日志中包含了相关事件。

有什么想法可以尝试下一步,或者去哪里寻找或如何找到潜在问题的更具体原因?

谢谢,克拉克

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 6/5/2009 2:20:53 PM 
Event time (UTC): 6/5/2009 6:20:53 PM 
Event ID: fc869492b17f4bddb582026ac1752cd6 
Event sequence: 8 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: a55c3efc-3-128886994866758750 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: C:\Documents and Settings\Fred\My Documents\Visual Studio 2008\Projects\ETimeLite\ETimeLiteUserControl\ 
    Machine name: MOSSDEV 

Process information: 
    Process ID: 5260 
    Process name: WebDev.WebServer.exe 
    Account name: MOSSDEV\Fred 

Exception information: 
    Exception type: TargetInvocationException 
    Exception message: Exception has been thrown by the target of an invocation. 

Request information: 
    Request URL: http://localhost:35752/Test_EtimeLiteAsUserControl.aspx?nocache=1 
    Request path: /Test_EtimeLiteAsUserControl.aspx 
    User host address: 127.0.0.1 
    User: MOSSDEV\Fred 
    Is authenticated: True 
    Authentication Type: NTLM 
    Thread account name: MOSSDEV\Fred 

Thread information: 
    Thread ID: 4 
    Thread account name: MOSSDEV\Fred 
    Is impersonating: False 
    Stack trace:    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
   at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at System.Web.UI.WebControls.GridView.DataBind()
   at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
   at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
   at System.Web.UI.Control.EnsureChildControls()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details: 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

【问题讨论】:

    标签: asp.net visual-studio permissions cassini


    【解决方案1】:

    Cassini 正在访问文件的用户需要对正在访问的文件具有权限。

    虽然您可以很容易地通过 google 找到很多具体的答案,但我会提供一个“教鱼”的答案,您会喜欢或讨厌:-

    使用procmon from sysinternals,您将能够看到内部拒绝的权限,这将允许您将正在访问的资源上的足够权限分配给正在以其身份访问它的用户。

    【讨论】:

    • 好的,运行 procmon。我没有看到列出任何与项目相关的文件。我看到的唯一“有趣”的东西(除了一些框架 dll)是与 WebDev 相关的东西,但它们看起来像是进入 GAC 的虚拟路径,而不是我实际上可以更改权限的目录。你认为我会看到什么具体的东西吗?
    • 您可以忽略影子文件夹中的所有内容(您在问题中提到人们建议在那里做事)。虽然在那里复制了东西等,但所有实际的权限验证都将与您正在触摸的实际文件背道而驰。您的异常转储表明 Cassini 以“Fred”身份运行,并且该文件位于 Fred 的配置文件中,从表面上看似乎很好。如果 403 相关,Procmon 应该显示对配置文件中文件的不成功文件访问文件权限...这是一个相当普遍的问题,所以如果 procmon 没有帮助,谷歌搜索应该
    • 抱歉耽搁了,训练回来了。在早上的大部分时间里都在努力解决这个问题后,我下注,现在从 IIS 中运行它,它工作正常。我读了一些让我相信 WebDev.WebServer.exe 的东西,Page.User.Identity 只是运行该进程的用户(虽然不是肯定的)。无论如何,感谢您的建议。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-21
    • 2019-10-30
    • 2013-11-01
    • 2021-03-02
    • 2015-05-18
    • 2020-06-04
    相关资源
    最近更新 更多