2012-10-02 49 views
0

我有一個.NET Windows應用程序連接到SQL Server 2008數據庫,我在客戶端機器上部署此應用程序通過網絡使用點擊一次技術。運行應用程序連接到SQL Server通過Windows來賓用戶帳戶

現在我正在測試應用程序在不同的用戶權限下。

當我在管理員用戶和標準用戶(Windows XP中的受限用戶)上測試應用程序時。並應用成功

運行當我測試了Guest用戶帳戶的應用程序時,我得到了下面的.NET SQL異常:

The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. 
9/26/2012 11:25:33 AM: Stack: at System.Data.SqlClient.SqlConnection..ctor() 
at  
    System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Initialize 
(IData 
Services dataServices, Object connection) 
at System.Data.Linq.DataContext.Init(Object connection, MappingSource mapping) 
at System.Data.Linq.DataContext..ctor(String fileOrServerOrConnection, MappingSource 
mapping) 

,這裏是內部異常:

System.TypeInitializationException :「System.Data.SqlClient.SqlConnectionFactory」的類型初始值設定項引發異常。 ---> System.TypeInitializationException:「System.Data.SqlClient.SqlPerformanceCounters」的類型初始值設定項引發異常。 ---> System.UnauthorizedAccessException:拒絕訪問路徑'Global.net數據提供者for sqlserver'。 at System.IO._ Error.WinIOError(Int32 errorCode,String maybeFullPath) at System.Threading.Mutex。 <> c _DisplayClass3。 < .ctor> b__0(對象的UserData) 在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代碼,CleanupCode backoutCode,對象的UserData) 在System.Threading.Mutex..ctor(布爾initiallyOwned,字符串名稱,布爾& createdNew ,mutexSecurity mutexSecurity) 在System.Diagnostics.SharedUtils.EnterMutexWithoutGlobal(字符串mutexName,互斥&互斥) 在System.Diagnostics.SharedPerformanceCounter.Verify(CategoryEntry * currentCategoryPointer) 在System.Diagnostics.SharedPerformanceCounter.FindCategory(CategoryEntry ** returnCategoryPointerReference) at System.Diagnostics.SharedPerformanceCounter.GetCounter(String counterName,String instanceName,Boolean enableReuse,PerformanceCounterIns tanceLifetime壽命) 在System.Diagnostics.SharedPerformanceCounter..ctor(字符串catName,字符串counterName,字符串實例名,PerformanceCounterInstanceLifetime壽命) 在System.Diagnostics.PerformanceCounter.Initialize() 在System.Diagnostics.PerformanceCounter.set_RawValue(Int64的值) 在System.Data.ProviderBase.DbConnectionPoolCounters.Counter..ctor(字符串類別名稱,字符串實例名,字符串counterName,PerformanceCounterType counterType) 在System.Data.ProviderBase.DbConnectionPoolCounters..ctor(字符串類別名稱,字符串categoryHelp) 在系統。 Data.SqlClient.SqlPerformanceCounters..ctor() at System.Data.SqlClient.SqlPerformanceCounters..cctor() ---內部異常堆棧跟蹤結束--- at System.Data.SqlClient.SqlConnectionFactory..ctor() at System.Data.SqlClient.SqlConnectionFactory..cctor() ---內部異常堆棧跟蹤結束--- 在System.Data.SqlClient.SqlConnection ..cctor()

任何人都可以告訴我如何解決這個問題? :)

+0

看看這個異常是否有'InnerException'會很有趣。追逐類構造函數鏈,我可以看到唯一可能涉及性能計數器的嫌疑犯。 –

+0

*編輯*你的問題 - 不要嘗試在評論中放置複雜的項目(需要格式化)。 –

+0

我已經添加了內部異常的問題身體:) –

回答

0

通過SSMS添加訪客(安全登錄),然後將該帳戶添加到特定數據庫在服務器帳戶下。

相關問題