2011-09-26 39 views
0

我在一個域上,閱讀路徑\\machinecap\platform\inFileSystemWatcher C#權限問題

該平臺是一個共享,在本地導致E:\cappuccino\platform。該應用程序是使用C#.NET 2.0製作的Windows服務,它使用FileSystemWatcher爲創建和重命名的文件讀取路徑\\machinecap\platform\in

自從\\machinecap\platform(包括所有子目錄)以來,我擁有「完全控制」權限,但只有這樣,才能訪問服務器中其他任何文件夾(是Windows Server 2003)。

問題是當文件到達服務器時,服務崩潰,並且在事件查看器中沒有記錄(下降)消息。爲了追蹤問題,我在服務器中創建了一個邏輯對象,並試圖手動執行應用程序所執行的所有步驟。我可以在「in」文件夾中創建文件,但是我無法刪除這些文件...顯示的錯誤消息:"E:\ is not accessible. Access is denied."

當然,我沒有任何訪問E:\根文件夾的權限,只有E:\cappuccino\platform ...這是問題嗎?我是否真的必須讀取E:\才能閱讀E:\cappuccino\platform

更多信息

異常消息:

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. 
An attempt was made to load a program with an incorrect format. 
File name: 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' 
    at TestRiskStore.ArisReportReader.CreateOrRename(Object source, FileSystemEventArgs e) 
    at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer) 
    at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) 

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 

請注意,我用Oracle.DataAccess組件。我認爲這個問題是關係到這一點,不知道....任何想法如何解決這個問題?

+0

還有一條評論...當我打開cmd並鍵入'E:[enter]'我得到了同樣的錯誤信息:拒絕訪問 – jyz

+4

您發佈的錯誤消息與「拒絕訪問」無關。你發佈了錯誤的例外嗎? –

+0

這只是我得到的錯誤信息。 「拒絕訪問」是在服務器上進行了一些調查之後,我認爲這個問題可能與程序集上的權限丟失有關。但是我已經檢查過它具有適當的權限(我使用'cacls'進行了檢查) – jyz

回答

0

我發現了這個問題:我的機器是32位,服務器是64位,我編譯的應用程序可以在任何平臺上運行。問題在於它安裝在服務器上的OracleDataAccess組件是32位的,所以組件僅安裝在GAC_32文件夾中。因此,當應用程序試圖在64位模式下運行時,它找不到程序集。

所以我只是重新編譯應用程序爲x86(32位),它的工作。現在應用程序在32位模式下運行,並在正確的文件夾中查找程序集。