2010-09-20 76 views
0

我試圖在我的服務器上運行測試,但它由於一些C++錯誤來自MSVCR80.dll失敗。在我的機器上它運行平穩,但在服務器上,我找不到使其工作的方法。MSVCR80.dll使用Microsoft.SqlServer.Management C++失敗

這是運行我的測試時,我有錯誤(抱歉它是在意大利,但它可以很容易理解的,我想,每個人都講意大利語,不是嗎?):

Class Initialization method Test.Quartz.GestioneQuartzTest.MyClassInitialize threw exception. System.Reflection.TargetInvocationException: System.Reflection.TargetInvocationException: Eccezione generata dalla destinazione di una chiamata. 
---> System.TypeInitializationException: L'inizializzatore di tipo di '<Module>' ha generato un'eccezione. 
---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load during appdomain initialization. 
---> System.DllNotFoundException: Impossibile caricare la DLL 'MSVCR80.dll': Routine di inizializzazione della libreria di collegamento dinamico (DLL) non riuscita. (Eccezione da HRESULT: 0x8007045A).. 

和堆棧跟蹤:

_encode_pointer(Void*) 
_initatexit_app_domain() 
LanguageSupport.InitializePerAppDomain(LanguageSupport*) 
LanguageSupport._Initialize(LanguageSupport*) 
LanguageSupport.Initialize(LanguageSupport*) 
ThrowModuleLoadException(String errorMessage, Exception innerException) 
ThrowModuleLoadException(String , Exception) 
LanguageSupport.Initialize(LanguageSupport*) 
cctor() 
Microsoft.SqlServer.Management.Common.ExecuteBatch.GetStatements(String sqlCommand) 
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) 
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) 
System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) 
Microsoft.SqlServer.Management.Common.ServerConnection.GetStatements(String query, ExecutionTypes executionType, Int32& statementsToReverse) 
Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType) 
Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand) 
Test.DataBaseHelper.ExecuteScriptFile(String RessourceName) in C:\CoreTest\TestHelper\DataBaseHelper.cs: line 35 
Test.Quartz.GestioneQuartzTest.MyClassInitialize(TestContext testContext) in C:\CoreTest\Quartz\GestioneQuartzTest.cs: line 62 

我已經嘗試下載DLL MSVCR80並將其放在Windows/System32上,但它沒有幫助。有人以前曾經遇到過這個問題嗎?

Thx尋求幫助。

[編輯]

在調試一個測試,錯誤發生在那裏(2號線):

Microsoft.SqlServer.Management.Smo.Server server = new Microsoft.SqlServer.Management.Smo.Server(svrConnection); 
return server.ConnectionContext.ExecuteNonQuery(scriptText); 

腳本文本包含我用它來創建或刪除我的表來執行我的測試代碼在與生產類似的環境中。

[/編輯]

+0

http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/6d16ecce-f92b-4c53-a45b-40119c4566a6/ – DumbCoder 2010-09-20 08:42:47

+0

thx爲鏈接,但我認爲我的問題更依賴於一些微軟產品安裝不當。它來自「Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery」,它是來自Microsoft的一些內部代碼行。 – Arthis 2010-09-20 08:53:08

回答

0

而不只是下載一個DLL(可能缺少其他的依賴),你嘗試下載和安裝Microsoft Visual C++ 2005 SP1 Redistributable

編輯,至於在Visual Studio中運行你的解決方案: 那麼,錯誤的位置已經很明顯,給出了堆棧跟蹤。由於這是加載本地DLL的錯誤,因此我在談論更多關於運行WinDBG的知識,在這種情況下,它可能會提供有關什麼被加載以及它失敗的原因的更好信息。從異常代碼和失敗的方式來判斷(可能在DllMain期間,即LoadLibrary),我想這是一個缺失的依賴關係。在這種情況下,WinDbg或DependencyWalker都可以幫助你,但是對於DependencyWalker,你必須知道在哪裏看,也就是要分析哪個模塊。

+0

不!它沒有工作...... Thx都一樣! – Arthis 2010-09-20 08:46:58

+0

你可以在該機器上運行調試器嗎? – 2010-09-20 08:57:14

+0

感謝您的精度。我會看看我能做什麼,而不是那個領域的專家...... – Arthis 2010-09-20 09:34:46