param($installPath, $toolsPath, $package, $project)

if ($project.Type -eq 'Web Site') {
    Import-Module (Join-Path $toolsPath VS.psd1)

    $projectRoot = Get-ProjectRoot $project
    if (!$projectRoot) {
        return;
    }
    $binDirectory = Join-Path $projectRoot "bin"
    $srcDirectory = Join-Path $installPath "lib\net40\"
    $fileSystem = Get-VsFileSystem
    
    ls $srcDirectory -Filter *.dll | %{
        $fileName = $_.Name
        $fileInBin = Join-Path $binDirectory $fileName
        if ($fileSystem.FileExists($fileInBin) -and ((Get-Item $fileInBin).Length -eq $_.Length)) {
            # If a corresponding file exists in bin and has the exact file size as the one inside the package, it's most likely the same file.
            try {
                $fileSystem.DeleteFile($fileInBin)
                
            } catch {
                # We don't want an exception to surface if we can't delete the file
            }
        }
    }
}
# SIG # Begin signature block
# MIIbJQYJKoZIhvcNAQcCoIIbFjCCGxICAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU5eFmkhW/FlQBz1yONQogDyby
# xJGgghXyMIIEoDCCA4igAwIBAgIKYRr16gAAAAAAajANBgkqhkiG9w0BAQUFADB5
# MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVk
# bW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSMwIQYDVQQDExpN
# aWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQTAeFw0xMTExMDEyMjM5MTdaFw0xMzAy
# MDEyMjQ5MTdaMIGDMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQ
# MA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u
# MQ0wCwYDVQQLEwRNT1BSMR4wHAYDVQQDExVNaWNyb3NvZnQgQ29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