Visual studio for mac - 启用默认的咨询项目

Visual studio for mac - Enable default conulttent items

我正尝试在一个 asp.net 核心项目中工作,该项目目前在 VS 2017 中运行良好。

我从 Git 获取代码并从 Nuget 正确恢复所有包。

当我尝试启动或构建应用程序时,mac.

的 .Net 核心的最后可用版本 Microsoft.Net.Sdk.defaultItems.target 出现错误

目标代码:

<!-- Default content items are enabled by the Web SDK, not the .NET SDK, but we check it here for simplicity -->
    <CheckForDuplicateItems
      Items="@(Content)"
      ItemName="Content"
      DefaultItemsEnabled="$(EnableDefaultItems)"
      DefaultItemsOfThisTypeEnabled="$(EnableDefaultContentItems)"
      PropertyNameToDisableDefaultItems="EnableDefaultContentItems"
      MoreInformationLink="$(DefaultItemsMoreInformationLink)"
      ContinueOnError="$(CheckForDuplicateItemsContinueOnError)">
      <Output TaskParameter="DeduplicatedItems" ItemName="DeduplicatedContentItems" />
    </CheckForDuplicateItems>

错误(这是法语的快速翻译):

Duplicated "Content" elements were included. .Net SDK automatically include "Content" elements from your project directory. You can delete this elements from you project or set the property "EnableDefaultContentItems" to false. If you want to include the changes in your project file blablabla...

当然我删除了所有重复的内容,但我仍然有错误。

我已经有人遇到过这个错误...

编辑:每次启动我的项目时,文件仅在 Visual Studio 中复制 mac

查看.Net core SDK的repo后,我发现

"EnableDefaultContentItems"

需要添加到引发错误的项目的 .csproj

问题已解决