Page 1 of 1

Using Linq

Posted: Tue Mar 17, 2015 8:30 am
by ChrDressler
Hi,

I want to set a variable with Linq, e.g.

Code: Select all

x = DataSource1.Any(p => p.Id == 14 && p.Pos == 12);
In Report.ReferencedAssemblys, I added System.Linq, but the Report Checker says
"Could not load file or assembly 'System.Linq' or one of its dependencies."

What can I do?

-Christoph

Re: Using Linq

Posted: Tue Mar 17, 2015 9:46 am
by HighAley
Hello, Christoph.

Please, specify a name of the assembly file.

Code: Select all

System.Xml.Linq.dll
Thank you.

Re: Using Linq

Posted: Wed Mar 18, 2015 4:22 pm
by ChrDressler
unfortunately, the same error: :-(
Could not load file or assembly 'System.Xml.Linq.dll' or one of its dependencies.

-Christoph

Re: Using Linq

Posted: Thu Mar 19, 2015 6:01 am
by HighAley
Hello, Christoph.

Do you have the right version of the assembly?
Please, try to specify the full pass to it or copy to the project folder.

Thank you.

Re: Using Linq

Posted: Mon Mar 23, 2015 9:10 am
by ChrDressler
I can't specify the full path, because the report should run in customer's environment.
IF I copy the dll in the project folder, loading is succesfull, but this can't be the solution, because this dll is a part of .net. I dont' want to manage parts of .net in my project.

Re: Using Linq

Posted: Mon Mar 23, 2015 10:53 am
by HighAley
Hello.

Sorry, but we have no such issue.
On our machine the Linq assembly is loaded without any error.
Please, check if there is available an assembly for used .Net Framework version.

Thank you.

Re: Using Linq [Solved]

Posted: Mon Mar 23, 2015 12:21 pm
by ChrDressler
I solved my problem in a other way:

Code: Select all

x = DataSource1.GetDataTable().Select("Pos = 12 AND Id = 14").Length > 0;
-Christoph

Re: Using Linq

Posted: Mon Mar 23, 2015 6:22 pm
by Andrew
Hello,

Thank you for sharing your way of solving the issue.