简体   繁体   中英

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

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.

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM