playwright-dotnet: Strong name signature could not be verified.

Hello,

I am trying to attach playwright 0.180.0 into my existing project on .Net Framework and I am receiving following error when trying to execute some basic test:

Error message:

System.IO.FileLoadException : Could not load file or assembly 'PlaywrightSharp, Version=0.180.0.0, Culture=neutral, > > PublicKeyToken=db12f80f85d8ba23' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

Sample code:

        [Fact]
        public async Task Test1()
        {
            IPlaywright playwright = await Playwright.CreateAsync();
            PlaywrightSharp.Chromium.IChromiumBrowser browser = await playwright.Chromium.LaunchAsync();
            var page = await browser.NewPageAsync();
            await page.GoToAsync("http://www.bing.com");
            await page.ScreenshotAsync(path: "");
        }

It will be cool to give it a try. 😉

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 27 (14 by maintainers)

Most upvoted comments

@SimonCropp Indeed, we use PublicSign. sn will return an error, however, the relevant bit is set and the assembly is marked as signed, which you can verify:

> CorFlags.exe .\Microsoft.Playwright.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.8.3928.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 0x9
ILONLY    : 1
32BITREQ  : 0
32BITPREF : 0
Signed    : 1

Technically, for OSS projects, this seems to be the way to go. However, the following is called out as a problem:

  • You will not be able to install the assembly to the Global Assembly Cache (GAC)
  • You will not be able to load the assembly in an AppDomain where shadow copying is turned on.
  • You will not be able to load the assembly in a partially trusted AppDomain

I wonder if any of the above might be the cause of the validation error @12masta was seeing though?