C
C#2y ago
Tandy

❔ Playwright dotnet - Duplicate 'Content' items were included.

A colleague has installed Playwright dotnet in our dotnet API project and now Omnisharp is throwing the following error (and failing to provide any intellisense in the whole solution):
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: '/Users/me/.nuget/packages/microsoft.playwright/1.32.0/buildTransitive/../.playwright/node/LICENSE'
I may be dense, but from the options provided, it's not clear what exact csproj changes I should be making. It seems like I need to exclude any content provided from Playwright, but it's not clear how to do that, especially considering this Nuget package is outside the context of my project. Any suggestions?
3 Replies
phaseshift
phaseshift2y ago
What version studio are you using? Posting your csproj file might help
Tandy
TandyOP2y ago
Sorry didn't see this message! I'm using VS Code and Omnisharp. My csproj file is pretty basic (though I've omitted ~10 packages which caused message to exceed max discord message length:
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Playwright" Version="1.32.0" />
</ItemGroup>

<ItemGroup>
<None Remove="Migrations\Sql\*.sql" />
<EmbeddedResource Include="Migrations\Sql\*.sql" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Reporting.Domain\Reporting.Domain.csproj" />
</ItemGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>CS1591</NoWarn>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Playwright" Version="1.32.0" />
</ItemGroup>

<ItemGroup>
<None Remove="Migrations\Sql\*.sql" />
<EmbeddedResource Include="Migrations\Sql\*.sql" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Reporting.Domain\Reporting.Domain.csproj" />
</ItemGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>CS1591</NoWarn>
</PropertyGroup>
</Project>
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server