How to determine if a WPF EXE

I am trying to find out if the EXE is a WPF application or a WinForms application. Any suggestions on how I can do this?

I heard that I can use the Reflector tool, if so, how can I do this?

Thanks.

+5
source share
4 answers

Although you can usually classify an application as β€œeither” a WPF or WinForms application, interaction is possible, so that a WinForms application can β€œhost” WPF controls and vice versa. Since your application sounds like it refers to both sets of assemblies, it can use both. Just something to be aware of.

Anyway, I just opened one of my WPF projects in Reflector and some obvious signs that it is a WPF application:

1) There is a class that has which is a file (like this) AppStartupUriXaml

public class App : System.Windows.Application
{
    // Methods
    [DebuggerNonUserCode]
    public void InitializeComponent()
    {
        base.StartupUri = new Uri("Window1.xaml", UriKind.Relative);
    }

2) in exe

there is XamlGeneratedNamespace

3) There are files in the Resources.baml folder (possibly within <Application1>.g.resources).

4) Window classes (if you can easily find them in the reflector tree):

public class Window1 : System.Windows.Window
, System.Windows.Markup.IComponentConnector {

If you really want to trawl through Reflector in detail, WinForms windows inherit from System.Windows.Forms.Form, so you can easily determine if you have WinForms and WPF.

+6
source

You can check .exe with code, you do not need a reflector.

.exe, System.Windows.Application, dll PresentationFramework ( ).

100% - , - , wpf, . - Reflector, Run().

, , , wpf-:

public static bool IsWpfApplication
{
    get { return System.Windows.Application.Current != null; }
}
+3

, DLL PresentationFramework ( WPF) System.Windows.Forms.dll. , - .

, . WPF , .

+2

, , WPF , . Windows 1px, WPF ... .

, WPF , - , "", anitaliased , . , , .

+1

All Articles