Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does @(PackageReference) supports %(ReferenceOutputAssembly) metadata, e.g.

<PackageReference Include="Microsoft.Xml.SgmlReader" Version="1.8.16" ExcludeAssets="Compile" GeneratePathProperty="true" ReferenceOutputAssembly="false" />

If it does, that might make it clearer that the @(PackageReference) is present only for download purposes, and not for csc /reference purposes.

Copy link
Contributor Author

@jpobst jpobst Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think %(ReferenceOutputAssembly) is only supported on @(ProjectReference). NuGet packages have no concept of output assemblies, they're just a zip of files in magic directories. The ExcludeAssets="Compile" is what is telling MSBuild not to use the contents for csc.

<Reference Include="SgmlReader">
<HintPath>$(PkgMicrosoft_Xml_SgmlReader)\lib\netstandard2.0\SgmlReaderDll.dll</HintPath>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does $(PkgMicrosoft_Xml_SgmlReader) come from? Is this a "NuGet-ism"? I don't see anything with this string in the current NuGet package that's used (the one prior to this PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from GeneratePathProperty="true". This tells MSBuild/NuGet to create a magic property containing the path where it put the package. Without this we can't know where the package is, as the packages folder can be moved in NuGet.config.

</Reference>
<PackageReference Include="Mono.Options" Version="5.3.0.1" />
</ItemGroup>
<ItemGroup>
Expand Down