Microsoft-ui-xaml: Strong Name Validation Failed - 18970 Build

Created on 10 Sep 2019  路  6Comments  路  Source: microsoft/microsoft-ui-xaml

Describe the bug
When building with Preview SDK 19870, the Microsoft.Windows.UI.Xaml.Build.Tasks.dll fails string name validation

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create a UWP project that targets 18970 (min is 17763)
  2. Add Microsoft.UI.Xaml NuGet package
  3. Build as usual (debug - x86 is fine)

Expected behavior
Compilation completes.

Screenshots

The build fails with the following output:

Severity    Code    Description Project File    Line    Suppression State
Error       The "Microsoft.Windows.UI.Xaml.Build.Tasks.CompileXaml" task could not be loaded from the assembly C:\Program Files (x86)\Windows Kits\10\bin\10.0.18970.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Build.Tasks.dll. Could not load file or assembly 'Microsoft.Windows.UI.Xaml.Build.Tasks, Version=10.0.18970.1001, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) Confirm that the <UsingTask> 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. Legere  C:\Program Files (x86)\Windows Kits\10\bin\10.0.18970.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets   312 

Version Info
Running Windows 10 1903 (18362) with 18970 Preview SDK installed to VS 2019 16.2.4.

NuGet package version:
Happens with both 2.2.19083001 and 2.1.1906001


| Windows 10 version | Saw the problem? |
| :--------------------------------- | :-------------------- |
| Insider Build (xxxxx) | No |
| May 2019 Update (18362) | Yes |
| October 2018 Update (17763) | |
| April 2018 Update (17134) | |
| Fall Creators Update (16299) | |
| Creators Update (15063) | |


| Device form factor | Saw the problem? |
| :-------------------- | :------------------- |
| Desktop | Yes |
| Mobile | |
| Xbox | |
| Surface Hub | |
| IoT | |

Additional context

team-Controls

Most helpful comment

Bingo, the following command (in VS2019 Dev Cmd Prompt) worked like a charm:

sn -Vr "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18970.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Build.Tasks.dll"

Result:
image

Consequence: Successful builds of preview SDK targets projects on 1903 build machine. Fantastic!

All 6 comments

Screenshot to verify the SDK is installed and the assembly is present at the expected path:

image

Seems like SDK bits may not be properly signed. I'll follow up.

@KevinLaMS pointed out this blog post:

https://blogs.windows.com/windowsdeveloper/2019/09/03/windows-10-sdk-preview-build-18970-available-now/#d4gwDir0xVE1dHbl.97

Which says:

"This build of the Windows SDK will install on only on Windows 10 Insider Preview builds."

So they're signed but only in a way that is trusted on insider builds.

Since this is just .NET's strong name signing, you could run the "Sn" tool (-Vr if i remember correctly) to add the public key token as a trusted one on your PC.

Thanks, this is a departure from the older preview SDKs. I'll try Sn -Vr

Bingo, the following command (in VS2019 Dev Cmd Prompt) worked like a charm:

sn -Vr "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18970.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Build.Tasks.dll"

Result:
image

Consequence: Successful builds of preview SDK targets projects on 1903 build machine. Fantastic!

Was this page helpful?
0 / 5 - 0 ratings