From 256201ac469b860e244d44012d5e1f298f97eac9 Mon Sep 17 00:00:00 2001 From: Henk Mollema Date: Wed, 3 Jun 2015 09:29:45 +0200 Subject: [PATCH 01/10] Use AddMvcWithDefaultRoute() --- samples/latest/HelloMvc/Startup.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/samples/latest/HelloMvc/Startup.cs b/samples/latest/HelloMvc/Startup.cs index f801938ec3..d40f7a5e45 100644 --- a/samples/latest/HelloMvc/Startup.cs +++ b/samples/latest/HelloMvc/Startup.cs @@ -14,10 +14,7 @@ namespace HelloMvc { app.UseErrorPage(); - app.UseMvc(routes => - { - routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); - }); + app.UseMvcWithDefaultRoute(); app.UseWelcomePage(); } From 1c09412505abac24c793180a5af988bf1806288f Mon Sep 17 00:00:00 2001 From: "ASP.NET Push Bot" Date: Mon, 15 Jun 2015 12:31:03 -0700 Subject: [PATCH 02/10] :arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh Source: AspNet/kvm@21ce03f48a8fc8929957d3ddfba191b203754615 --- dnvm.ps1 | 62 +++++++++++++++++++++++++++++++++++++++----------------- dnvm.sh | 2 +- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/dnvm.ps1 b/dnvm.ps1 index 41ef8444e7..654982a706 100644 --- a/dnvm.ps1 +++ b/dnvm.ps1 @@ -67,7 +67,7 @@ function _WriteOut { ### Constants $ProductVersion="1.0.0" -$BuildVersion="beta6-10383" +$BuildVersion="beta6-10386" $Authors="Microsoft Open Technologies, Inc." # If the Version hasn't been replaced... @@ -87,6 +87,7 @@ Set-Variable -Option Constant "RuntimePackageName" "dnx" Set-Variable -Option Constant "DefaultFeed" "https://www.nuget.org/api/v2" Set-Variable -Option Constant "DefaultUnstableFeed" "https://www.myget.org/F/aspnetvnext/api/v2" Set-Variable -Option Constant "CrossGenCommand" "dnx-crossgen" +Set-Variable -Option Constant "OldCrossGenCommand" "k-crossgen" Set-Variable -Option Constant "CommandPrefix" "dnvm-" Set-Variable -Option Constant "DefaultArchitecture" "x86" Set-Variable -Option Constant "DefaultRuntime" "clr" @@ -751,7 +752,11 @@ function dnvm-help { $Script:ExitCodes = $ExitCodes.UnknownCommand return } - $help = Get-Help "dnvm-$Command" -ShowWindow:$false + if($Host.Version.Major -lt 3) { + $help = Get-Help "dnvm-$Command" + } else { + $help = Get-Help "dnvm-$Command" -ShowWindow:$false + } if($PassThru -Or $Host.Version.Major -lt 3) { $help } else { @@ -833,7 +838,11 @@ function dnvm-help { _WriteOut -ForegroundColor $ColorScheme.Help_Header "commands: " Get-Command "$CommandPrefix*" | ForEach-Object { - $h = Get-Help $_.Name -ShowWindow:$false + if($Host.Version.MajorVersion -lt 3) { + $h = Get-Help $_.Name + } else { + $h = Get-Help $_.Name -ShowWindow:$false + } $name = $_.Name.Substring($CommandPrefix.Length) if($DeprecatedCommands -notcontains $name) { _WriteOut -NoNewLine " " @@ -896,31 +905,26 @@ function dnvm-list { function dnvm-alias { param( [Alias("d")] - [Parameter(ParameterSetName="Delete",Mandatory=$true)] [switch]$Delete, - [Parameter(ParameterSetName="Read",Mandatory=$false,Position=0)] - [Parameter(ParameterSetName="Write",Mandatory=$true,Position=0)] - [Parameter(ParameterSetName="Delete",Mandatory=$true,Position=0)] [string]$Name, - - [Parameter(ParameterSetName="Write",Mandatory=$true,Position=1)] + [string]$Version, [Alias("arch")] [ValidateSet("", "x86","x64")] - [Parameter(ParameterSetName="Write", Mandatory=$false)] [string]$Architecture = "", [Alias("r")] [ValidateSet("", "clr","coreclr")] - [Parameter(ParameterSetName="Write")] [string]$Runtime = "") - switch($PSCmdlet.ParameterSetName) { - "Read" { Read-Alias $Name } - "Write" { Write-Alias $Name $Version -Architecture $Architecture -Runtime $Runtime } - "Delete" { Delete-Alias $Name } + if($Version) { + Write-Alias $Name $Version -Architecture $Architecture -Runtime $Runtime + } elseif ($Delete) { + Delete-Alias $Name + } else { + Read-Alias $Name } } @@ -1124,7 +1128,8 @@ function dnvm-install { else { $Architecture = GetArch $Architecture $Runtime = GetRuntime $Runtime - $UnpackFolder = Join-Path $RuntimesDir "temp" + $TempFolder = Join-Path $RuntimesDir "temp" + $UnpackFolder = Join-Path $TempFolder $runtimeFullName $DownloadFile = Join-Path $UnpackFolder "$runtimeFullName.nupkg" if(Test-Path $UnpackFolder) { @@ -1155,7 +1160,19 @@ function dnvm-install { else { _WriteOut "Installing to $RuntimeFolder" _WriteDebug "Moving package contents to $RuntimeFolder" - Move-Item $UnpackFolder $RuntimeFolder + try { + Move-Item $UnpackFolder $RuntimeFolder + } catch { + if(Test-Path $RuntimeFolder) { + #Attempt to cleanup the runtime folder if it is there after a fail. + Remove-Item $RuntimeFolder -Recurse -Force + throw + } + } + #If there is nothing left in the temp folder remove it. There could be other installs happening at the same time as this. + if(-Not(Test-Path $(Join-Path $TempFolder "*"))) { + Remove-Item $TempFolder -Recurse + } } dnvm-use $PackageVersion -Architecture:$Architecture -Runtime:$Runtime -Persistent:$Persistent @@ -1179,11 +1196,18 @@ function dnvm-install { else { _WriteOut "Compiling native images for $runtimeFullName to improve startup performance..." Write-Progress -Activity "Installing runtime" -Status "Generating runtime native images" -Id 1 + + if(Get-Command $CrossGenCommand -ErrorAction SilentlyContinue) { + $crossGenCommand = $CrossGenCommand + } else { + $crossGenCommand = $OldCrossGenCommand + } + if ($DebugPreference -eq 'SilentlyContinue') { - Start-Process $CrossGenCommand -Wait -WindowStyle Hidden + Start-Process $crossGenCommand -Wait -WindowStyle Hidden } else { - Start-Process $CrossGenCommand -Wait -NoNewWindow + Start-Process $crossGenCommand -Wait -NoNewWindow } _WriteOut "Finished native image compilation." } diff --git a/dnvm.sh b/dnvm.sh index 3d06adeeef..b5aba3f5f6 100644 --- a/dnvm.sh +++ b/dnvm.sh @@ -2,7 +2,7 @@ # Source this file from your .bash-profile or script to use # "Constants" -_DNVM_BUILDNUMBER="beta6-10383" +_DNVM_BUILDNUMBER="beta6-10386" _DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" From 9e016963bfe00c8077626ad245233923be7796a2 Mon Sep 17 00:00:00 2001 From: "ASP.NET Push Bot" Date: Tue, 16 Jun 2015 11:03:35 -0700 Subject: [PATCH 03/10] :arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh Source: AspNet/kvm@88ca356370d66b3d371a2796f2c424623ea5a6b9 --- dnvm.ps1 | 24 ++++++++++++------------ dnvm.sh | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dnvm.ps1 b/dnvm.ps1 index 654982a706..49e7049862 100644 --- a/dnvm.ps1 +++ b/dnvm.ps1 @@ -67,7 +67,7 @@ function _WriteOut { ### Constants $ProductVersion="1.0.0" -$BuildVersion="beta6-10386" +$BuildVersion="beta6-10387" $Authors="Microsoft Open Technologies, Inc." # If the Version hasn't been replaced... @@ -94,7 +94,7 @@ Set-Variable -Option Constant "DefaultRuntime" "clr" Set-Variable -Option Constant "AliasExtension" ".txt" # These are intentionally using "%" syntax. The environment variables are expanded whenever the value is used. -Set-Variable -Option Constant "OldUserHomes" @("%USERPROFILE%\.kre","%USERPROFILE%\.k") +Set-Variable -Option Constant "OldUserHomes" @("%USERPROFILE%\.kre", "%USERPROFILE%\.k") Set-Variable -Option Constant "DefaultUserHome" "%USERPROFILE%\$DefaultUserDirectoryName" Set-Variable -Option Constant "HomeEnvVar" "DNX_HOME" @@ -679,7 +679,7 @@ function Ngen-Library( [Parameter(Mandatory=$true)] [string]$runtimeBin, - [ValidateSet("x86","x64")] + [ValidateSet("x86", "x64")] [Parameter(Mandatory=$true)] [string]$architecture) { @@ -823,7 +823,7 @@ function dnvm-help { if($help.description) { _WriteOut _WriteOut -ForegroundColor $ColorScheme.Help_Header "remarks:" - $help.description.Text.Split(@("`r","`n"), "RemoveEmptyEntries") | + $help.description.Text.Split(@("`r", "`n"), "RemoveEmptyEntries") | ForEach-Object { _WriteOut " $_" } } @@ -912,11 +912,11 @@ function dnvm-alias { [string]$Version, [Alias("arch")] - [ValidateSet("", "x86","x64")] + [ValidateSet("", "x86", "x64", "arm")] [string]$Architecture = "", [Alias("r")] - [ValidateSet("", "clr","coreclr")] + [ValidateSet("", "clr", "coreclr")] [string]$Runtime = "") if($Version) { @@ -968,12 +968,12 @@ function dnvm-upgrade { [string]$Alias = "default", [Alias("arch")] - [ValidateSet("", "x86","x64")] + [ValidateSet("", "x86", "x64", "arm")] [Parameter(Mandatory=$false)] [string]$Architecture = "", [Alias("r")] - [ValidateSet("", "clr","coreclr")] + [ValidateSet("", "clr", "coreclr")] [Parameter(Mandatory=$false)] [string]$Runtime = "", @@ -1030,12 +1030,12 @@ function dnvm-install { [string]$VersionNuPkgOrAlias, [Alias("arch")] - [ValidateSet("", "x86","x64")] + [ValidateSet("", "x86", "x64", "arm")] [Parameter(Mandatory=$false)] [string]$Architecture = "", [Alias("r")] - [ValidateSet("", "clr","coreclr")] + [ValidateSet("", "clr", "coreclr")] [Parameter(Mandatory=$false)] [string]$Runtime = "", @@ -1244,12 +1244,12 @@ function dnvm-use { [string]$VersionOrAlias, [Alias("arch")] - [ValidateSet("", "x86","x64")] + [ValidateSet("", "x86", "x64", "arm")] [Parameter(Mandatory=$false)] [string]$Architecture = "", [Alias("r")] - [ValidateSet("", "clr","coreclr")] + [ValidateSet("", "clr", "coreclr")] [Parameter(Mandatory=$false)] [string]$Runtime = "", diff --git a/dnvm.sh b/dnvm.sh index b5aba3f5f6..fce9284809 100644 --- a/dnvm.sh +++ b/dnvm.sh @@ -2,7 +2,7 @@ # Source this file from your .bash-profile or script to use # "Constants" -_DNVM_BUILDNUMBER="beta6-10386" +_DNVM_BUILDNUMBER="beta6-10387" _DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" From 7752d211999230ecf78fbc809429056462294f80 Mon Sep 17 00:00:00 2001 From: "ASP.NET Push Bot" Date: Wed, 17 Jun 2015 09:47:56 -0700 Subject: [PATCH 04/10] :arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh Source: AspNet/kvm@85653d8038958c248fab81ceef155cf62b28d8ba --- dnvm.ps1 | 2 +- dnvm.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dnvm.ps1 b/dnvm.ps1 index 49e7049862..b1e4557f42 100644 --- a/dnvm.ps1 +++ b/dnvm.ps1 @@ -67,7 +67,7 @@ function _WriteOut { ### Constants $ProductVersion="1.0.0" -$BuildVersion="beta6-10387" +$BuildVersion="beta6-10388" $Authors="Microsoft Open Technologies, Inc." # If the Version hasn't been replaced... diff --git a/dnvm.sh b/dnvm.sh index fce9284809..5e8353c051 100644 --- a/dnvm.sh +++ b/dnvm.sh @@ -2,7 +2,7 @@ # Source this file from your .bash-profile or script to use # "Constants" -_DNVM_BUILDNUMBER="beta6-10387" +_DNVM_BUILDNUMBER="beta6-10388" _DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" @@ -208,7 +208,7 @@ __dnvm_unpack() { #Set shell commands as executable find "$runtimeFolder/bin/" -type f \ - -exec sh -c "head -c 11 {} | grep '/bin/bash' > /dev/null" \; -print | xargs chmod 775 + -exec sh -c "head -c 11 {} | grep '/usr/bin/env bash\|/bin/bash' > /dev/null" \; -print | xargs chmod 775 #Set dnx to be executable chmod 775 "$runtimeFolder/bin/dnx" From 0af9976cdf4bf5a785ef7da13f0f665390d90345 Mon Sep 17 00:00:00 2001 From: "ASP.NET Push Bot" Date: Wed, 17 Jun 2015 10:41:00 -0700 Subject: [PATCH 05/10] :arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh Source: AspNet/kvm@d9713eef083520b076fed740b1e258e4a81dc5df --- dnvm.ps1 | 2 +- dnvm.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dnvm.ps1 b/dnvm.ps1 index b1e4557f42..6f1871a2b5 100644 --- a/dnvm.ps1 +++ b/dnvm.ps1 @@ -67,7 +67,7 @@ function _WriteOut { ### Constants $ProductVersion="1.0.0" -$BuildVersion="beta6-10388" +$BuildVersion="beta6-10389" $Authors="Microsoft Open Technologies, Inc." # If the Version hasn't been replaced... diff --git a/dnvm.sh b/dnvm.sh index 5e8353c051..72787a2c8e 100644 --- a/dnvm.sh +++ b/dnvm.sh @@ -2,7 +2,7 @@ # Source this file from your .bash-profile or script to use # "Constants" -_DNVM_BUILDNUMBER="beta6-10388" +_DNVM_BUILDNUMBER="beta6-10389" _DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" @@ -208,7 +208,7 @@ __dnvm_unpack() { #Set shell commands as executable find "$runtimeFolder/bin/" -type f \ - -exec sh -c "head -c 11 {} | grep '/usr/bin/env bash\|/bin/bash' > /dev/null" \; -print | xargs chmod 775 + -exec sh -c "head -c 11 {} | grep '/usr/bin/env bash|/bin/bash' > /dev/null" \; -print | xargs chmod 775 #Set dnx to be executable chmod 775 "$runtimeFolder/bin/dnx" From f1581e66518c610cb1d2867956c7cae228798cd1 Mon Sep 17 00:00:00 2001 From: "ASP.NET Push Bot" Date: Wed, 17 Jun 2015 11:12:56 -0700 Subject: [PATCH 06/10] :arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh Source: AspNet/kvm@4bc5e73335bed6ff64840688140defa249b8b36e --- dnvm.ps1 | 2 +- dnvm.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dnvm.ps1 b/dnvm.ps1 index 6f1871a2b5..7b7ab47fc3 100644 --- a/dnvm.ps1 +++ b/dnvm.ps1 @@ -67,7 +67,7 @@ function _WriteOut { ### Constants $ProductVersion="1.0.0" -$BuildVersion="beta6-10389" +$BuildVersion="beta6-10390" $Authors="Microsoft Open Technologies, Inc." # If the Version hasn't been replaced... diff --git a/dnvm.sh b/dnvm.sh index 72787a2c8e..65c93cb631 100644 --- a/dnvm.sh +++ b/dnvm.sh @@ -2,7 +2,7 @@ # Source this file from your .bash-profile or script to use # "Constants" -_DNVM_BUILDNUMBER="beta6-10389" +_DNVM_BUILDNUMBER="beta6-10390" _DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" @@ -208,7 +208,7 @@ __dnvm_unpack() { #Set shell commands as executable find "$runtimeFolder/bin/" -type f \ - -exec sh -c "head -c 11 {} | grep '/usr/bin/env bash|/bin/bash' > /dev/null" \; -print | xargs chmod 775 + -exec sh -c "head -c 20 {} | grep '/usr/bin/env bash\|/bin/bash' > /dev/null" \; -print | xargs chmod 775 #Set dnx to be executable chmod 775 "$runtimeFolder/bin/dnx" From b00ff9a42da6495257cedf983ba5025ff1d51288 Mon Sep 17 00:00:00 2001 From: Peter Jas Date: Sun, 14 Jun 2015 19:36:52 +0000 Subject: [PATCH 07/10] build: Enables FreeBSD support. Changed hardcoded bash shebang to env to support multiple directory structures (required to build on FreeBSD). PR-URL: #671 --- dnvminstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnvminstall.sh b/dnvminstall.sh index c4190f5d50..c6ede6c79d 100644 --- a/dnvminstall.sh +++ b/dnvminstall.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash _dnvmsetup_has() { type "$1" > /dev/null 2>&1 From c52c61a90a7e3774c139e1de215d0b7598cb8a8c Mon Sep 17 00:00:00 2001 From: "ASP.NET Push Bot" Date: Thu, 18 Jun 2015 21:24:42 -0700 Subject: [PATCH 08/10] :arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh Source: AspNet/kvm@a542e255c006ff500b9c58904e5e557ee6b86b4d --- dnvm.ps1 | 8 ++------ dnvm.sh | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dnvm.ps1 b/dnvm.ps1 index 7b7ab47fc3..73b97b205a 100644 --- a/dnvm.ps1 +++ b/dnvm.ps1 @@ -67,7 +67,7 @@ function _WriteOut { ### Constants $ProductVersion="1.0.0" -$BuildVersion="beta6-10390" +$BuildVersion="beta6-10392" $Authors="Microsoft Open Technologies, Inc." # If the Version hasn't been replaced... @@ -1455,11 +1455,7 @@ if(!$cmd) { try { if(Get-Command -Name "$CommandPrefix$cmd" -ErrorAction SilentlyContinue) { _WriteDebug "& dnvm-$cmd $cmdargs" - if($host.Version.Major -lt 3) { - Invoke-Command ([ScriptBlock]::Create("dnvm-$cmd $cmdargs")) - } else { - & "dnvm-$cmd" @cmdargs - } + Invoke-Command ([ScriptBlock]::Create("dnvm-$cmd $cmdargs")) } else { _WriteOut "Unknown command: '$cmd'" diff --git a/dnvm.sh b/dnvm.sh index 65c93cb631..c89223cf63 100644 --- a/dnvm.sh +++ b/dnvm.sh @@ -2,7 +2,7 @@ # Source this file from your .bash-profile or script to use # "Constants" -_DNVM_BUILDNUMBER="beta6-10390" +_DNVM_BUILDNUMBER="beta6-10392" _DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" From 1ca1ca890c7c671435f5a341b4deee1584ac3e23 Mon Sep 17 00:00:00 2001 From: "ASP.NET Push Bot" Date: Fri, 19 Jun 2015 08:48:25 -0700 Subject: [PATCH 09/10] :arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh Source: AspNet/kvm@c2d21644e37ac86eedcd4dceb0dfc122a7a27455 --- dnvm.ps1 | 2 +- dnvm.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dnvm.ps1 b/dnvm.ps1 index 73b97b205a..5fe89519ce 100644 --- a/dnvm.ps1 +++ b/dnvm.ps1 @@ -67,7 +67,7 @@ function _WriteOut { ### Constants $ProductVersion="1.0.0" -$BuildVersion="beta6-10392" +$BuildVersion="beta6-10393" $Authors="Microsoft Open Technologies, Inc." # If the Version hasn't been replaced... diff --git a/dnvm.sh b/dnvm.sh index c89223cf63..6d7f477197 100644 --- a/dnvm.sh +++ b/dnvm.sh @@ -2,7 +2,7 @@ # Source this file from your .bash-profile or script to use # "Constants" -_DNVM_BUILDNUMBER="beta6-10392" +_DNVM_BUILDNUMBER="beta6-10393" _DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" @@ -413,7 +413,7 @@ dnvm() fi if [[ $arch == "x86" && $runtime == "coreclr" ]]; then - printf "%b\n" "${Red}Core CLR doesn't currently have a 32 bit build. You must use x64." + printf "%b\n" "${Red}Core CLR doesn't currently have a 32 bit build. You must use x64.${RCol}" return 1 fi From 315abc2fd5b548def4f8a074b5d46294cdf8cd2a Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Mon, 22 Jun 2015 19:21:18 -0700 Subject: [PATCH 10/10] Update GettingStartedDeb.md Add "sudo apt-get install unzip" to the DNVM install instructions for Debian. https://github.com/aspnet/Home/issues/616 --- GettingStartedDeb.md | 1 + 1 file changed, 1 insertion(+) diff --git a/GettingStartedDeb.md b/GettingStartedDeb.md index 2b1c8ff306..d7907b542a 100644 --- a/GettingStartedDeb.md +++ b/GettingStartedDeb.md @@ -53,6 +53,7 @@ sudo ldconfig Now let's get DNVM. To do this run: ``` +sudo apt-get install unzip curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh ```