Error when adding Linq

Ask general questions here.
jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

Error when adding Linq

Post by jlowder » Mon Feb 08, 2010 10:56 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Error when adding Linq

Post by Support Team » Tue Feb 09, 2010 9:23 am

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
Attachments
ProjectSettings.png
The "Compiling" tab in the project settings
ProjectSettings.png (15.29 KiB) Viewed 3470 times
.
Image

jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

Re: Error when adding Linq

Post by jlowder » Tue Feb 09, 2010 2:30 pm

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.

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Error when adding Linq

Post by omayer » Thu Mar 29, 2012 9:16 pm

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
Tipu

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Error when adding Linq

Post by omayer » Thu Mar 29, 2012 9:22 pm

now i am getting version conflict warning when changed traget from .NET 2.0 to .NET3.5, plz advice
Thanx
Beginner
versionConflict.jpg
versionConflict.jpg (50.74 KiB) Viewed 3121 times
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Error when adding Linq

Post by Support Team » Fri Mar 30, 2012 12:45 pm

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
.
Image

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Error when adding Linq

Post by omayer » Fri Mar 30, 2012 5:03 pm

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
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Error when adding Linq

Post by Support Team » Tue Apr 03, 2012 11:46 am

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
.
Image

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Error when adding Linq

Post by omayer » Thu Apr 05, 2012 7:46 pm

here is the error i am getting - Found conflicts between different versions of the same dependent assembly. (MSB3247)
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Error when adding Linq

Post by Support Team » Fri Apr 06, 2012 12:13 pm

Hi,

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

Regards,
Tobias
Ranorex Team
.
Image