'/' 응용 프로그램에 서버 오류가 있습니다.

'D:\20230622_letsballet.com\03_letsballet.com\counterHomeIndexEn.txt' 경로에 대한 액세스가 거부되었습니다.

설명: 현재 웹 요청을 실행하는 동안 처리되지 않은 예외가 발생했습니다. 스택 추적을 검토하여 발생한 오류 및 코드에서 오류가 발생한 위치에 대한 자세한 정보를 확인하십시오.

예외 정보: System.UnauthorizedAccessException: 'D:\20230622_letsballet.com\03_letsballet.com\counterHomeIndexEn.txt' 경로에 대한 액세스가 거부되었습니다.

ASP.NET에는 요청한 리소스에 액세스할 권한이 없습니다. ASP.NET 요청 ID에 리소스 액세스 권한을 부여하십시오. ASP.NET에는 응용 프로그램이 가장하지 않을 때 사용되는 기본 프로세스 ID(일반적으로 IIS 5에서는 {MACHINE}\ASPNET, IIS 6 및 IIS 7에서는 Network Service, 그리고 IIS 7.5에서는 구성된 응용 프로그램 풀 ID)가 있습니다. 응용 프로그램이 <identity impersonate="true"/>를 통해 가장하고 있는 경우에는 ID가 익명 사용자(일반적으로 IUSR_MACHINENAME) 또는 인증된 요청 사용자가 됩니다.

파일에 대한 권한을 ASP.NET에 부여하려면 파일 탐색기에서 파일을 마우스 오른쪽 단추로 클릭하고 "속성"을 선택한 다음 "보안" 탭을 선택합니다. "추가"를 클릭하여 적절한 사용자나 그룹을 추가합니다. ASP.NET 계정을 강조 표시한 다음 원하는 액세스를 선택합니다.

소스 오류:


줄 25:                 sr.Close();
줄 26:                 new_count = Int32.Parse(now_count) + 1;
줄 27:                 StreamWriter sw = File.CreateText(count_path);
줄 28:                 sw.WriteLine(new_count);
줄 29:                 sw.Close();

소스 파일: D:\20230622_letsballet.com\03_letsballet.com\Infrastructure\WiseCounter.cs    줄: 27

스택 추적:


[UnauthorizedAccessException: 'D:\20230622_letsballet.com\03_letsballet.com\counterHomeIndexEn.txt' 경로에 대한 액세스가 거부되었습니다.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +417
   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, Boolean checkHost) +1217
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +144
   System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) +123
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) +103
   System.IO.StreamWriter..ctor(String path, Boolean append) +55
   System.IO.File.CreateText(String path) +47
   PracticeMVC01.Infrastructure.WiseCounter.writeCount(String a) in D:\20230622_letsballet.com\03_letsballet.com\Infrastructure\WiseCounter.cs:27
   ASP._Page_Views_Home_IndexEn_cshtml.Execute() in d:\20230622_letsballet.com\03_letsballet.com\Views\Home\IndexEn.cshtml:10
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +86
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +59
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +26
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +40
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128


버전 정보: Microsoft .NET Framework 버전:4.0.30319; ASP.NET 버전:4.7.4087.0