0

I use Sql Server compact database, and my linq query work properly in debug mode, but it has error in release mode ! My query use "join" and the exception is:

The method ' [My_Project_Namespace.MyTransactions,My_Project_Namespace.Users]. ' is not a property accessor

Here is my LINQ query:

var result = from transRow in db.MyTransactions
             join userRow in db.Users on transRow.User_id equals userRow.Id
             join clientRow in db.Clients on 
                transRow.Client_id equals clientRow.Id
             select new
             {
                 userId = transRow.User_id,
                 clientId = transRow.Client_id,
                 userName = userRow.Fname + " " + userRow.Lname,
                 clientName = clientRow.Fname + " " + clientRow.Lname,
                 reg_date = transRow.Reg_date,
                 value = transRow.Value
             };

My aim is add (or replace) the user id with his name and also the client id with his name.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Majid
  • 3,128
  • 1
  • 26
  • 31
  • Are you sure your project is building correctly? Everything ticked in the Build -> Configuration Manager? – spender Mar 29 '11 at 15:07
  • Possibly related: http://stackoverflow.com/questions/4043821/performance-differences-between-debug-and-release-builds – Roly Mar 29 '11 at 15:46

2 Answers2

2

as Oleksiy Gapotchenko (Eazfuscator.NET Developer) said here
you need to add this on the assembly level:

[assembly: Obfuscation(Feature = "anonymous type properties renaming", Exclude = true)] 

then, all of your anonymous method and types won't be obfuscated, and (probably) will work....

itsho
  • 4,640
  • 3
  • 46
  • 68
0

I found out that's because of using some obfuscators like "Eazfuscator.NET". but it will work with some other obfuscators like "Babel" !

Majid
  • 3,128
  • 1
  • 26
  • 31