How can I determine the subsystem used by a given .NET assembly?

前端 未结 4 506
野趣味
野趣味 2020-12-06 19:22

In a C# application, I\'d like to determine whether another .NET application is a Console application or not.

Can this be done using the reflection APIs?

EDI

4条回答
  •  臣服心动
    2020-12-06 20:18

    I don't think there's a scientific way to determine it, the closest workaround that comes to my mind is using reflection to check if the application references and loads the WinForms assembly, but I'm not entirely sure. Might give it a try.

提交回复
热议问题