Azure DevOps release pipeline - How to resolve Strong Name Validation issue

1

I have a C# exe which is referring to some other dlls and the dlls are signed using a strong name key. It works fine when I execute this in my local system. But when I call the same exe from Azure release pipeline, it is giving me the below error.

System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)

I tried sn.exe -Vr "dll path" for all the referred dlls. And also tried the command bypassTrustedAppStrongNames enabled="false" & "true" within the exe's app.config. But both didn't help.

Can anyone please suggest a solution for this. Thanks in advance.

c#
dll
azure-devops
azure-pipelines
asked on Stack Overflow May 21, 2020 by Tinz • edited May 22, 2020 by Tinz

3 Answers

1

You can try to search for System.Management.Automation reference in the csproj file and replace that with <Reference Include="System.Management.Automation" />

For this ,please refer to this case with similar issue.

answered on Stack Overflow May 28, 2020 by Hugh Lin - MSFT
0

You can try to disable the strong name validation in an application level by adding the following snippet in an Application Configuration File

<configuration>  
  <runtime>  
    <bypassTrustedAppStrongNames enabled="true" />  
  </runtime>  
</configuration>  

For more info you can take a look in Microsoft documentation page

answered on Stack Overflow May 21, 2020 by Stelios Giakoumidis
0

I'm not sure you will have permissions to skip validation on a hosted agent. So you can either make your own agent or

  • Remove the strong name of the dependencies or rebuild them with no strong name.
  • Sign your application.
answered on Stack Overflow May 22, 2020 by David Watson

User contributions licensed under CC BY-SA 3.0