-
Jan 21st, 2022, 08:27 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Application Settings Bindings to a Control Missing.
I created a new project in my new VS 2022 and chose .NET 5. But when I popped a TextBox control into the form and tried to bind it to an app setting, there's none in the property explorer tree. I went to the project Settings tab and it was blank saying the project didn't have an application settings file yet. But it offered to create it for me if I clicked. I did, but there still isn't anywhere for it in the property tree. Any ideas?
-
Jan 21st, 2022, 09:45 PM
#2
Re: Application Settings Bindings to a Control Missing.
WinForms has been reimplemented for .NET Core. Not all features have been reimplemented yet and some never will. That feature simply doesn't exist for .NET Core projects. Note that .NET 5 and later are based on .NET Core, not .NET Framework. If you want that feature then target .NET Framework. Otherwise, you'll have to implement that binding manually, rather than in the designer. You can create a test project that targets .NET Framework 4.8, set up a binding that way and see what code it generates, then write similar code yourself in your .NET 5 project.
You should note that .NET 5 goes out of support very soon so, if you're not going to target .NET Framework, you should be targeting .NET 6. .NET Framework 4.8 will be in support for some time to come.
-
Jan 22nd, 2022, 02:07 PM
#3
Thread Starter
Frenzied Member
Re: Application Settings Bindings to a Control Missing.
As usual you have the perfect answer. Thank you.
One follow up question though. When I select the framework when creating a project, .NET 4.8 isn't an option. How do I add it?
-
Jan 22nd, 2022, 09:15 PM
#4
Re: Application Settings Bindings to a Control Missing.
If you have already created a .NET Core project then you can only specify versions of .NET Core to target. If you want to target .NET Framework then you have to create a .NET Framework project in the first place. In VS 2022, project templates that target .NET Framework will specifically say so in the name. Those that don't specify .NET Framework will target .NET Core, which includes .NET 5+
-
Jan 23rd, 2022, 12:37 PM
#5
Thread Starter
Frenzied Member
Re: Application Settings Bindings to a Control Missing.
I see. I am starting a new project from scratch but I don't see anything that's not Core.
Is there someplace I can install it?
-
Jan 23rd, 2022, 07:29 PM
#6
Re: Application Settings Bindings to a Control Missing.
Originally Posted by cory_jackson
I see. I am starting a new project from scratch but I don't see anything that's not Core.
Is there someplace I can install it?
It's already too late when you get to that step. As I already said, you have to select a project template that specifies that it targets .NET Framework, which you do two steps earlier. If you get to the step you show in that screenshot then you have already failed to do that. In the step that selects a project template, try typing "framework" into the filter field.
-
Jan 24th, 2022, 12:51 PM
#7
Thread Starter
Frenzied Member
Re: Application Settings Bindings to a Control Missing.
I see. I was selecting recently used WinForm project and didn't realize the Core limitation was part of that. I got it now. Thanks for yoru patience.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|