Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing target framework

In Visual Studio 2010 Express [VB.NET], if I change the target framework via Application properties > compile > advanced compile options to framework 2.0 from 4.0, I get a list of errors:

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

I have searched around, yet, I can't seem to find an answer that I think would be of use to me. I am just using a blank project with nothing on it.


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
like image 884
Skeela87 Avatar asked May 10 '11 07:05

Skeela87


People also ask

How do I change my target framework to .NET standard?

In Visual Studio select Analyze and then Portability Analyzer Settings. In the General Settings window, select . NET Standard 2.0 under Target Platforms, and then choose OK.


1 Answers

Try removing the references in your project(s) to:

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

They are added automatically by VS2010 express.

You can do that by expanding the references tree, highlighting the reference and hitting delete.

like image 167
Matt Avatar answered Nov 10 '22 01:11

Matt