最近將公司裡其中一台電腦安裝了 Visual Studio 2012 RC,結果在第一次開啟 Visual Studio 2012 RC 的時候卻出現了一連串〔未正確載入套件〕的錯誤,我接著依照先前的文章〔如何在 Visual Studio 2010 發生錯誤時進行問題分析與解決〕所提到的方法進一步追蹤,這才發現原來都是 SQL Server 相關工具沒有正確安裝所導致,這可能跟此電腦之前安裝過太多 Beta 版開發工具的關係,接下來就是解決這次問題的過程與筆記。
首先,我們先來看看發生了哪些錯誤:
以下是在 ActivityLog.xml 檔案中所有的錯誤紀錄:
<entry>
<record>638</record>
<time>2012/07/08 07:46:00.129</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for packageSetSite failed for package</description>
<guid>{ED19932F-5443-4587-A005-1CB9158B2F64}</guid>
<hr>80131534</hr>
<errorinfo>'SqlSchemaModelStaticState' 的型別初始設定式發生例外狀況。</errorinfo>
</entry>
<entry>
<record>639</record>
<time>2012/07/08 07:46:00.160</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package loadEnd package load</description>
<guid>{ED19932F-5443-4587-A005-1CB9158B2F64}</guid>
<hr>80131534</hr>
<errorinfo>'SqlSchemaModelStaticState' 的型別初始設定式發生例外狀況。</errorinfo>
</entry>
<entry>
<record>645</record>
<time>2012/07/08 07:47:45.635</time>
<type>Error</type>
<source>VisualStudio</source>
<description>CreateInstance failed for packageCreateInstance failed for package</description>
<guid>{00A9524F-427F-46EE-8A20-615C25ECBE6F}</guid>
<hr>80070002</hr>
<errorinfo>Could not load file or assembly 'Microsoft.Data.Tools.Utilities, Version=10.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 系統找不到指定的檔案。</errorinfo>
</entry>
<entry>
<record>646</record>
<time>2012/07/08 07:47:45.635</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package loadEnd package load</description>
<guid>{00A9524F-427F-46EE-8A20-615C25ECBE6F}</guid>
<hr>80004005 - E_FAIL</hr>
<errorinfo>Could not load file or assembly 'Microsoft.Data.Tools.Utilities, Version=10.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 系統找不到指定的檔案。</errorinfo>
</entry>
<entry>
<record>670</record>
<time>2012/07/08 07:47:58.043</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for packageSetSite failed for package</description>
<guid>{FEF13793-C947-4FB1-B864-C9F0BE9D9CF6}</guid>
<hr>80070002</hr>
<errorinfo>Could not load file or assembly 'Microsoft.Data.Tools.Utilities, Version=10.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 系統找不到指定的檔案。</errorinfo>
</entry>
<entry>
<record>671</record>
<time>2012/07/08 07:47:58.074</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package loadEnd package load</description>
<guid>{FEF13793-C947-4FB1-B864-C9F0BE9D9CF6}</guid>
<hr>80070002</hr>
<errorinfo>Could not load file or assembly 'Microsoft.Data.Tools.Utilities, Version=10.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 系統找不到指定的檔案。</errorinfo>
</entry>
解決方法很簡單,只要安裝 Microsoft SQL Server 2012 Express Management Studio 即可解決!
註:安裝企業版或開發版的 SQL Server 2012 Management Studio 也可以。
發生原因:不詳!
相關連結