Could you please try this:
$filtered_content = Get-Content C:\somepath\Setup.csproj | select-string -pattern '' -NotMatch ;
Remove-Item C:\somepath\Setup.csproj -Force ;
New-Item C:\somepath\Setup.csproj -type file -force -value "$filtered_content" ;
Tested in local with one file.