Изменение целевой среды

#visual-studio-2010 #visual-studio-express

#visual-studio-2010 #visual-studio-express

Вопрос:

В Visual Studio 2010 Express [VB.NET ], если я изменю целевую платформу через свойства приложения> компиляция> дополнительные параметры компиляции на framework 2.0 с 4.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
  

Ответ №1:

Попробуйте удалить ссылки в вашем проекте (проектах) на:

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

Они добавляются автоматически с помощью VS2010 express.

Вы можете сделать это, развернув дерево ссылок, выделив ссылку и нажав удалить.

Комментарии:

1. Спасибо, это работает. Не думал, что это будет так просто. Однако я все еще получаю предупреждение <Добавлено в основной пост, не поместилось>

2. Странно, я попытался сделать то же самое, что и до сих пор, но на этот раз ошибки были устранены. TYVM.

3. У меня была та же проблема, за исключением того, что она не отображалась в дереве ссылок. Мне пришлось зайти в раздел ссылки в свойствах проекта и снять флажок в разделе Импортированные пространства имен.