dotnet / standard

This repo is building the .NET Standard
3.06k stars 427 forks source link

Strong name validation failed #960

Closed mrlucmorin closed 5 years ago

mrlucmorin commented 6 years ago

Hi,

I installed Microsoft.Packaging.Tools.Trimming, making sure to use the "-pre" cli parameter as recommended in #518 .

Version of the trimming tool is 1.1.0-preview1-27107-01

Project is targeting .NET Framework 4.6.1

Added the following to the .csproj file:

  <PropertyGroup>
    <TrimUnusedDependencies>true</TrimUnusedDependencies>
  </PropertyGroup>

I added it as the very first PropertyGroup if that matters.

When building the project from within VS2017, the following error happens:

Could not load file or assembly 'Microsoft.Packaging.Tools.Trimming.Tasks, Version=999.999.999.999, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

Strong name validation failed. (Exception from HRESULT: 0x8013141A) Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Microsoft Visual Studio Professional 2017 Version 15.8.9 VisualStudio.15.Release/15.8.9+28010.2050 Microsoft .NET Framework Version 4.7.03056

Any suggestion?

Thanks

mrlucmorin commented 6 years ago

Further information:

I needed to get the Trimming tool to work ASAP, so I disabled strong name checking altogether on my test machine, and it seems to have worked.

terrajobst commented 6 years ago

@ericstj, could you take look?

ericstj commented 6 years ago

So this is not a public release, but just a nightly build. The public releases on nuget.org should be fully signed. https://www.nuget.org/packages/Microsoft.Packaging.Tools.Trimming/1.1.0-preview1-26619-01

@wtgodbe it looks like this may have been caused by your changes to enable arcade signing: https://github.com/dotnet/standard/commit/e33a28a8152f17be7c119520869340d2524b5859

I recall @weshaggard had to do something to make arcade aware of the open key. Perhaps we're missing a change?

weshaggard commented 6 years ago

edit (updated to correct link)

We need https://github.com/dotnet/arcade/issues/1204 to fix the open signing issue.

ericstj commented 6 years ago

@weshaggard even though this repo isn't actually doing IL rewriting? I would have expected us to just set the flags that tell CSC to fully-sign the assemblies.

weshaggard commented 6 years ago

@ericstj that is fair perhaps delay signing got turned on somewhere.

terrajobst commented 5 years ago

This issue was moved to ericstj/Microsoft.Packaging.Tools.Trimming#1