多个项目,单源文件? [英] Multiple projects, Single source file?

查看:57
本文介绍了多个项目,单源文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有两个项目,我想在每个

项目中使用相同的源文件。

如果我将文件添加到每个项目,那么就会生成本地副本。


我希望两个项目都能使用单个源文件,所以

,我只需要更改一个文件。

我在文件中使用编译器指令,所以我不能只是将
构建到DLL中这样做,我真的需要让两个

项目引用相同的源文件。


有人知道怎么做吗?

谢谢你。

Paul Cheetham

解决方案

Paul,


将现有项添加到项目中。执行此操作时,在对话框中,单击添加,而不是单击添加,然后选择下拉框。选择添加为链接

,它只会有一个文件链接,而不是将实际文件复制到

项目本身。


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" Paul Cheetham" < PA ****** @ dsl.pipex.com>在消息中写道

新闻:OL ************** @ TK2MSFTNGP04.phx.gbl ...


我有两个项目,我想在每个
项目中使用相同的源文件。
如果我将文件添加到每个项目,那么就会制作本地副本。

我希望能够有两个项目使用的单个源文件,所以我只需要更改一个文件。
我在文件中使用编译器指令,所以我可以我只是将它构建成DLL并以这种方式进行,我确实需要使两个项目都引用相同的源文件。

有谁知道怎么做这样做吗?

谢谢你。

Paul Cheetham



Hello Paul,


鼠标右键单击以调用项目上下文meny-> Add->已存在

项目并指向您的课程

什么''错了吗?


PC>

PC>

PC>我有两个项目,我想在每个

PC>中使用相同的源文件。项目。

PC>如果我将文件添加到每个项目,则会生成本地副本。

PC>我希望能够有两个项目使用的单个源文件

PC>所以

PC>我只需要更改一个文件。

PC>我在文件中使用编译器指令,所以我不能只是

PC>将它构建成DLL并以这种方式执行,我确实需要制作

PC>两者

PC>项目引用相同的源文件。

PC>有人知道怎么做吗?


---

WBR,

Michael Nemtsev ::博客: http://spaces.msn.com/laflour


有时一个人仍然忠于一个事业,只因为它的对手没有,b $ b不再是平淡无奇的。 (c)Friedrich Nietzsche


>>鼠标右键单击以调用项目上下文meny> Add-> Existed Item并指向您的课程

这有什么问题? <<


因为,如果文件不在项目文件夹中,VS会复制它

那里。


Hi,

I have two projects where I want to use the same source file in each
project.
If I add the file to each project, then a local copy is made.

I want to be able to have a single source file used by both projects so
that I only have to change one file.
I am using compiler directives within the file, and so I can''t just
build it into a DLL and do it that way, I really do need to make both
projects reference the same source file.

Does anybody know how to do this?
Thanksyou.
Paul Cheetham

解决方案

Paul,

Add an existing item to the project. When you do, in the dialog,
instead of clicking "Add", select the drop down box. Select "Add as Link"
and it will just have a link to the file, not copying the actual file to the
project itself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Paul Cheetham" <PA******@dsl.pipex.com> wrote in message
news:OL**************@TK2MSFTNGP04.phx.gbl...

Hi,

I have two projects where I want to use the same source file in each
project.
If I add the file to each project, then a local copy is made.

I want to be able to have a single source file used by both projects so
that I only have to change one file.
I am using compiler directives within the file, and so I can''t just build
it into a DLL and do it that way, I really do need to make both projects
reference the same source file.

Does anybody know how to do this?
Thanksyou.
Paul Cheetham



Hello Paul,

Right mouse button click to call context meny on the project->Add->Existed
Item and point you class
What''s wrong with this?

PC> Hi,
PC>
PC> I have two projects where I want to use the same source file in each
PC> project.
PC> If I add the file to each project, then a local copy is made.
PC> I want to be able to have a single source file used by both projects
PC> so
PC> that I only have to change one file.
PC> I am using compiler directives within the file, and so I can''t just
PC> build it into a DLL and do it that way, I really do need to make
PC> both
PC> projects reference the same source file.
PC> Does anybody know how to do this?

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


>> Right mouse button click to call context meny on the project->Add->Existed Item and point you class
What''s wrong with this? <<

Because, if the file is not in the project folder, VS will copy it
there.


这篇关于多个项目,单源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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