Přejít k obsahu
Knowledge Base
English

ASP.NET Core · Development Tools · VS2017

ASP.NET Core: Duplicate ‚Content‘ items were included. The .NET SDK includes ‚Content‘ items from your project directory by default.

Robert Haken 1 min čtení Markdown ↓

Pokud dostanete na ASP.NET Core projektu ve Visual Studiu hlášku o duplicitním Contentu:

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. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: ‚wwwroot\Index.html‘ Web C:\Program Files\dotnet\sdk\1.1.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.DefaultItems.targets 188

…jedná se o nadrbaný .csproj a pomůže odebrat a přidat složky wwwroot z projektu:

  1. Solution Explorer – pravým na ~/wwwroot – Exclude From Project
  2. zapnout si viditelnost excludovaných souborů – Solution Explorer – Show All Files (jedna z ikonek nahoře)
  3. Solution Explorer – pravým na ~/wwwroot – Include in Project
Robert Haken · HAVIT Software Architect, Founder at HAVIT, Microsoft MVP - ASP.NET/IIS.
Ve znalostní bázi má 621 článků.
Všechny články autora →
HAVIT
Čtěte dál
Diskuze

Zanechat odpověď