Advertisement
private775

VS Custom Tools

Feb 18th, 2015
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Package (DEBUG)
  2. # C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
  3. # /t:PACKAGE /p:Configuration=Debug /detailedsummary /nologo "$(ProjectFileName)"
  4. # $(ProjectDir)
  5.  
  6. ############# Get Full Assembly Name ##################################
  7. # C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  8. # -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command "& { GetFullAssemblyName '$(TargetPath)' }"
  9. # $(TargetDir)
  10.  
  11. function GetFullAssemblyName([string]$dllPath){
  12.     Write-Host "$([System.Reflection.AssemblyName]::GetAssemblyName($dllPath).FullName)"
  13. }
  14.  
  15. ############# Copy to GAC ##################################
  16. # C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  17. # -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command "& { CopyToGac '$(TargetPath)' } "
  18. # $(BinDir)
  19.  
  20. function CopyToGac([string]$dllPath){
  21.     $asName = [System.Reflection.AssemblyName]::GetAssemblyName($dllPath).FullName
  22.     Write-Host "Removing $($asName) from GAC"
  23.     GACUTIL /u $asName
  24.     Write-Host "Adding $($dllPath) to GAC"
  25.     GACUTIL /i $dllPath
  26.     iisreset /noforce
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement