question

JohnSimon-6835 avatar image
0 Votes"
JohnSimon-6835 asked AlbertKallal-4360 edited

Visual Studio 2022 Community cintrols greyed out

I installed Visual Studio 2022 Community a few weeks ago and was off to a decent start. Then I went to add a button to my form and the button object is greyed out. I cant drag it to my form. In fact all ibject in the toolbox are greyed out

My questions are:

1). Why are they all greyed out?
2). And more importantly how do I fix it?

I am only writing apps to practice different methods and to get comfortable with the IDE.
I thought that was what the Community version was for?

What am I missing?

vs-generaldotnet-aspnet-webforms
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Did you open the form by double-clicking in Solution Explorer?

Did you also test a new Forms project?

0 Votes 0 ·

Yes and yes.

I thought it was the project and created a new one. Same thing. I can copy and paste buttons on an existing form, just not add then in a new project.

Does Visual Studio require INTERNET access? The computer is not normally connected.

Ive tried VB, C# and ASP projects all with the same result.

Any help would be appreciated.

It worked fine for about two weeks and then it was all greyed out.

Frustrating.

0 Votes 0 ·
AlbertKallal-4360 avatar image
0 Votes"
AlbertKallal-4360 answered

I can copy and paste buttons on an existing form, just not add then in a new project.

Ok, so it DOES work for a existing project you have. But in a 100% DIFFERENT project, then you are finding things work different!

This VERY much suggests that you creating a different kind of project, and thus you get/see a different experience.

One of the challenges with visual Studio? Well, it is a BEYOND amazing system, but that beyond amazing comes with a price! You can create windows software. You can create a command line text only project (console).

So, Visual Studio is the MOST amazing Swiss Army knife - it can do almost ANYTHING!!!

You can create phone applications.
You can create .net core applications.
You can create asp.net .net framework (MVC)
You can create asp.net framework web forms (Webforms).
You can create add-ins for Office.

And more!!!

So, it can be quite a challenge to pick and create the correct kind of project here.

To be fair, vs2019, and now 2022? They done a fantastic job of when you hit new project, you are now entering the lobby of choices - about as many as there are flavors of ice cream!! - it is truly amazing!!!

Note:
I have not installed vs2022 as of yet (dragging my feet - I have some concerns about some of my x32 bit software, and vs2022 is the FIRST version that is x64 bits.). I will soon, but vs2019 vs 2022 should not really feel much different.

So, file->new project.

I suggest then you use the filter (drop downs) on the right side.

For my taste today, that means I will choose Visual Basic, Windows, Web.

You now should see this:

235493-image.png

As I noted, a bloatload of choices - VERY easy to pick/choose the wrong one!!!

So, from above, next

Note that the defaults should be ok, but take VERY close attention to the .net frame work you choose here.

So, this:

235470-image.png

Now then this:

235476-image.png

Now, I have circled some options. So, I in general don't develop with https, and set that up on the actual web server at deploy time.

Also, in above, I did not want a site with logons. Do feel free to select this item if you goal is a web site with logons, but for this testing - and trying? I suggest you turn off both https, and choose no logons ("No authentication").

You can also choose a empty web site - but it rather bare bones, and that assumes you are quite up to speed in setting up things like bootstrap, jquery, and a main menu bar (master page) etc. That can be a lot of work, so working template as I show above is about the best choice.

But, you could choose the "empty" site if you looking to JUST try + test a web page.

Ok, so with above, we hit create, and we now have this:

A simple site with a few pages, a master page (with menu bar), like this:

235512-image.png

So, we can open one of the existing pages, or create our own new page.

Lets add a new page to the project - like always, then right click on the top project, and choose add -> new item.

Like this: (right click where the arrow I put), so then this:

235483-image.png

So, now we get a list of choices of what to add to the project like this:

235369-image.png

The default name of WebForm1 is just fine.

And now we have this:

(I will drag a button from tool box to the form).

235420-image.png

so, try creating a new project, follow above. This should result in a working project, and one with web forms that you can drag + drop controls from the toolbox to the web form.

Regards,
Albert D. Kallal (Access MVP 2003-2017)
Edmonton, Alberta Canada





image.png (53.8 KiB)
image.png (27.8 KiB)
image.png (42.5 KiB)
image.png (37.8 KiB)
image.png (93.2 KiB)
image.png (54.1 KiB)
image.png (22.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JohnSimon-6835 avatar image
0 Votes"
JohnSimon-6835 answered AlbertKallal-4360 edited

First off I would like to clarify. When I open an existing ptiject all the tools in the toolbox are greyed out. If I want to add a button I have to cooy/paste an existing button (or other control).

VS 2022 does not give the option for .net 4.8. Only .net 6.0.

I have approximated your instructions and regradless what I choose all contols in the toolbox are greyed out.

I am uninstalling this software now. If it doesnt work, why have it installed?

Thank you for trying.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


If the problem persists, you can publish a reduced project (on OneDrive, GitHub, etc.) for further analysis, if possible.


1 Vote 1 ·

If you ONLY option is .net 6? then you created a .net core project, not a .net framework. This suggests you created the incorrect type of project.

If you create a .net core project, then that is NOT even a web forms project, so those controls will of course be grey out.

You have to follow my screen shots. If in the project>My project name properties: this:

235925-image.png

Then on the Application tab, you can pick the .net framework:

Say like this:

237093-image.png

The .net framework will in general show ALL of the versions of .net installed.

However, if you only see .net core 3 or 6 options, then you created the WRONG type of project, and you did not create a .net framework project, but in fact created a .net core project. If you create such a project, not only is that the wrong type for web forms, and does not even have a visual web form designer, but the controls you are attempting to use are of the wrong type - you can not use them. From what you describe, you have not created a web forms project, and not a .net framework one. You can't create such projects by choosing .net core.


0 Votes 0 ·
image.png (66.1 KiB)
image.png (42.1 KiB)