Server Error in '/' Application. 解决办法

2023-05-16

Server Error in '/' Application.
--------------------------------------------------------------------------------


Access to the path 'E:\NetWeb2\Content\upFile\BClientExcel\大客户部通讯录导入.xlsx' is denied. 
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: Access to the path 'E:\NetWeb2\Content\upFile\BClientExcel\大客户部通讯录导入.xlsx' is denied. 


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: Access to the path 'E:\NetWeb2\Content\upFile\BClientExcel\大客户部通讯录导入.xlsx' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +9726174
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +1142
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +78
   System.IO.FileStream..ctor(String path, FileMode mode) +71
   System.Web.HttpPostedFile.SaveAs(String filename) +99
   System.Web.HttpPostedFileWrapper.SaveAs(String filename) +11
   MvcTender.Controllers.Contacts_BClientController.Upload() +280
   lambda_method(Closure , ControllerBase , Object[] ) +62
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +188
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +59
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +240
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +240
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +31
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +23
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +128
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +26
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +41
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +28
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +30
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8905917
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184


 




--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.504 



PS:去服务器看这个错误的原始错误,一般都有解决方案

我这个错误是,上传文件时报错.本地没有,就服务器出错,报错很明显,需要添加文件夹控制权限.即可


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Server Error in '/' Application. 解决办法 的相关文章

  • 报告本地时间而不是 UTC 服务器时间

    我创建了一个页面 其中向用户显示服务器报告的天气数据 时间保存为 UTC 如何从 Blazor 服务器应用程序显示本地用户或浏览器的时间 我遇到了类似的问题并创建了一个名为的库布拉佐尔时间 https github com dustout
  • 停止/启动服务器上的应用程序池和站点

    我想编写一个脚本并从本地 PC 运行它来停止和启动服务器上存在的应用程序池和站点 应用程序池和网站的价值 测试 服务器的值 SERVER1 任何指导将不胜感激 使用管理权限运行命令提示符 然后键入以下内容 C Windows System3
  • HttpsServer 使用curl 导致CPU 负载100%

    我已经围绕 Java 创建了一个最小的应用程序HttpsServer https docs oracle com en java javase 11 docs api jdk httpserver com sun net httpserve
  • 您可以从另一台服务器发送 HTTP 响应吗?

    也许是愚蠢的问题 我最近一直在玩 Node js 喜欢设置服务器和发出请求等是多么容易 我还没有尝试过 但想知道如何将数据从一个请求转发到另一台服务器 并有第二个服务器向客户端发送响应 这可能吗 i e 客户端 gt 服务器 A gt 服务
  • 使用 python 带有自签名证书的 ssl

    我正在尝试使用我的自签名证书在 python 中构建一个简单的服务器 我使用 makecert 创建了 cer pfx pvk 文件 context ssl create default context ssl Purpose CLIENT
  • 可以在生产 Laravel 网站上运行 php artisan :clear 命令吗? [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 我有一个托管在 DigitalOcean NGINX 服务器上的生产 Laravel 网站 每次 git 推送新更新时 我总是运行以下命令 ph
  • Nginx 别名指令不适用于 php

    我有一个在 Nginx 上运行的应用程序 其工作服务器块如下所示 server listen 80 server name example com root home deployer apps my app current index i
  • 如何保持用户登录始终“与服务器连接”

    我正在开发一个应用程序 我希望用户保持登录状态意味着在成功登录后始终连接到服务器 就像 Facebook 应用程序一样 我试图用谷歌搜索这个 但没有找到任何正确的逻辑 许多网站建议使用SharedPreference但保留用户的登录信用 S
  • Heroku 给出 500 错误,信息很少 + 内部服务器错误

    Heroku 在页面上显示此消息 internal server error 此错误显示在控制台中 GET 500内部服务器错误 检查 Heroku 应用程序的日志以查看更多详细信息 您可以使用流式传输日志Heroku CLI https
  • python创建DDE服务器并不断发送数据

    我正在尝试用 python 编写一个 DDE 服务器 它需要将不断变化的字符串发送到作为 DDE 客户端连接的程序 连接到 DDE 服务器的程序使用以下 DDE 设置来连接 服务 Orbitron 主题 Tracking 项目 Tracki
  • 在计算机上找不到 MySQL

    我最近直接从网站 mysql 5 7 9 osx10 10 x86 64 dmg 安装了MySQL 并且在尝试更改给定密码时遇到了很大的困难 返回的错误是 警告 在命令行界面上使用密码可能会导致 没有安全感 mysqladmin 连接到 l
  • 无法远程连接到Python Socket

    我已经使用 python 套接字和 Tkinter 创建了一个聊天应用程序 它在本地运行得很好 但是客户端无法远程连接到服务器 当我输入我的公共 IP 地址作为主机时 我已经完全端口转发了我的网络并且我知道如何很好地进行端口转发 当我运行在
  • 如何在Windows平台上编写Git Server Hooks?

    我找不到任何适用于 Windows 的 Git 挂钩的明确示例 我在 Windows Server 上使用 Bonobo Git Server 我需要预提交和提交后挂钩作为 cmd 或 bat 预提交应检查空注释 提交后应发送有关提交的电子
  • BasicNetwork.performRequest:意外响应代码 500

    我的 Android Studio 中有这个登录 Java 代码 private void loginUser pd ProgressDialog show LoginActivity this Loading StringRequest
  • 无法在服务器端 NodeJS 启用 CORS

    我无法启用CORS在服务器端 我的前端和后端服务器有不同的端口 服务器端的实现方式如下 http createServer function req res Here you can create your data response in
  • 在云服务器中运行 python 脚本的最简单方法是什么?

    我有一个网络爬行 python 脚本 需要几个小时才能完成 并且无法在我的本地计算机上完整运行 有没有一种方便的方法可以将其部署到简单的 Web 服务器 该脚本基本上将网页下载到文本文件中 如何最好地实现这一点 谢谢 既然你说性能是一个问题
  • jinja2.exceptions.TemplateNotFound:index.html

    我尝试使用 Flask 打开 index html run py from app import app app run debug True init py from flask import Flask app Flask name f
  • 套接字:监听积压并接受

    listen sock backlog 在我看来 参数backlog限制连接数量 这是我的测试代码 server initialize the sockaddr of server server sin family AF INET ser
  • 让 WSO2 IOT 服务器作为 Windows 服务运行

    我在Server 2012R2上安装了WSO2 IOT Server 我安装了 YAJSW 包装器并按照 WSO2 说明进行配置 当我启动 runConsole bat 来配置 Windows 服务时 出现以下错误 我设置了 JAVA HO
  • Laravel Vue js spa 应用程序

    1 我想知道为什么人们使用两台服务器用 laravel 制作 vuejs SPA 我想我们可以用另一种方式 制定这样的路线 Route get any function return view index gt where any 并让 v

随机推荐