Skip to content

Commit

Permalink
[param-name-importer] Bump to Microsoft.Xml.SgmlReader 1.8.16 (#656)
Browse files Browse the repository at this point in the history
Microsoft.Xml.SgmlReader 1.8.16 supports .NET Standard 2.0

There is an issue with the new version in that the `lib/netcoreapp3.1`
directory contains both `SgmlReader.exe` and `SgmlReaderDll.dll` and
the `netcoreapp3.1` version of `param-name-importer` tries to consume
the `.exe` file.

Work around this by using `@(PackageReference)` to download the NuGet
but not reference any assembly.  Then we add a `@(Reference)` to the
correct `.dll` and use it.  (We use the `netstandard2.0` version
because both frameworks can use it; `netcoreapp3.1` shouldn't even
exist in the package.)

Fix a warning by changing the `@(System.IO.Compression)` for
`System.IO.Compression` to be conditional on building for (desktop)
.NET Framework, not .NET Core

	Warning MSB3243: No way to resolve conflict between "System.IO.Compression, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.IO.Compression".
	Choosing "System.IO.Compression, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
  • Loading branch information
jpobst authored Jun 8, 2020
1 parent eb39a3a commit b136ac9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/param-name-importer/param-name-importer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
<ItemGroup>
<!-- Not sure why needed, but only System.IO.Compression.FileSystem.dll is
included by default, and ZipArchive is type forwarded to System.IO.Compression -->
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression" Condition="$(TargetFramework.StartsWith('net4'))" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xml.SgmlReader" Version="1.8.14" />
<!-- This package erroneously contains /netcoreapp3.1/SgmlReader.exe and /netcoreapp3.1/SgmlReaderDll.dll.
We are going to use a package reference to download the nuget, and a regular reference to actually
reference the correct assembly. -->
<PackageReference Include="Microsoft.Xml.SgmlReader" Version="1.8.16" ExcludeAssets="Compile" GeneratePathProperty="true" />
<Reference Include="SgmlReader">
<HintPath>$(PkgMicrosoft_Xml_SgmlReader)\lib\netstandard2.0\SgmlReaderDll.dll</HintPath>
</Reference>
<PackageReference Include="Mono.Options" Version="5.3.0.1" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit b136ac9

Please sign in to comment.