You'll only see the View Designer option for files that the IDE considers to have designer files. This is tied to how the item is added to the project. If you added the file using Add New Item then it was likely inserted (along with the .designer.cs file) into the project and in the project file there is a subtype set identifying it as having a designer. If you simply copied the file to another project and added existing item on it then that information wouldn't be available so you'd need to manually do the same thing. More importantly you'd need to ensure you copied all the files related to the component (if any).
Visual Studio 2019 missing class View designer
Hi
In Visual studio 2019, Framework 4.72 I have a big solution with several asp.net webforms websites.
I added the following class to two websites: In the solution explorer, in one website, in the context menu, I have "View designer", and in the other website, there is no "View designer". If I click "Open With...", in the list of viewers, one has "CSharp Form Editor" and in the other website it is missing.
Any ideas?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for Class1
/// </summary>
public class Class1 : System.ComponentModel.Component
{
public Class1()
{
}
}
5 answers
Sort by: Most helpful
-
-
Moshe Rubenstein 1 Reputation point
2021-04-22T13:58:02.023+00:00 Hi @Michael Taylor
Thank you for your answer.
Actually, in both websites (where the designer shows, and where it doesn't) there is no designer file. As you can see, it is an empty class. I created the file (Add...) in the website where it does not work and copied it to the website that it does work... -
Moshe Rubenstein 1 Reputation point
2021-04-22T14:05:16.687+00:00 @Michael Taylor
I don't know of a project file, it is a website (so is the other one)
This is the vwd.webinfo content:
<?xml version="1.0"?>
<!--
Visual Studio global web project settings.
-->
<VisualWebDeveloper><iisExpressSettings windowsAuthentication="enabled" anonymousAuthentication="enabled" useClassicPipelineMode="false"/>
</VisualWebDeveloper> -
Moshe Rubenstein 1 Reputation point
2021-04-25T05:58:47.353+00:00 Hi @Michael Taylor
The exact same class shows in the designer in two other websites in the same solution.
I tried removing the inheritance - no difference. -
Duane Arnold 3,216 Reputation points
2021-04-25T17:07:36.773+00:00 https://learn.microsoft.com/en-us/answers/products/vs
Maybe, you can try a Visual Stuido forum.
The link is in the above parent link.
https://learn.microsoft.com/en-us/answers/topics/vs-general.html