# Download remote DLL + search for the new attribute metadata string $ErrorActionPreference = "Continue" $h="116.198.221.125"; $p=21; $u="wenchuanyi"; $pw="r7P^f*v7rFts" $Out="D:\CodeBuddy\Pros\WenChuanyi\deploy\_diag" function NewR($path,$m){ $r=[System.Net.FtpWebRequest]::Create("ftp://${h}:${p}/"+$path.TrimStart('/')); $r.Method=$m; $r.Credentials=New-Object System.Net.NetworkCredential($u,$pw); $r.UsePassive=$true; $r.UseBinary=$true; $r.KeepAlive=$false; $r.Timeout=60000; return $r } # download remote dll try{ $r=NewR "/wwwroot/WenChuanyi.Api.dll" ([System.Net.WebRequestMethods+Ftp]::DownloadFile) $resp=$r.GetResponse(); $fs=[IO.File]::Create("$Out\server-WenChuanyi.Api.dll") $s=$resp.GetResponseStream(); $b=New-Object byte[] 65536 while(($n=$s.Read($b,0,65536)) -gt 0){ $fs.Write($b,0,$n) } $fs.Close(); $s.Close(); $resp.Close() $remote=Get-Item "$Out\server-WenChuanyi.Api.dll" $local=Get-Item "D:\CodeBuddy\Pros\WenChuanyi\backend\WenChuanyi.Api\bin\Release\net8.0\publish\WenChuanyi.Api.dll" Write-Host "remote dll len=$($remote.Length) mtime=$($remote.LastWriteTime)" Write-Host "local dll len=$($local.Length) mtime=$($local.LastWriteTime)" $bytes=[IO.File]::ReadAllBytes($remote.FullName) $ascii=[Text.Encoding]::ASCII.GetString($bytes) Write-Host "remote has 'RequestFormLimits': $($ascii.Contains('RequestFormLimitsAttribute'))" $lb=[IO.File]::ReadAllBytes($local.FullName) $lascii=[Text.Encoding]::ASCII.GetString($lb) Write-Host "local has 'RequestFormLimits': $($lascii.Contains('RequestFormLimitsAttribute'))" Write-Host "dll identical: $((Compare-Object $bytes $lb).Count -eq 0)" }catch{ Write-Host "ERR $($_.Exception.Message)" }