ASP.NET MVC 3 app (vb.net)에 Microsoft.VisualBasic.Logging.FileLogTraceListener를 사용하려고합니다. 내 dev에 PC에서 작동하지만 IIS 6 서버에서 실행할 때 오류가 발생합니다. FileLogTraceListener이 C:\Documents and Settings\Default User\Application Data\Microsoft Corporation\Internet Information Services\6.0.3790.3959
에 쓰기를 시도하고 실패처럼ASP.NET MVC 3에서 Microsoft.VisualBasic.Logging.FileLogTraceListener 사용
System.Configuration.ConfigurationErrorsException: Could not create Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL. ---> System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\Default User\Application Data\Microsoft Corporation\Internet Information Services\6.0.3790.3959' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj)
at System.IO.Directory.CreateDirectory(String path)
at System.Windows.Forms.Application.GetDataPath(String basePath)
at System.Windows.Forms.Application.get_UserAppDataPath()
at Microsoft.VisualBasic.Logging.FileLogTraceListener..ctor(String name)
at Microsoft.VisualBasic.Logging.FileLogTraceListener..ctor()
가 보이는 :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="requests" switchValue="All">
<listeners>
<remove name="default" />
<add name="txtfile" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="txtfile" type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL"
location="custom"
customlocation="D:\PROJECTS\saidproject\App_Data"
logfilecreationschedule="weekly"
/>
</sharedListeners>
</system.diagnostics>
</configuration>
내가 가진 오류를이있다 : 여기 내가 사용하는 Web.config의입니다.
실제로 Microsoft Corporation\Internet Information Services\6.0.3790.3959
폴더는 Default User\Application Data
안에 존재하지 않습니다. 나는 모든 사람에게 모든 권한을 부여하면서 그것을 만들려고했지만 여전히 같은 오류가있다.
ASP.NET MVC 앱에서 Microsoft.VisualBasic.Logging.FileLogTraceListener를 사용할 수 있습니까?
Microsoft 내부에 있다고 생각합니다 .VisualBasic. 이미 기본적으로 포함되어 있지 않습니까? 나는 vb.net –
을 사용하고있다. 그러나 나는 당신이 Copy Local으로 표시하면 그것을 당신의 "bin"폴더에 복사 할 것이라고 생각한다. 권리와 관련된 문제를 해결할 수 있습니다. –
여기서 액세스되는 위치는 매우 명확하며 문제의 어셈블리에 액세스하는 데 문제가 있음을 전혀 나타내지 않습니다. 나는이 특별한 조언을 듣지 않을 것이다. –