dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.37k stars 966 forks source link

wrong number conversion in structs (regional format related) #7153

Closed kirsan31 closed 2 years ago

kirsan31 commented 2 years ago

Environment

Microsoft Visual Studio Community 2022 Version 17.1.6 VisualStudio.17.Release/17.1.6+32421.90 Microsoft .NET Framework Version 4.8.04084

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA052 Microsoft Visual C++ 2022

ASP.NET and Web Tools 2019 17.1.363.30963 ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0 17.1.363.30963 Azure App Service Tools v3.0.0

C# Tools 4.1.0-5.22165.10+e555772db77ca828b02b4bd547c318387f11d01f C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

CodeRush for Roslyn 21.2.9.0 DevExpress CodeRush for Roslyn package.

CodeRush for Roslyn Tool Windows 21.2.9.0 DevExpress CodeRush for Roslyn Tool Windows package.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GhostDoc 22.1.22090.0 Generate XML Comments from your code, maintain clean and up-to-date documentation, produce help documentation in multiple formats, use intelligent source code Spell Checker in Visual Studio.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

NuGet Package Manager 6.1.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

PVS-Studio 7.16.55368.3293 PVS-Studio is a tool for bug detection in the source code of programs, written in C, C++, C# and Java. It works in Windows, Linux and macOS environment.

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TGit 1.0 Control TortoiseGit from within Visual Studio

Visual Basic Tools 4.1.0-5.22165.10+e555772db77ca828b02b4bd547c318387f11d01f Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.1.0-beta.21610.4+07b5673e4f2fa7630e78abe37f16b372353a7242 Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Color Theme Designer 1.0 Allows users to create and edit Visual Studio themes. Themes can customize colors used for menus, toolbars, tabs, titlebars, the text editor, and other environment colors.

Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

Visual Studio Spell Check Everywhere VSSpellCheckEverywhere An extension that enables spell checking within any Visual Studio file editor or tool window that uses WPF text boxes. https://GitHub.com/EWSoftware/VSSpellChecker

Visual Studio Spell Checker VSSpellChecker An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with tool windows. https://GitHub.com/EWSoftware/VSSpellChecker

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

.NET version

6.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

It's working in old .net framework designer.

Issue description

Can't edit struct properties (Size, Padding etc.) directly due to wrong values separator. See video from steps to reproduce. This error will appear:

486, 421 is not a valid value for Int32. (Parameter 'value')

New designer value separator is comma: net

Old designer value separator is semicolon: netfw

Steps to reproduce

V.S. language is English. Windows language is English. Region and regional format in windows settings - Ru.

https://user-images.githubusercontent.com/17767561/167297112-b7228dc7-6f15-4ff2-b487-e3a995e4561e.mp4

Diagnostics

[15:40:34.4058116] Sending request: TypeConverters/ConvertFrom
[15:40:34.4068120] TypeConverters/ConvertFrom took 00:00:00.0008453.
[15:40:34.4068120] REQUEST FAILURES: TypeConverters/ConvertFrom
                   Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: 486, 421 is not a valid value for Int32. (Parameter 'value') ---> Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Input string was not in a correct format.
                      --- End of inner exception stack trace ---
RussKie commented 2 years ago

Microsoft Visual Studio Community 2022 Version 17.1.6

I worked on several very similar issues, and those were fixed in 17.2.

May I get you to check the cli args for the DesignToolServer? In the fixed version VS passes the desired locale information to the server process. There were few iterations in this space, but we expect it to be something like: 3953-2

John-Qiao commented 2 years ago

@RussKie we have filed a designer issue for it, please check https://github.com/dotnet/winforms-designer/issues/4140.

kirsan31 commented 2 years ago

May I get you to check the cli args for the DesignToolServer? In the fixed version VS passes the desired locale information to the server process. There were few iterations in this space, but we expect it to be something like: 3953-2

image

So, it seems that the problem in something else...

RussKie commented 2 years ago

I think I may have found the problem, investigating a possible fix.

RussKie commented 2 years ago

The fix is expected to be available in 17.3p2.