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