Skip to content

Commit b136ac9

Browse files
authored
[param-name-importer] Bump to Microsoft.Xml.SgmlReader 1.8.16 (#656)
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.
1 parent eb39a3a commit b136ac9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/param-name-importer/param-name-importer.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@
99
<ItemGroup>
1010
<!-- Not sure why needed, but only System.IO.Compression.FileSystem.dll is
1111
included by default, and ZipArchive is type forwarded to System.IO.Compression -->
12-
<Reference Include="System.IO.Compression" />
12+
<Reference Include="System.IO.Compression" Condition="$(TargetFramework.StartsWith('net4'))" />
1313
</ItemGroup>
1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.Xml.SgmlReader" Version="1.8.14" />
15+
<!-- This package erroneously contains /netcoreapp3.1/SgmlReader.exe and /netcoreapp3.1/SgmlReaderDll.dll.
16+
We are going to use a package reference to download the nuget, and a regular reference to actually
17+
reference the correct assembly. -->
18+
<PackageReference Include="Microsoft.Xml.SgmlReader" Version="1.8.16" ExcludeAssets="Compile" GeneratePathProperty="true" />
19+
<Reference Include="SgmlReader">
20+
<HintPath>$(PkgMicrosoft_Xml_SgmlReader)\lib\netstandard2.0\SgmlReaderDll.dll</HintPath>
21+
</Reference>
1622
<PackageReference Include="Mono.Options" Version="5.3.0.1" />
1723
</ItemGroup>
1824
<ItemGroup>

0 commit comments

Comments
 (0)