‘TypeConverter cannot convert from System.String.’ after upgrade to VS2019 #3726
Comments
rusanov-vladimir commented Oct 2, 2019 •
Steps to Reproduce
Following code doesn’t work after upgrading to VS2019.
- Use VisualStudio 2019 > 16.2
- Clone https://github.com/rusanov-vladimir/color-issue
- Set PG17.Droid as start project and run it. Click on the Letter envelope FAB.
Expected Behavior
See a toast saying «Everything works fine! Gratz!» both in VS 2019 and VS 2017 when using code above.
Actual Behavior
Behavior using VS 2019 16.3.1:
First issue that happens: System.NotSupportedException: ‘TypeConverter cannot convert from System.String.’ If conversion from string to System.Drawing.Color is performed in a different manner or replaced with some standard color next, probably related, issue that happen is: serialization and deserialization of object that contains System.Drawing.Color doesn’t work. Color after deserialization isn’t the same as it was before. It’s likely related to the fact that Json.Convert uses TypeDescriptor to get color converter.
Behavior using VS 2017 15.9.15:
Everything works and toast message is displayed.
ConsoleApplication targeting .net core 2.1 also works fine.
Version Information
Microsoft Visual Studio Professional 2019
Version 16.3.1
VisualStudio.16.Release/16.3.1+29324.140
Microsoft .NET Framework
Version 4.7.03062
Installed Version: Professional
Application Insights Tools for Visual Studio Package 9.1.00913.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2019 16.3.283.64955
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019 16.3.283.64955
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.3.283.64955
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 16.3.283.64955
Azure Functions and Web Jobs Tools
C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 — v2.9.20816.1
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.0.83+gbc8a4b23ec
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Mono Debugging for Visual Studio 16.3.7 (9d260c5)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 5.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Open Command Line 2.4.226
2.4.226
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
SQL Server Data Tools 16.0.61908.27190
Microsoft SQL Server Data Tools
TypeScript Tools 16.0.10821.2002
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
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 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
Xamarin 16.3.0.274 (d16-3@06531f8)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.3.0.230 (remotes/origin/d16-3-xcode11@bbe518670)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.3.565 (27e9746)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.iOS and Xamarin.Mac SDK 13.2.0.42 (5e8a208)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
The text was updated successfully, but these errors were encountered:
Источник
Cannot convert from ‘string[]’ to ‘string’ ошибка
Здравствуйте!
Прошу прощения за может совсем глупый вопрос, но я совсем начинающий))
Пытаюсь сделать следующее: найти все файлы в подкаталогах, затем сформировать список, затем добавить эти файлы в список построчно.
И вот как раз на последней строке выдает ошибку по несовпадению форматов стринга.
Скажите, пожалуйста, как правильно сконвертить эти файлы в массив
Ошибки: Cannot implicitly convert type ‘string’ to ‘int’ и Argument 1: cannot convert from ‘int’ to ‘string’
youtube.com_Пишем парсер на Csharp. Ошибка Пытаюсь написать парсер. Вроде сделал всё как в.
Ошибка десериализации JSON: ArgumentException: Could not cast or convert from Int64 to Dictionary`2[Object, String]
Всем доброго времени суток. Вообщем проблема следующая, имеется вот такой код, который выступает в.
Implicitly convert type ‘string’ to ‘System.Collections.Generic.IEnumerable
Добрый вечер, подскажите пожалуйста, как решить данную проблему? имеется действие, которые.
Type mismatch: cannot convert from String to String[]
Подчеркивает «inn.nextLine()» в 17 строке и пишет — «Type mismatch: cannot convert from String to.
ld — уже массив, не надо в нем искать
Добавлено через 1 минуту
И перебор не нужен, если добавляете в список массив
Добавлено через 56 секунд
Ошибка Cannot convert std::string to void*
Не могу сконвертировать строку в void*: std::string str; (void*)str; Вернее invalid cast from.
ошибка error: cannot convert ‘std::string
Нельзя преобразовать тип Tuple к string
Здравствуйте, у меня возникла проблема. При запуске кода, вылезает ошибка «Нельзя преобразовать тип.
Invoke-Expression : Cannot convert ‘System.String[]’ to the type ‘System.String’
Подскажите как выполнить C# вставку получая её из реестра Я пробовал так: iex((Get-ItemProperty.
Источник