Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if an app is a Winforms app or WPF app by looking at project properties

When I look at the project properties in Visual Studio for my particular project, there is a field called Output Type which says Windows Application. Does that automatically tell me that it's a WinForms application? I'm trying to find a way to determine right away if the project is a Winforms application. Yes, I can look at the files and determine that by looking at the forms. But I'm wondering if there is a more obvious way to determine that by simply looking at a project's properties.

The other reason I'm asking is because when I look at the project properties of a WPF application, the Output Type is also Windows Application. The way to determine that it's a WPF app is by looking for XAML files. So is there a simpler technique to determine what type of app it is by looking at project properties?

like image 519
Ray Avatar asked Dec 13 '14 17:12

Ray


People also ask

Is Visual Studio a WPF application?

Windows Presentation Foundation (WPF) in Visual Studio provides developers with a unified programming model for building line-of-business desktop applications on Windows.

What is a WinForms app?

Windows Forms (WinForms) is a free and open-source graphical (GUI) class library included as a part of Microsoft . NET, . NET Framework or Mono Framework, providing a platform to write client applications for desktop, laptop, and tablet PCs.

Is WinForms obsolete?

WinForms won't be deprecated until Win32 is ... which could be quite sometime! WPF on the other hand has few direct dependencies on Win32 so could potentially form the basis of a "fresh start" UI layer on a future version of windows.


1 Answers

You can tell by what assemblies the project references. Does it reference assemblies beneath System.Windows.Forms? If so, it's WinForms. If it only references namespaces beneath System.Windows other than System.Windows.Forms, then it's WPF.

Check the type of your main form -- is it a System.Windows.Forms.Form? If so, it's a WinForms project. If it's a System.Windows.Window, then it's WPF.

like image 130
rory.ap Avatar answered Sep 19 '22 09:09

rory.ap