Visual Studio中 - 如何使用相同的源创建两个项目 [英] Visual Studio - how to create two projects using the same sources

查看:524
本文介绍了Visual Studio中 - 如何使用相同的源创建两个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的解决方案包括2个可执行项目和一对夫妇的DLL。 PROJECT1是一个智能设备项目,Project2的是Windows窗体项目。
这两个项目都使用相同的库,那原因是我想在PC上测试我的图书馆之前,我将它部署在设备上。

My solution consists of 2 executable projects and a couple dlls. Project1 is a Smart Device Project, Project2 is a Windows Forms Project.
Both projects use the same libraries, the reason of that is I want to test my libraries on PC before I deploy it on the device.

现在的问题是,该DLL项目类型可以是智能设备类库和类库,而不是两个。我无法添加从标清项目的引用,WF,反之亦然。我能够从标清项目中添加引用dll文件(从类库项目产生的),而不是项目本身,但由于某些原因,我得到的消息无法加载从YYY组装XXX类型。它不依赖于我的code,因为当我创建单独的项目为同一来源,一切都很好。

The problem is that the DLL project type can be Smart Device Class Library or Class Library, not both. I cannot add a reference from SD project to WF and vice versa. I was able to add reference from SD project to a dll file (generated from Class Library project) instead of the project itself, but for some reason I got the message "cannot load XXX type from YYY assembly". It doesn't depend on my code, because when I created separate project for the same sources, everything was fine.

我发现的唯一的解决方案是创建2类型的每个库的项目,但我不知道如何根据同一消息来源,使2个项目。

The only solution I've found is to create 2 types of projects for each library, but I don't know how to make 2 projects based on the same sources.

推荐答案

您可以添加的所有文件通常以一个项目。

You can add all of the files normally to one project.

您可以右键单击其他项目,单击添加,现有的文件,选择文件,点击旁边的下拉箭头,添加按钮,然后单击添加为链接。

You can then right-click the other project, click Add, Existing File, select the files, click the down arrow next to the Add button, and click Add as Link.

这篇关于Visual Studio中 - 如何使用相同的源创建两个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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