Page 1 of 1
Transformation error when running a linq query
Posted: Sat 06 Jul 2013 08:06
by salama
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
Re: Transformation error when running a linq query
Posted: Mon 08 Jul 2013 09:16
by MariiaI
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.
Re: Transformation error when running a linq query
Posted: Tue 09 Jul 2013 07:55
by salama
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=()
Re: Transformation error when running a linq query
Posted: Tue 09 Jul 2013 10:28
by MariiaI
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;
Re: Transformation error when running a linq query
Posted: Wed 10 Jul 2013 06:49
by salama
It's IRepository<LocaleStringResource>. it's from an open source project called nopCommerce.
Re: Transformation error when running a linq query
Posted: Wed 10 Jul 2013 11:41
by MariiaI
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.
Re: Transformation error when running a linq query
Posted: Wed 10 Jul 2013 16:26
by salama
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.
Re: Transformation error when running a linq query
Posted: Thu 11 Jul 2013 13:45
by MariiaI
We will investigate this behaviour with LINQ Insight and the nopCommerce project and inform you about the results as soon as any are available.
Re: Transformation error when running a linq query
Posted: Mon 15 Jul 2013 14:08
by MariiaI
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.
Re: Transformation error when running a linq query
Posted: Tue 14 Oct 2014 19:22
by yozey
I am having a similar issue. Can you send to me a sample with the workaround?
Re: Transformation error when running a linq query
Posted: Wed 15 Oct 2014 08:21
by MariiaI
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.
Re: Transformation error when running a linq query
Posted: Tue 14 Jul 2015 16:51
by sjhall27
Can I get the sample code as well? I would like to make this work in my own nopCommerce project.
Re: Transformation error when running a linq query
Posted: Wed 15 Jul 2015 05:46
by MariiaI
We have contacted you by e-mail.