VS2010不能編譯SQLServer2005的Microsoft.SQLServer.ManagedDTS.dll的解決方法

VS2010不能編譯SQLServer2005的Microsoft.SQLServer.ManagedDTS.dll是最近碰到的一個疑難雜症問題,通過查詢微軟社區和一些英文資料找到了解決方法,同事說之前沒有找到中文的,就整理了放在這裏。

現象

項目裏需要使用程序創建SSIS包,結果在VS2010裏可以添加Microsoft.SQLServer.ManagedDTS.dll引用,寫代碼也有智能提示,但是一編譯就告訴你引用不正確。有個警告裏提示“warning MSB3258: The primary reference "Microsoft.SQLServer.ManagedDTS, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "2.0.3600.0" than the version "2.0.0.0" in the current target framework.

原因

根據微軟社區和一些英文資料介紹,這是微軟的一個bug,原因爲Microsoft.SQLServer.msxml6_interop.dll引用了.net framework 2.0 的beta版。

解決方法

2.打開 C:\Program Files\Program Files\Microsoft SQL Server\90\DTS\Binn,覆蓋Microsoft.SQLServer.msxml6_interop.dll.
3.強制更新GAC裏的dll文件。啓動命令行:拷貝以下命令執行:
SUBST x: c:\windows\assembly\GAC_MSIL\Microsoft.SqlServer.msxml6_interop\6.0.0.0__89845dcd8080cc91
4.系統多一個X盤,點開X盤,覆蓋Microsoft.SQLServer.msxml6_interop.dll.
5.subst x: /d 刪除X盤。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章