简体   繁体   中英

Form designer view is not available in visual studio 2019 C# CMake project

I'm trying to port my C# Windows Form project from.csproj to CSharp CMake CMakeLists.txt. I successfully made CMakeLists.txt similar to here . The only problem is when the project opened with CMakeLists.txt, the Form Designer is not available (as shown below). Is it any way to fix the problem?

csproj:

在此处输入图像描述

CMakeLists.txt:

在此处输入图像描述

Your second image (from your CMake-generated project) is in a different View than the first image. The first image is the Solution View , in which the Form1.cs and Form1.Designer.cs files are grouped to show that the Form Designer is available. The CMake (second) image is showing the Folder View , which does not group the two files together.

CMake does not control what view you see in Visual Studio, your Visual Studio IDE controls this. The toolbar across the top of Solution Explorer has a button (called "Switch Views") to switch from a solution view to a folder view (and vice versa). You can use this to switch your perspective back to Solution View so the Form Designer is shown.


Note: This button has a bug in Visual Studio 2019 (see here ), so switching back to Solution View may not work as expected. I've worked around this issue by simply closing and re-opening the Solution.

When you open the solution file (via File > Open > Project/Solution... ), your default View should be the Solution View , and the Form Designers for your forms sources should be accessible. If you open the solution by doing File > Open > CMake... , your default View will be Folder View , which is not what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM