Transformation error when running a linq query

Discussion of issues, suggestions and bugs of LINQ Insight, Visual Studio add-in for design-time executing LINQ statements, that simplifies debugging LINQ
Post Reply
salama
Posts: 6
Joined: Sat 06 Jul 2013 08:00

Transformation error when running a linq query

Post by salama » Sat 06 Jul 2013 08:06

I placed a breakpoint after defining a linq query. When the breakpoint is hit and try to run the query, I get this error. Why am I getting an error if the code runs fine in Visual Studio?

Message: Transformation error:
Can't resolve member reference: xxx
Expression:
xxxx

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Transformation error when running a linq query

Post by MariiaI » Mon 08 Jul 2013 09:16

Please specify the following information:
- whether you are working with Visual Basic or C#;
- the full stack trace of the exception.

If it is a Visual Basic, then there is a known issue and it is related to the third-party libraries. We will inform you about the results as soon as any are available.

salama
Posts: 6
Joined: Sat 06 Jul 2013 08:00

Re: Transformation error when running a linq query

Post by salama » Tue 09 Jul 2013 07:55

It's C#

Message: Transformation error:
Can't resolve member reference: this._lsrRepository.Table
Expression:
from l in this._lsrRepository.Table
where l.ResourceName == resourceKey && l.LanguageId == languageId
select l.ResourceValue
Type: System.InvalidOperationException
Source: Devart.LinqInsight.Core
Site: #=qBzue6vynCzaI2letsnlaFA==
Stack Trace:
at #=qoMjb6ajp3NYxkFWDFAA8hHAzcp_jAxEFBZ21No$urEb4inIhoQZY_pqDhkUUF0FjtjYE6siMsREyKYiRU8RKSZkX4Ld5qRvtr4d3KZrMRl0=.#=qBzue6vynCzaI2letsnlaFA==(KnownLanguages #=q6zmwDpH3n25yMlT5WlrJKg==, SyntaxTree #=q7ebfcwjJMp0w0czl9m3jnQ==, AstNode #=qiwFcjQiQKC6D_PWIuj56vg==, TypeSystem #=qCAs15OliQtBpyqec3sX8lA==)
at #=qoMjb6ajp3NYxkFWDFAA8hHAzcp_jAxEFBZ21No$urEb4inIhoQZY_pqDhkUUF0FjtjYE6siMsREyKYiRU8RKSZkX4Ld5qRvtr4d3KZrMRl0=.#=qEKuC6BxrOT9Oi2uTn9T4lw==(IDebuggerIntegration #=qVjXa5k$reWzVkW8Va625Rw==, KnownLanguages #=qCAiUbqIsqjR$wchx6HCAyw==, SyntaxTree #=qM0bSDRDSKIcLCtji5S8vBA==, AstNode #=qzDiR56jbMDdju1lCKN8fLg==, TypeSystem #=qB6Tho2BMKRHcwwKur_Aegw==, Dictionary`2 #=qToPMGn_maPwJEkZKZBqW9Q==, List`1& #=qgbG1tLknC7D2$eQ6JI7fWg==, List`1& #=qJygwsETVpayZ1Id$tM_E7Q==)
at #=qVzpyih0YaJa$34sYGmRM4owZZ4PbPD41r6rGC969zqiQ3$X3viT_vucuiUUy7LR6wMR_vTgg9qRuSAvECbk58w==.#=qThGB7jGYaaz40JHLtoZQ6w==()
at #=qVzpyih0YaJa$34sYGmRM4owZZ4PbPD41r6rGC969zqiQ3$X3viT_vucuiUUy7LR6wMR_vTgg9qRuSAvECbk58w==.#=q9q2_vW5kYFf5kWDuTazhtA==()
at #=qVzpyih0YaJa$34sYGmRM4owZZ4PbPD41r6rGC969zqiQ3$X3viT_vucuiUUy7LR6wMR_vTgg9qRuSAvECbk58w==.#=q47qZotjDBVEaA9fQ_2l37PFCo1nABP8kVCKfarSfJ8M=.#=qUSprfuJEXkd4mp24LOMiMd_O00_Rt$a99rS_qxXKak8=()

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Transformation error when running a linq query

Post by MariiaI » Tue 09 Jul 2013 10:28

Please specify the definition of the "_lsrRepository".
Generally, LINQ Insight does not work with the class fields and properties, which are not static and are not of scalar types (int, string,etc.).
For example:

Code: Select all

 TestDataContext _dt; // TestDataContext is a class generated by Entity Developer tool using LinqConnect template
IQueryable<User> _users; // User is a class related to the TestDataContext class
int _count = 0;
The following LINQ query produces the Transformation error:

Code: Select all

var c = from l in this._users
               where l.Id == 1
               select l.StatusB;
The following LINQ query returns the correct results:

Code: Select all

var c = from l in this._dt.Users
               where l.Id == this._count
               select l.StatusB;

salama
Posts: 6
Joined: Sat 06 Jul 2013 08:00

Re: Transformation error when running a linq query

Post by salama » Wed 10 Jul 2013 06:49

It's IRepository<LocaleStringResource>. it's from an open source project called nopCommerce.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Transformation error when running a linq query

Post by MariiaI » Wed 10 Jul 2013 11:41

If the information and query samples mentioned above didn't help to resolve the issue, please send us a small test project, with which the issue could be reproduced, so that we are able to investigate it in more detailes and find the solution for you.

salama
Posts: 6
Joined: Sat 06 Jul 2013 08:00

Re: Transformation error when running a linq query

Post by salama » Wed 10 Jul 2013 16:26

MariiaI wrote:If the information and query samples mentioned above didn't help to resolve the issue, please send us a small test project, with which the issue could be reproduced, so that we are able to investigate it in more detailes and find the solution for you.
This is code written by someone else in an open source project. I am not planning to change code to make your profiler work. If you're interested to test it, you can download that project from codeplex and do your tests.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Transformation error when running a linq query

Post by MariiaI » Thu 11 Jul 2013 13:45

We will investigate this behaviour with LINQ Insight and the nopCommerce project and inform you about the results as soon as any are available.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Transformation error when running a linq query

Post by MariiaI » Mon 15 Jul 2013 14:08

We have made tests with the nopCommerce project and this is the expected behaviour. As we have said earlier, LINQ Insight couldn't resolve class fields and properties, which are not static and are not of scalar types. We are sending you a small test project to the e-mail address you have provided in your forum profile, which demonstrates a possible workaround.
Please check that the letter is not blocked by your mail filter.

yozey
Posts: 32
Joined: Sat 17 Jan 2009 14:41

Re: Transformation error when running a linq query

Post by yozey » Tue 14 Oct 2014 19:22

I am having a similar issue. Can you send to me a sample with the workaround?

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Transformation error when running a linq query

Post by MariiaI » Wed 15 Oct 2014 08:21

We are sending you a small test project to the e-mail address you have provided in your forum profile, which demonstrates a possible workaround.
Please check that the letter is not blocked by your mail filter.

sjhall27
Posts: 1
Joined: Tue 14 Jul 2015 16:49

Re: Transformation error when running a linq query

Post by sjhall27 » Tue 14 Jul 2015 16:51

Can I get the sample code as well? I would like to make this work in my own nopCommerce project.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Transformation error when running a linq query

Post by MariiaI » Wed 15 Jul 2015 05:46

We have contacted you by e-mail.

Post Reply