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版。
解決方法
1.下載附件
Microsoft.SQLServer.msxml6_interop.dll.zip
,解壓
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盤。
參考1: Visual Studio 2010 cannot reference ManagedDTS dll from SQL Server 2005
參考2:
Microsoft.SqlServer.msxml6_interop.dll causes VS2010 cannot compile
?
VS2010不能編譯SQLServer2005的Microsoft.SQLServer.ManagedDTS.dll的解決方法
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
