[VS]

背景

VS 2017 升级至  VS 2017 v15.3 后,.Net Core 1.1 应用编译报错:

Error: 包含了重复的“Content”项。.NET SDK 默认情况下包括你项目中的“Content”项。
可以从项目文件中删除这些项,或者如果希望将其显示包含在项目文件中,则可以将“EnableDefaultContentItems”属性设置为“false”。

Error : Duplicate ‘Content‘ items were included. The .NET SDK includes ‘Content‘ items from your project directory by default. 
You can either remove these items from your project file, or set the ‘EnableDefaultContentItems‘ property to ‘false‘ if you want to explicitly include them in your project file. 

解决

在 .csproj 项目文件中添加如下配置项,重启解决方案编译成功。

<PropertyGroup>
    <EnableDefaultContentItems>false</EnableDefaultContentItems>
  </PropertyGroup>
原文地址:https://www.cnblogs.com/CandiceW/p/7412620.html