-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor WebAssembly : "where" error in release mode #461
Comments
|
Thank you for your response1) I write this code : Freports = Freports.AsQueryable().Where(formula).OrderBy(x => x.PE).ToList();2) String (formula ) is : "(PE > 0.0) && (PE < 15.0 ) && (LST > 300.0)"3) exception in release mode: Operator 'and' incompatible with operand types 'Boolean' and 'Boolean'5) when run 'where' with just one statement like "(PE>0.0)" in release or debug mode system run correctly and no exception
please help me!Thanks' againSaeid On Saturday, November 21, 2020, 10:29:26 PM GMT+3:30, Zev Spitz <[email protected]> wrote:
- What does your code look like?
- What is your predicate? In other words, what string are you passing in to Where?
- What exception are you getting? Include the stack trace.
- What is the shape of the objects you are querying?
- Is it possible you are querying different objects in release mode?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
And you still haven't answered my previous question:
|
1)private List<SReport> Preports = new List<SReport>();
public class SReport { public int ACID { get; set; } public string Group { get; set; } public string Namad { get; set; } public string NameFa { get; set; } public int EPS { get; set; } public double PE { get; set; }....2) ToList3 public class
On Saturday, November 21, 2020, 10:59:27 PM GMT+3:30, Zev Spitz <[email protected]> wrote:
- What is the compile-time type of Freports? IEnumerable? IEnumerable<Freport>?
- What is at the ElementType property of Freports after the query, and before the ToList?
- What is the shape of that type? public class ...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
From what I can see, the syntax looks fine, and it should work in both Debug and Release mode.
Please try to use Markdown formatting for code and lists; it makes things much easier to read. |
1) public class SReport { public int ACID { get; set; } public string Group { get; set; } public string Namad { get; set; } public string NameFa { get; set; } public int EPS { get; set; } public double PE { get; set; } public double LST { get; set; }....2) No!3)private List<SReport> Freports = new List<SReport>();
On Saturday, November 21, 2020, 11:14:13 PM GMT+3:30, Zev Spitz <[email protected]> wrote:
From what I can see, the syntax looks fine, and it should work in both Debug and Release mode.
- I don't see the LST property/field in the definition you posted.
- Again, is it possible the query is being run against different objects in release mode?
- Are we talking about Preports? Or Freports?
Please try to use Markdown formatting for code and lists; it makes things much easier to read.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
This is the code I am using to try and reproduce your exception; it works in both Debug and Release mode: using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
var formula = "(PE > 0.0) && (PE < 15.0 ) && (LST > 300.0)";
var FReports = new List<SReport>();
FReports = FReports.AsQueryable().Where(formula).OrderBy(x => x.PE).ToList();
foreach (var x in FReports) {
Console.WriteLine(x);
}
public class SReport {
public double PE { get; set; }
public double LST { get; set; }
} Using:
I can't think of what else to try. |
My project create with webassambelyDotnetcore 3.1 Lasted version of dynamic LINQ2019 lasted version
Sent from Yahoo Mail on Android
On Sat, Nov 21, 2020 at 11:44 PM, Zev Spitz<[email protected]> wrote:
- What framework are you targeting?
- What version of Dynamic LINQ?
- Which version of Visual Studio are you using, if any? Or, if you're using another editor, please specify.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I've never used C# to generate WebAssembly. Can you post a sample project with code that reproduces this issue? |
Hi againI upload in Attachment very simple project.This sample work correctly in debug mode and generated error in release mode!Thanks
https://drive.google.com/file/d/1TDheadz092FgMvxOj7MYY5Rd8dq_2txP/view?usp=drivesdk
On Sunday, November 22, 2020, 12:39:26 AM GMT+3:30, Zev Spitz <[email protected]> wrote:
I've never used C# to generate WebAssembly. Can you post a sample project with code that reproduces this issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
HiI myself try to Solving the Problem in System.Linq.Dynamic.Core in release mode.I replace all '&&' with '&' and run My project in release mode.In this Time no Error reported and ran correctly!Why!!
On Sunday, November 22, 2020, 10:02:49 AM GMT+3:30, Saeid Asadi <[email protected]> wrote:
Hi againI upload in Attachment very simple project.This sample work correctly in debug mode and generated error in release mode!Thanks
https://drive.google.com/file/d/1TDheadz092FgMvxOj7MYY5Rd8dq_2txP/view?usp=drivesdk
On Sunday, November 22, 2020, 12:39:26 AM GMT+3:30, Zev Spitz <[email protected]> wrote:
I've never used C# to generate WebAssembly. Can you post a sample project with code that reproduces this issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
Hi againI upload in Attachment very simple project.This sample work correctly in debug mode and generated error in release mode!Thanks
https://drive.google.com/file/d/1TDheadz092FgMvxOj7MYY5Rd8dq_2txP/view?usp=drivesdk
On Sunday, November 22, 2020, 11:00:15 PM GMT+3:30, Zev Spitz <[email protected]> wrote:
I replace all '&&' with '&'
That may be a different operation; it's interpreted as a bitwise AND, and may produce different results.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
OK. I can confirm the following:
The following code also produces the same error only in Release mode, not in Debug mode: var prm = System.Linq.Expressions.Expression.Parameter(typeof(string));
var selector = "true && false";
var parser = new System.Linq.Dynamic.Core.Parser.ExpressionParser(new[] { prm }, selector, new object[] {}, System.Linq.Dynamic.Core.ParsingConfig.Default);
var expr = parser.Parse(null); |
Try the following:
I did this and now |
I try but not work
Sent from Yahoo Mail on Android
On Sun, Nov 22, 2020 at 11:31 PM, Zev Spitz<[email protected]> wrote:
Try the following:
- Close Visual Studio
- Delete the .vs folder in the root solution folder
- Delete all the bin and obj folders
- Reopen the solution
I did this and now && works in both Debug and Release mode.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hello @Saeidasadi32, See also this issue : #358 Your issue can be solved by adding this line to your Client WebAssembly project: <BlazorWebAssemblyEnableLinking>false</BlazorWebAssemblyEnableLinking> Or you can specify exactly what you want, see this link : https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/configure-linker?view=aspnetcore-3.1#control-linking-with-a-configuration-file I applied this also to my example project here: BlazorAppHandlebarsExample I probably have to add a Blazor WebAssembly section to the documentation to explain this scenario. |
Hi AgainThanks
It worked .
On Thursday, November 26, 2020, 07:19:21 PM GMT+3:30, Stef Heyenrath <[email protected]> wrote:
Hello @Saeidasadi32,
Your issue can be solved by adding this line to your Client WebAssembly project:
<BlazorWebAssemblyEnableLinking>false</BlazorWebAssemblyEnableLinking>
Or you can specify exactly what you want, see this link : https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/configure-linker?view=aspnetcore-3.1#control-linking-with-a-configuration-file
I applied this also to my example project here: BlazorAppHandlebarsExample
I probably have to add a Blazor WebAssembly section to the documentation to explain this scenario.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I use where with string parameter and run correctly in debug mode.
but when i use release mode system has generate error
The text was updated successfully, but these errors were encountered: