将WPF Windows应用程序转换为DLL [英] Convert WPF Windows application to dll

查看:329
本文介绍了将WPF Windows应用程序转换为DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



请帮我转换WPF Windows应用程序到dll。



问候,

Nidheesh

Hi all,

Please help me to convert a WPF Windows application to dll.

Regards,
Nidheesh

推荐答案

对于标准WPF应用程序,这很容易做到,但不是很简单,因为这样的应用程序使用自动生成的代码作为入口点( Main )。这种东西不适用于图书馆类型。



一种方法是删除应用程序类它的ZAML。如果需要,可以手动编写应用程序类。然后,您可以将应用程序类型更改为库。如果要在库中包含一些 Application 类,请从以下内容开始:拥有WPF应用程序,构建它并找到自动生成的代码,了解它的作用。它应该清楚应用程序如何从入口点开始工作。决定你想要包含在库中的内容。



-SA
This is really easy to do, but not really straightforward, in case of the "standard" WPF application, as such application uses auto-generated code for the entry point (Main). Such thing is not applicable for a library type.

One way of doing it is to remove Application class with its ZAML. If you want, you can write application class manually. Then you can change the application type to library. If you want to include some Application class in the library, start with the following: having a WPF application, build it and locate the auto-generated code, learn what it does. It should make it clear how the application works from the very entry point. Decide what you want to include in the library.

—SA


转到项目属性并将输出类型更改为类库,现在构建项目并将项目作为dll。
Go to project properties and change output type to class library,now build project and get project as dll.


更改应用程序项目设置中的输出类型。任何其他特定问题 - 询问具体问题......
change the outputtype in the project-settings of your app. Any other specifuc problems - ask a specific question...


这篇关于将WPF Windows应用程序转换为DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆