WineHQ
Wine Forums

Board index » WineHQ » Wine Help » Linux




 Page 1 of 1 [ 4 posts ] 



 
Author Message
 Post subject: .net double misbehaves
 Post Posted: Fri Mar 15, 2019 9:53 am 
Offline
Newbie
Newbie

Joined: Fri Mar 15, 2019 9:44 am
Posts: 3
I'm the author/developer of an Inventory program that's been available on Windows for around 20 years.

I was curious about how easy it would be to make the application work on Wine/Linux. It works surprisingly well. :D

But I'm curious about one thing. See the following code. .Net application written in C#.

Code:
double d = 0;
string s = ""; // Create an empty string.

if (double.TryParse(s, out d) == true)
        MessageBox.Show( d.ToString() );



That code should not display the messagebox. TryParse should not successfully parse an empty string.
But when running on Wine/Mint tryparse of an empty string returns true and the messagebox shows an empty string showing the d (the double) is empty. :evil:

What is d? Is it corrupt? It's not a number. What is it?

Thanks


Top 
 Post Posted: Sat Mar 16, 2019 4:06 am 
Offline
Newbie
Newbie

Joined: Fri Mar 15, 2019 9:44 am
Posts: 3
Just wanted to add the the problem only occurs when running on MS.Net in Wine (Linux Mint 19.1)

If I run on Mono (without wine) there is no problem.


Top 
 Post Posted: Sat Mar 16, 2019 9:46 am 
Offline
Level 7
Level 7

Joined: Thu Aug 27, 2009 6:23 am
Posts: 822
I'm assuming that you used winetricks to install .NET in wine. Which .NET version did you install?

Anyways, you quite probably triggered a bug in wine. Maybe the empty string is a special border case. Please file a bug report and provide a small sample application.


Top 
 Post Posted: Sun Mar 17, 2019 9:53 am 
Offline
Level 7
Level 7
User avatar

Joined: Tue Nov 22, 2016 5:39 pm
Posts: 845
There is a bug report now, see Bug 46842 - C# double.TryParse( String.Empty, out number) succeeds with .NET Framework 4.0 when it should not

@OP: Please link the bug report in the future.


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 4 posts ] 




Board index » WineHQ » Wine Help » Linux


Who is online

Users browsing this forum: No registered users and 12 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: