Page 1 of 1

Error when adding Linq

Posted: Mon Feb 08, 2010 10:56 pm
by jlowder
Hello,

I have .Net version 3.5 SP1 installed and Ranorex version 2.2.1.7599.

I added the system.data.linq reference to references, and added the following using statements to my source file:

using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;

When I build the project I receive several errors:

Could not resolve assembly System.Data.Linq. The target framework required by this assembly (3.5) is higher than the project target framework. If this reference is required by your code, you may get compilation errors. (MSB3251)

The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) (CS0234) - C:\QA\RanorexAutomation\Gen2\SourceExtract\SourceExtract\Filter.cs:15,19

The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) (CS0234) - C:\QA\RanorexAutomation\Gen2\SourceExtract\SourceExtract\Filter.cs:16,19

The last two errors are referencing the last two using statements.

How do I go about supporting use of Linq in my project?

Thanks,

Jason

Re: Error when adding Linq

Posted: Tue Feb 09, 2010 9:23 am
by Support Team
Did you add references for those namespaces, e.g. a reference to the .NET Framework DLL System.Core? If not, please add the required references.

And if you want to use .NET Framework 3.5 features, change the "Target Framework" in the project settings -> Compiling tab to the desired framework version (see screenshot below).

More information can be found on the MSDN website: http://msdn.microsoft.com/en-us/library/bb546156.aspx

Regards,
Alex
Ranorex Support Team

Re: Error when adding Linq

Posted: Tue Feb 09, 2010 2:30 pm
by jlowder
Support Team wrote:Did you add references for those namespaces, e.g. a reference to the .NET Framework DLL System.Core? If not, please add the required references.

And if you want to use .NET Framework 3.5 features, change the "Target Framework" in the project settings -> Compiling tab to the desired framework version (see screenshot below).

More information can be found on the MSDN website: http://msdn.microsoft.com/en-us/library/bb546156.aspx

Regards,
Alex
Ranorex Support Team
I only had System. After the changes, the project compiles just fine. Thank you.

Re: Error when adding Linq

Posted: Thu Mar 29, 2012 9:16 pm
by omayer
Hi Alex,
Is any doc or userguide for the options that are available in project > project options , i can barely understand these features or selection.
Thank you,
Beginner

Re: Error when adding Linq

Posted: Thu Mar 29, 2012 9:22 pm
by omayer
now i am getting version conflict warning when changed traget from .NET 2.0 to .NET3.5, plz advice
Thanx
Beginner
versionConflict.jpg

Re: Error when adding Linq

Posted: Fri Mar 30, 2012 12:45 pm
by Support Team
Hi,

It seems that you are referencing to assemblies/projects which are build with another .Net version.
Therefore please check if all used assemblies/projects are built with the .Net 3.5 framework.
Please take also a look at the following links:
link1
link2
Is any doc or userguide for the options that are available in project > project options , i can barely understand these features or
Unfortunately not because these options are not Ranorex specific ones, these are standard project settings.
Do you have a specific question about a specific option?

Regards,
Markus
Ranorex Support Team

Re: Error when adding Linq

Posted: Fri Mar 30, 2012 5:03 pm
by omayer
My project built on .NEt 2.0, how will i change from 2.0 to 3.5 and compile it, when i changed to 3.5 i got build error

Re: Error when adding Linq

Posted: Tue Apr 03, 2012 11:46 am
by Support Team
Hi,

please provide us the error you got during build process by setting the target framework to 3.5.
Without having any further information about the error you are running into, it's not possible to help you solving your issues.

Regards,
Tobias
Ranorex Team

Re: Error when adding Linq

Posted: Thu Apr 05, 2012 7:46 pm
by omayer
here is the error i am getting - Found conflicts between different versions of the same dependent assembly. (MSB3247)

Re: Error when adding Linq

Posted: Fri Apr 06, 2012 12:13 pm
by Support Team
Hi,

therefore please have a look at the links Markus provided to you in his last post.

Regards,
Tobias
Ranorex Team