question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PackageDefinition metadata seems to be missing

See original GitHub issue

Before upgrading to DotNet Core 2.1.3, the following minimal example worked as expected:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="FSharp.Compiler.Tools" Version="4.0.0.1"/>
  </ItemGroup>
 <Target Name="GetToolFiles">
    <CreateItem Include="@(PackageDefinitions)" Condition="'%(Name)' == 'FSharp.Compiler.Tools'">
      <Output TaskParameter="Include" ItemName="FSharpCompilerToolsRef"/>
    </CreateItem>
    <PropertyGroup>
      <FSharpCompilerTools>@(FSharpCompilerToolsRef->'%(ResolvedPath)')/tools/*.*</FSharpCompilerTools>
    </PropertyGroup>
    <ItemGroup>
      <FSharpFiles Include="$(FSharpCompilerTools)"/>
    </ItemGroup>
  </Target>
  <Target Name="CopyToolsAfterBuild" AfterTargets="Build" DependsOnTargets="GetToolFiles">
    <Copy SourceFiles="@(FSharpFiles)" DestinationFolder="$(OutDir)/FSharp/"/>
  </Target>
</Project>

The expected output would be the contents of the Tools directory under the FSharp.Compiler.Tools would be copied to Debug/netcoreapp2.0/FSharp. Since upgrading to 2.1.300, the %(ResolvedPath) metadata attribute is not being populated with a value, and the result would copy files located in a tools folder off the root of the current drive if one exists. The following lines are written to a detailed output: Copying file from "/tools\file1.txt" to "bin\Debug\netcoreapp2.0\/FSharp/file1.txt".

Modifiying the SDK version using either global.json or uninstalling the most recent versions of DotnetCore (2.1.300), results in the expected files being copied from the source package reference. Copying file from "C:\Users\username\.nuget\packages\fsharp.compiler.tools\4.0.0.1\tools\fsc.exe" to "bin\Debug\netcoreapp2.0\\FSharp\fsc.exe".

I have tested this issue using SDK version 2.1.300 and 2.1.400 and get the same missing metadata, any earlier version seems set the ResolvedPath value to the correct value for the PackageReference

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
nguerreracommented, Jun 19, 2018

Calculating those PackageDefinitions is very expensive so we made a modest breaking change in exchange for vastly improved build performance to stop doing it in every build since it is usually not required. You can request them explicitly by adding a dependency on RunResolvePackageDependencies.

-<Target Name="GetToolFiles">
+<Target Name="GetToolFiles" DependsOnTargets="RunResolvePackageDependencies">
1reaction
matt-richardsoncommented, Apr 24, 2019

I found that if you add:

  <Target Name="RunResolvePackageDependencies" Condition="'$(RunResolvePackageDependencies)' != ''"/>

It will define a new empty target if it doesn’t already exist, and then it’ll work for both new code and old.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Pip cannot find metadata file - EnvironmentError
It seems that there is a conflict between /usr/bin/pip and /home/vagrant/.local/lib/python3.7/. My solution is avoiding the error. pip freeze > ...
Read more >
Core ML Missing Metadata "inputSchema"
I'm working with a style transfer model trained with pytorch in google colaboratory and then converted to an ML package. When I bring...
Read more >
Getting metadata for ancient items not installed with DIM ...
Is there any way to get metadata for products that I did not install ... connect and I have a huge chunk that...
Read more >
GdalTools core plugin "missing metadata file"
I have the exact same problem. The broken plugin appears in Plugin Manager, but there's no GdalTools folder in python/plugins. – pg85. Jun...
Read more >
Meteor build fails on Windows due to missing isopack ...
Meteor build fails on Windows due to missing isopack metadata files ... It seems there was a very heavily nested dependency tree of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found