define a value for metadata "CopyLocal"???

Wally96333 71 Reputation points
2023-10-09T20:07:16.41+00:00

When I build my project in Release mode, I get the following error:


The item "C:\ ... \X_Solution\packages\BouncyCastle.1.8.2\lib\BouncyCastle.Crypto.dll" in item list "ReferencePath" does not define a value for metadata "CopyLocal". In order to use this metadata, either qualify it by specifying %(ReferencePath.CopyLocal), or ensure that all items in this list define a value for this metadata.

I am not sure what that even means.

I did not get that error when I was building in Debug mode.

I thought that I had resolved this by migrating from packages.config management format to the PackageReference format, but I had to roll that back because it caused other problems.

This is a WPF app, on a Windows 10 system, with Visual Studio 2017 Community.

Any assistance with this would be appreciated.

Thanks!

Developer technologies | Windows Presentation Foundation
Developer technologies | .NET | Other
Developer technologies | Visual Studio | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Wally96333 71 Reputation points
    2023-10-14T19:46:05.9966667+00:00

    This was fixed by introducing the following to the .CSPROJ file within the <Project> tag:

    
    ******************************************************
    https://stackoverflow.com/a/70591425
    ******************************************************
    <ItemDefinitionGroup>
        <ReferencePath>
          <CopyLocal>false</CopyLocal>
        </ReferencePath>
      </ItemDefinitionGroup>
    ******************************************************
    
    
    

    HTH.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.