Description
I am converting one of my test projects to the new csproj format. The project references XUnit and an optional package XUnit.Assert.Source which adds source files of the assertion library to the project structure. I have to remove the transitive dependency Xunit.Assert which includes the compiled version of the same assertions so that no conflicts occur. This worked well for the traditional csproj.
Repro steps
paket.dependencies:
source https://www.nuget.org/api/v2
nuget xunit
nuget xunit.assert.source
paket.references
xunit
exclude xunit.assert
xunit.assert.source
TestOfExclude.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="Asserts\Assert.cs">
<Paket>True</Paket>
</Compile>
.... and so on ....
<Compile Include="Asserts\Sdk\Exceptions\XunitException.cs">
<Paket>True</Paket>
</Compile>
</ItemGroup>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
A project with the reproduction TestOfExclude.zip
Expected behavior
XUnit.Assert is not included in the list of referenced NuGet packages.
- The project compiles.
Actual behavior
The opposite, more than 200 errors like this:
CS0111 Type 'Assert' already defines a member called '.ctor' with the same parameter types TestOfExclude\Asserts\Assert.cs
Description
I am converting one of my test projects to the new csproj format. The project references
XUnitand an optional packageXUnit.Assert.Sourcewhich adds source files of the assertion library to the project structure. I have to remove the transitive dependencyXunit.Assertwhich includes the compiled version of the same assertions so that no conflicts occur. This worked well for the traditional csproj.Repro steps
paket.dependencies:
paket.references
TestOfExclude.csproj
A project with the reproduction TestOfExclude.zip
Expected behavior
XUnit.Assertis not included in the list of referenced NuGet packages.Actual behavior
The opposite, more than 200 errors like this:
CS0111 Type 'Assert' already defines a member called '.ctor' with the same parameter types TestOfExclude\Asserts\Assert.cs