Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2015 使用“添加现有项目时”;添加为链接";,此文件未在VS2015中编译?_Visual Studio 2015_Asp.net Core - Fatal编程技术网

Visual studio 2015 使用“添加现有项目时”;添加为链接";,此文件未在VS2015中编译?

Visual studio 2015 使用“添加现有项目时”;添加为链接";,此文件未在VS2015中编译?,visual-studio-2015,asp.net-core,Visual Studio 2015,Asp.net Core,使用“添加为链接”添加现有项时,该文件未在VS2015中编译 事实上,这还不受支持。我联系了此功能的工程负责人,他们正在调查如何支持此功能 您可以在project.json文件中手动添加“链接”文件: { ... other stuff ... "compile": [ "../path/to/somewhere.cs", "../../another/path/to/file.cs", "../../use/globbing/*

使用“添加为链接”添加现有项时,该文件未在VS2015中编译


事实上,这还不受支持。我联系了此功能的工程负责人,他们正在调查如何支持此功能

您可以在
project.json
文件中手动添加“链接”文件:

{
    ... other stuff ...

    "compile": [
        "../path/to/somewhere.cs",
        "../../another/path/to/file.cs",
        "../../use/globbing/**/*.cs"
    ],

    ... other stuff ...
}
文件的架构可在以下位置获得:


在Visual Studio中编辑
project.json
文件时,您将在Intellisense中看到相同的模式。

使用ALT键并将文件拖动到您想要的任何位置。

我认为不支持此操作。我似乎根本找不到“添加为”链接。在我的情况下,我只需要添加一个文件的快捷方式,但我根本不需要对其进行编译。如果“某处.cs”文件依赖于主项目中的代码,则生成失败,则此链接不会始终起作用。我想我们必须等到它得到真正的支持。@Stef您能澄清一下“依赖于主项目中的代码”是什么意思吗?如果它依赖于不在“当前”项目中的代码,那么您还需要导入这些文件。这应该与其他项目类型没有什么不同,当您拉入一个文件时,您必须拉入任何其他依赖的文件。另一个问题,.cs文件位置为什么用?为什么不使用像“code”这样的数组:[“./path/*.cs”、“./path2/*.cs”]?@Stef你知道,这是一个很好的问题。如果您愿意,请登录一个bug。根据David的说法,这应该得到支持。在github上查看此问题: