@@ -103,6 +103,42 @@ jobs:
103103 nuget verify -All $(pathToDownloadedNuget)\*.nupkg
104104 displayName: 'Verify nuget signature'
105105
106+ - powershell : |
107+ if($env:CDP_BUILD_TYPE -eq 'Official')
108+ {
109+ # Recursively find all .dll files in TempFolder (installed nuget folder)
110+ # Microsoft.Data.SqlClient.dll and Microsoft.Data.SqlClient.resources.dll (in localized folders) should have strong name
111+ $dllFiles = Get-ChildItem -Path $(TempFolderName) -Recurse -Filter *.dll
112+ $badDlls = @()
113+ foreach ($file in $dllFiles)
114+ {
115+ # Run sn.k to verify the strong name on each dll
116+ $result = & "C:\Program Files (x86)\Microsoft SDKs\Windows\*\bin\NETFX 4.8.1 Tools\sn.exe" -vf $file.FullName
117+ Write-OutPut $result
118+
119+ # if thhe dll is not valid, it would be delay signed or test-signed which is not meant for production
120+ if($result[$result.Length-1] -notlike "* is valid")
121+ {
122+ $badDlls += $result[$result.Length-1]
123+ }
124+ }
125+ if($badDlls.Count -gt 0)
126+ {
127+ Write-OutPut "Error: Invalid dlls are detected. Chek below list:"
128+ foreach($dll in $badDlls)
129+ {
130+ Write-Output $dll
131+ }
132+ Exit -1
133+ }
134+ Write-Host "Strong name has been verified for all dlls"
135+ }
136+ else
137+ {
138+ Write-OutPut "Strong name verification is not required for non-official builds"
139+ }
140+ displayName: 'Verify strong name is generated for production'
141+
106142 - powershell : |
107143 # Checks the expected folder names such as lib, ref, runtimes
108144 Get-ChildItem -Path $(extractedNugetPath) -Directory | select Name | foreach {
@@ -205,7 +241,6 @@ jobs:
205241 }
206242 }
207243 displayName: 'Verify all DLLs unzipped match "expected" hierarchy'
208-
209244 - powershell : |
210245 # Verify all dlls status are Valid
211246
0 commit comments