Skip to content

Reading application settings in NET WinForms OOP designer fails with exception 'Invalid URI: The hostname could not be parsed" #70318

@tracktownsoftware

Description

@tracktownsoftware

Environment

Version 17.2.2

.NET version

net6.0-windows

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

No, this is new in VS2022 and the NET WinForms OOP designer.

Issue description

This is an issue in the new NET WinForms designer when using the microsoft.winforms.designer.sdk to add design-time support to a custom NET6 WinForms control. Reading application settings at design-time fails with exception “Invalid URI: this hostname could not be parsed”.

I also reported this as feedback from VS2022:
https://developercommunity.visualstudio.com/t/Reading-application-settings-fails-in-th/10055004

Steps to reproduce

My github sample to reproduce:
https://github.com/tracktownsoftware/MicrosoftWinFormsDesignerSDK_AppSettingsBug

The above repository includes a Nuget package you can use to test and reproduce. The nuget package contains a custom NET6 WinForms "MyButton" control with WinForms Designer Extensibility SDK design-time support.

Diagnostics

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions