如何添加到外部配置文件到Visual Studio 2010的参考? [英] How do I add a reference to an external configuration file to Visual Studio 2010?

查看:259
本文介绍了如何添加到外部配置文件到Visual Studio 2010的参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个外部的配置文件,为第三方工具,我想能够编辑在VS2010编辑其他项目组成的一部分。

I have an external configuration file, for a third party tool, which I would like to be able to edit as part of editing other project components in VS2010.

我工作的这个项目是一个MVC-3项目,该文件位于项目(它在../ExternalConfig的相当于root)的文件夹结构之外。

The project I'm working on is an MVC-3 project, and the file is located outside of the folder structure for the project (it's in the equivalent of ../ExternalConfig to the root).

我如何添加到该文件VS2010的参考?目前,我所有的尝试都导致VS创建的目录结构,这是不理想的内部文件的副本。

How do I add a reference to this file to VS2010? Currently, all my attempts have resulted in VS creating a copy of the file inside of its directory structure, which is not ideal.

(当然,我可能会去一些陌生长度,如添加脚本来构建过程把配置文件在正确的地方,但我宁愿只能够编辑它会在那里坐)

(Sure, I could go to some strange lengths, like adding a script to the build process to put the config file in the right place, but I'd rather just be able to edit it where it sits)

推荐答案

关键是要将该项目添加为一个链接:

The trick is to add the item as a link:


  1. 右键单击您的项目在解决方案资源管理器

  2. 选择添加 - >现有项...

  3. 导航至要添加到解决方案
  4. [重要] 而是按Enter键或单击Add按钮,你要点击添加按钮的右边的下拉箭头图标,然后选择添加链接。

  1. Right-click your project in Solution Explorer
  2. Select "Add" -> "Existing Item..."
  3. Navigate to the file that you want to add to the solution
  4. [Important] Instead of hitting Enter or clicking the Add button, you want to click the down-arrow icon at the right edge of the Add button, and select "Add As Link".

这篇关于如何添加到外部配置文件到Visual Studio 2010的参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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