No creation of a WPF window in a DLL project?

前端 未结 4 1908
梦毁少年i
梦毁少年i 2020-12-02 16:56

Is there a reason why Visual Studio won\'t let me create a WPF window in a DLL project?

I \"solved\" it by creating a window in an Application Project and copying it

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 17:06

    I do it this way: 1) create "WPF Application" 2) remove App.xaml 3) change Project properties -> Application Output type: to Class Library (originally there is Windows Application)

    Otherwise you will get errors:

    "Library project file cannot specify ApplicationDefinition element"

    "The project file contains a property value that is not valid"

提交回复
热议问题