Benutzer:MovGP0/NuGet

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      

[Bearbeiten | Quelltext bearbeiten]
Attribute Example
id id:jQuery
title title:GoogleAnalyticsTracker
description description:dependency injection
(dependency or injection)
authors authors:maartenba
owners owners:xavierdecoster
tags tags:mvc
Command Description
Get-Package -ListAvailable -Filter "NewtonSoft.Json" -AllVersions Finding a specific package
Install-Package jQuery -Version 1.9.0 Installing a specific version
Uninstall-Package EntityFramework Uninstalling a package
Uninstall-Package EntityFramework -Force Remove package even when another package depends on it
Uninstall-Package EntityFramework -RemoveDependencies Remove package and all packages which depend on it
Get-Package -Updates Find updates for installed packages
Update-Package jQuery -Version 1.9.1 Updates package and all dependent packages (in all projects)
Update-Package jQuery -Version 1.9.1 -IgnoreDependencies Updates package (in all projects)
Get-Package Get all packages installed in the current project
Get-Package -ListAvailable Get all installed packages
Update-Package -Reinstall Reinstalling package (ie. when retargeting the solution to another .NET version)
Get-Project HelloWorld, HelloWorld.Core | Install-Package log4net Install package in a list of projects
Get-Project -All | Install-Package log4net -Version 2.0.0 Install package in all projects
Get-Project -All | Uninstall-Package log4net  
Get-Project HelloWorld, HelloWorld.Core | Uninstall-Package Automapper  
Get-Project -All | Update-Package  
Version Description
1.0.0 stable
1.0.1 stable; bug fixes or internal changes
1.1.0-alpha alpha version of new feature
1.1.0-beta beta version of new feature
1.1.0 stable with new feature
2.0.0 stable with breaking changes
2.0.0-nightly nightly built of newest version

Installation Event Scripts

[Bearbeiten | Quelltext bearbeiten]
param($installPath, $toolsPath, $package, $project)
Skript Execution
\tools\init.ps1
  • First time the package is installed into a solution
  • Every time the solution opens
\tools\install.ps1
  • When package is installed into a solution
  • only when content is available in the \lib or \content folder
\tools\uninstall.ps1
  • When package is uninstalled from a solution

\tools\net40\install.ps1
\tools\net45\install.ps1
\tools\sl4\install.ps1

  • Framework dependent scripts
  • only install.ps1 and uninstall.ps1, but not init.ps1

Debugger Symbols

[Bearbeiten | Quelltext bearbeiten]
  • .pdb files are placed in the \src folder
Find Projects with a given package
$packageName = "..."
$version = "..."

$projects = get-project -all
foreach($project in $projects)
{
  $packages = $project | get-package | where {$_.Id -eq $packageName} | where {$_.Version = $version}
  foreach($package in $packages)
  {
    write-output $project
  }
}
Reverting to old version, when dependency failed
# get effected projects
$projects = get-project Project1,Project2

# uninstall current version
$projects | Uninstall-Package Apache.NMS.ActiveMQ -Force
$projects | Uninstall-Package Apache.NMS -Force

# install old version
$projects | Install-Package Apache.NMS -Version "1.5.0" 
$projects | Install-Package Apache.NMS.ActiveMQ -Version "1.5.1"