Visual Studio:使用外部文件(不复制它们) [英] Visual Studio: Using external files (without copying them)

查看:203
本文介绍了Visual Studio:使用外部文件(不复制它们)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将枚举类(.cs)导入到另一个服务生成的项目中.因此,如果该服务将更新此文件,则应在我的项目中自动对其进行更新.它必须是纯文本的(因此我不能使用程序集),因为我们无法在php中编译代码.

I want to import an enum class (.cs) into my project that is generated by another service. So if that service will update this file, it should be automatically updated in my project. It has to be text-only (so I can't use an assembly) because we can't compile code in php.

这就是为什么我想要这个: 我们在多个应用程序中使用全局语言字符串,出于某些原因,我想将它们用作枚举.添加新文本后,我希望能够在不复制或更改任何内容的情况下使用它们.也许还有另一种方法可以实现这一目标.

And here is why I want this: We are using global language strings in multiple applications and I would like to use them as enumerations for some reasons. When new texts are added I want to be able to use them without copying or changing anything. Maybe there is another way to achieve this.

谢谢.

推荐答案

您可以将源代码文件作为链接添加到项目中.

You can add a source code file to a project as a link.

要这样做:

  1. 右键单击项目,然后选择添加->现有项目"
  2. 导航到要添加为链接的文件,然后选择它.
  3. 查看添加现有项"对话框右下角的添加"按钮.它有一个小箭头.单击该下拉箭头.
  4. 选择添加为链接".

这篇关于Visual Studio:使用外部文件(不复制它们)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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