Visual Studio项目构建为可执行文件和DLL [英] Visual Studio project build as an executable AND a DLL

查看:210
本文介绍了Visual Studio项目构建为可执行文件和DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2008项目属性应用程序选项卡中,我可以将输出类型设置为Windows应用程序,控制台应用程序或类库。我有一个项目,我想作为一个独立的工具(控制台应用程序)构建一个可用于一些其他工具,我正在作为一个类库。

In Visual Studio 2008 project properties, Application tab, I can set the Output type to Windows Application, Console Application, or Class Library. I have a project that I want to build as a stand-alone tool (console app) and be available to a couple other tools I'm working on as a class library.

VS GUI只允许我选择一个或另一个,建立proj两次都是不方便的。

The VS GUI only lets me choose one or the other, and building the proj twice all the time is inconvenient.

我如何将其设置为在单个构建作业中构建两种输出类型?我写一些自定义的MSBuild.targets文件或什么?

How can I set it up to build both output types in a single build job? Do I write some custom MSBuild .targets file or what?

推荐答案

如果我没有错,可以使用EXE一个类库。

只需在其他项目中添加一个引用。 .NET EXE只是一个程序集。

If I'm not mistaken, you can use the EXE as a class library.
Just add a reference to it, in the other projects. A .NET EXE is just an assembly.

这篇关于Visual Studio项目构建为可执行文件和DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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