2011-05-10 70 views
8

在Visual Studio 2010速成[VB.NET],如果我通過應用程序屬性更改目標框架> 4.0編譯>高級編譯選項框架2.0,我得到的錯誤列表:改變目標框架

Warning 5 The referenced component 'System.Xml.Linq' could not be found. 
Warning 6 The referenced component 'System.Data.DataSetExtensions' could not be found.  
Warning 4 The referenced component 'System.Core' could not be found. 
Warning 2 The primary reference "System.Xml.Linq", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "System.Xml.Linq" or retarget your application to a framework version which contains "System.Xml.Linq". WindowsApplication3 
Warning 3 The primary reference "System.Data.DataSetExtensions", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "System.Data.DataSetExtensions" or retarget your application to a framework version which contains "System.Data.DataSetExtensions". WindowsApplication3 
Warning 1 The primary reference "System.Core", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "System.Core" or retarget your application to a framework version which contains "System.Core". WindowsApplication3 
Warning 7 Namespace or type specified in the project-level Imports 'System.Xml.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. WindowsApplication3 
Warning 8 Namespace or type specified in the project-level Imports 'System.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. WindowsApplication3 

我已經搜索過,但我似乎無法找到我認爲對我有用的答案。我只是使用一個沒有任何內容的空白項目。


Warning 1 Namespace or type specified in the project-level Imports 'System.Xml.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. WindowsApplication3 
Warning 2 Namespace or type specified in the project-level Imports 'System.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. WindowsApplication3 

回答

8

嘗試在您的項目(S)移除的引用:

System.Xml.Linq 
System.Data.DataSetExtensions 
System.Core 

它們是由VS2010自動添加表達。

您可以通過展開引用樹,突出顯示引用並按下刪除來實現此目的。

+0

啊謝謝,這是有效的。沒想到會那麼簡單。不過,我仍然收到警告\t <添加到主帖,無法適用> – Skeela87 2011-05-10 07:52:51

+1

嘗試刪除代碼中的「導入」到這些名稱空間。 – Matt 2011-05-10 08:02:18

+0

奇怪的是,我試着做到與我迄今一模一樣,但這次刪除了錯誤。 TYVM。 – Skeela87 2011-05-10 08:10:53