Использование Microsoft.VisualBasic.Logging.FileLogTraceListener с ASP.NET MVC 3

Я пытаюсь использовать Microsoft.VisualBasic.Logging.FileLogTraceListener в моем приложении ASP.NET MVC 3 (vb.net). Он работает на моем компьютере разработчика, но выдает ошибку при запуске с сервера IIS 6. Вот файл web.config, который я использую:

<?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>

Я получил следующую ошибку:

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()

Похоже, FileLogTraceListener пытался записать в C: \ Documents and Settings \ Default User \ Application Data \ Microsoft Corporation \ Internet Information Services \ 6.0.3790.3959 и не удалось.

На самом деле папка Microsoft Corporation \ Internet Information Services \ 6.0.3790.3959 не существует в Пользователь по умолчанию \ Данные приложения . Я попытался создать его, назначив полный доступ всем, но все равно получал ту же ошибку.

Можно ли использовать Microsoft.VisualBasic.Logging.FileLogTraceListener из приложения ASP.NET MVC?

6
задан Endy Tjahjono 17 October 2011 в 12:12
поделиться