tunnelvisionlabs / ReferenceAssemblyAnnotator

IL weaver to add nullability annotations to .NET reference assemblies
MIT License
72 stars 8 forks source link

Targets try to evaluate GetDirectoryName('') and cause "path is not of a legal form" error (support netcoreapp3.0 and netstandard2.1) #38

Closed jnm2 closed 4 years ago

jnm2 commented 4 years ago

C:\Users\appveyor.nuget\packages\tunnelvisionlabs.referenceassemblyannotator\1.0.0-alpha.77\build\TunnelVisionLabs.ReferenceAssemblyAnnotator.targets(129,47): error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.

Project: https://github.com/GuOrg/Gu.Wpf.DataGrid2D/blob/6797e4e33810663afb9d41be8a7dfd0bca77c063/Gu.Wpf.DataGrid2D/Gu.Wpf.DataGrid2D.csproj

Line in question:

https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/blob/2563160c99a8c6b947cd5432d0304662609e5f2c/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.targets#L129

JohanLarsson commented 4 years ago

Other repros: https://github.com/GuOrg/Gu.Wpf.NumericInput https://github.com/GuOrg/Gu.Wpf.Adorners

Multitargeting WPF libraries.

jnm2 commented 4 years ago

The cause is including netcoreapp3.0 or netstandard2.1 in the project's target frameworks.

jnm2 commented 4 years ago

Everyone watching this issue: please try version [1.0.0-alpha.108.gaa6f8a1044] (PR https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/pull/59) and tell us whether or not it fixes the problem.

nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="appveyor-referenceassemblyannotator" value="https://ci.appveyor.com/nuget/referenceassemblyannotator" />
  </packageSources>
</configuration>