Merge branch 'release/2.0.0' into merge_release_200_master

* release/2.0.0: (104 commits)
  Updating NuGet.
  Remove redundant error handling from project provider, add a better message for deserialization exceptions
  Temporarily change the runtime deb pkg name to unblock the integration.
  insert new bits of TestPlatform which has bug fixes.
  Add missing using directive
  Only catch JsonException in the method that dispatches to the appropriate handlers
  Shorten names a bit more, make project names match folder names
  Shorten test project names
  Fix flow from the refactoring
  Remove NuGet.Configs, add inversion of the launch profile flag, move profile application logic to its own method
  Make errors more specific, add support for setting the launch URL for ASP.NET apps
  Add missed launch settings, fix NuGet.configs, remove unused packages
  Ad tests, fix issue where profile not found isn't an error
  Initial add of launchSettings.json support
  Update to SetupCrossgen 134 - Coherence 25332
  Fix dotnet-deb-tool path.
  Update dotnet-deb-tool to 2.0.0-preview2-25331-01
  Shorten names a bit more, make project names match folder names
  Shorten test project names
  Re-enable telemetry for new
  ...
This commit is contained in:
Livar Cunha 2017-06-01 12:53:51 -07:00
commit ad831a3bdc
76 changed files with 1386 additions and 342 deletions

View file

@ -1,4 +1,4 @@
.NET CLI preview 3 is coming, and with it comes the .csproj project file format and msbuild engine. The team has put a lot of focus on making the transition as seamless as possible, but as with any change of this magnitude there are some gotcha's to keep in mind. This issue explains how to use the .NET CLI during this transitional period.
.NET CLI preview 3 is here, and with it comes the .csproj project file format and msbuild engine. The team has put a lot of focus on making the transition as seamless as possible, but as with any change of this magnitude there are some gotcha's to keep in mind. This issue explains how to use the .NET CLI during this transitional period.
# Overview
Starting with @coolcsh's great post [Changes to Project.json](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/) the team has been hard at work moving the .NET command line story from project.json to msbuild. Our plan was fairly straightforward:
@ -60,3 +60,4 @@ When `preview2` shipped the Visual Studio new project templates included both a
We included this file by default as a future-proofing tactic. When the CLI launches it looks for this file in the current directory, or the nearest parent directory, and tries to find a matching version of itself. If an exact match is found then it is used. Otherwise, `dotnet.exe` picks the latest installed CLI. When there is no exact match AND preview3 is installed then we get into trouble because preview3 cannot reason about project.json files.
When working with `preview2` and `preview3` on the same machine we need to be sure that `preview2` projects have a global.json present and that the `version` property is set to an installed preview2 version. This will typically be `1.0.0-preview2-003121` or `1.0.0-preview2-003131`. You can check what is installed by looking in `%PROGRAM FILES%\dotnet\sdk` and checking the folder names.

View file

@ -15,5 +15,7 @@
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="vstest" value="https://dotnet.myget.org/F/vstest/api/v3/index.json" />
<add key="build_tools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="AspNetCurrent" value="https://dotnet.myget.org/F/aspnet-feb2017-patch/api/v3/index.json" />
<add key="web-api" value="https://dotnet.myget.org/F/dotnet-web/api/v3/index.json" />
</packageSources>
</configuration>

View file

@ -23,9 +23,9 @@ This project has adopted the code of conduct defined by the [Contributor Covenan
Build Status
------------
|Ubuntu 14.04 / Linux Mint 17 |Ubuntu 16.04 |Debian 8 |Windows x64 |Windows x86 |macOS |CentOS 7.1 / Oracle Linux 7.1 |RHEL 7.2 | Linux x64 |
|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|
|[![][ubuntu-14.04-build-badge]][ubuntu-14.04-build]|[![][ubuntu-16.04-build-badge]][ubuntu-16.04-build]|[![][debian-8-build-badge]][debian-8-build]|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][centos-build-badge]][centos-build]|[![][rhel-build-badge]][rhel-build]|[![][linux-build-badge]][linux-build]|
|Ubuntu 14.04 / Linux Mint 17 |Ubuntu 16.04 | Ubuntu 16.10 |Debian 8 |Windows x64 |Windows x86 |macOS |CentOS 7.1 / Oracle Linux 7.1 |RHEL 7.2 | Linux x64 |
|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|
|[![][ubuntu-14.04-build-badge]][ubuntu-14.04-build]|[![][ubuntu-16.04-build-badge]][ubuntu-16.04-build]|[![][ubuntu-16.10-build-badge]][ubuntu-16.10-build]|[![][debian-8-build-badge]][debian-8-build]|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][centos-build-badge]][centos-build]|[![][rhel-build-badge]][rhel-build]|[![][linux-build-badge]][linux-build]|
[win-x64-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5449/badge
[win-x64-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5449
@ -39,6 +39,9 @@ Build Status
[ubuntu-16.04-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5448/badge
[ubuntu-16.04-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5448
[ubuntu-16.10-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5760/badge
[ubuntu-16.10-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5760
[debian-8-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5442/badge
[debian-8-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5442
@ -69,7 +72,8 @@ In order to download just the .NET Core runtime without the SDK, please visit ht
| **Windows x64** | [Installer][win-x64-installer] - [Checksum][win-x64-installer-checksum]<br>[zip][win-x64-zip] - [Checksum][win-x64-zip-checksum] |
| **Windows x86** | [Installer][win-x86-installer] - [Checksum][win-x86-installer-checksum]<br>[zip][win-x86-zip] - [Checksum][win-x86-zip-checksum] |
| **Ubuntu 14.04 / Linux Mint 17** | [Installer][ubuntu-14.04-installer] - [Checksum][ubuntu-14.04-installer-checksum]<br>*See Installer Note Below<br>[tar.gz][ubuntu-14.04-targz] - [Checksum][ubuntu-14.04-targz-checksum] |
| **Ubuntu 16.04** | [tar.gz][ubuntu-16.04-targz] - [Checksum][ubuntu-16.04-targz-checksum] |
| **Ubuntu 16.04** | [Installer][ubuntu-16.04-installer] - [Checksum][ubuntu-16.04-installer-checksum]<br>*See Installer Note Below<br>[tar.gz][ubuntu-16.04-targz] - [Checksum][ubuntu-16.04-targz-checksum] |
| **Ubuntu 16.10** | [Installer][ubuntu-16.10-installer] - [Checksum][ubuntu-16.10-installer-checksum]<br>*See Installer Note Below<br>[tar.gz][ubuntu-16.10-targz] - [Checksum][ubuntu-16.10-targz-checksum] |
| **Debian 8** | [tar.gz][debian-8-targz] - [Checksum][debian-8-targz-checksum] |
| **macOS** | [Installer][osx-installer] - [Checksum][osx-installer-checksum]<br>[tar.gz][osx-targz] - [Checksum][osx-targz-checksum] |
| **CentOS 7.1 / Oracle Linux 7** | [tar.gz][centos-targz] - [Checksum][centos-targz-checksum] |
@ -97,9 +101,16 @@ In order to download just the .NET Core runtime without the SDK, please visit ht
[ubuntu-14.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu-x64.latest.tar.gz
[ubuntu-14.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu-x64.latest.tar.gz.sha
[ubuntu-16.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.04-x64.latest.deb
[ubuntu-16.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.04-x64.latest.deb.sha
[ubuntu-16.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz
[ubuntu-16.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz.sha
[ubuntu-16.10-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.10-x64.latest.deb
[ubuntu-16.10-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu.16.10-x64.latest.deb.sha
[ubuntu-16.10-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.10-x64.latest.tar.gz
[ubuntu-16.10-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.10-x64.latest.tar.gz.sha
[debian-8-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-debian-x64.latest.tar.gz
[debian-8-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-debian-x64.latest.tar.gz.sha
@ -123,8 +134,8 @@ Newest SDK binaries for 2.0.0 in debian feed may be delayed due to external issu
## Obtaining binaries
Add debian feed:
### Add debian feed:
Ubuntu 14.04
```
sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
@ -133,12 +144,39 @@ sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
```
Install:
Ubuntu 16.04
```
sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
```
Ubuntu 16.10
```
sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet/ yakkety main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
```
Debian 8
```
sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet/ jessie main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
```
### Install:
```
sudo apt-get install <DebianPackageName>=<Version>
```
To list available packages:
### To list available packages:
```
apt-cache search dotnet-sdk | grep 2.0.0
```

View file

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,26 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace MSBuildTestApp
{
public class Program
{
public static void Main(string[] args)
{
if (args.Length > 0)
{
Console.WriteLine("echo args:" + string.Join(";", args));
}
string message = Environment.GetEnvironmentVariable("Message");
if (string.IsNullOrEmpty(message))
{
message = "(NO MESSAGE)";
}
Console.WriteLine(message);
}
}
}

View file

@ -0,0 +1,29 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49850/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"First": {
"commandName": "Project",
"environmentVariables": [ ]
},
"Second": {
"commandName": "Project",
"environmentVariables": {
"Message": "Second"
}
}
}
}

View file

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,26 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace MSBuildTestApp
{
public class Program
{
public static void Main(string[] args)
{
if (args.Length > 0)
{
Console.WriteLine("echo args:" + string.Join(";", args));
}
string message = Environment.GetEnvironmentVariable("Message");
if (string.IsNullOrEmpty(message))
{
message = "(NO MESSAGE)";
}
Console.WriteLine(message);
}
}
}

View file

@ -0,0 +1,31 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49850/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"First": {
"commandName": "Project",
"environmentVariables": {
"Message": "First"
}
},
"Second": {
"commandName": "Project",
"environmentVariables": {
"Message": "Second"
}
}
}
}

View file

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,26 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace MSBuildTestApp
{
public class Program
{
public static void Main(string[] args)
{
if (args.Length > 0)
{
Console.WriteLine("echo args:" + string.Join(";", args));
}
string message = Environment.GetEnvironmentVariable("Message");
if (string.IsNullOrEmpty(message))
{
message = "(NO MESSAGE)";
}
Console.WriteLine(message);
}
}
}

View file

@ -0,0 +1,19 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49850/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View file

@ -1,9 +1,9 @@
<Project ToolsVersion="14.0">
<PropertyGroup>
<SdkBrandName>Microsoft .NET Core 2.1.0 - Preview 1 SDK</SdkBrandName>
<SharedFrameworkBrandName>Microsoft .NET Core 2.0.0 - Runtime</SharedFrameworkBrandName>
<SharedHostBrandName>Microsoft .NET Core 2.0.0 - Host</SharedHostBrandName>
<HostFxrBrandName>Microsoft .NET Core 2.0.0 - Host FX Resolver</HostFxrBrandName>
<SdkBrandName>Microsoft .NET Core SDK 2.1.0 - Preview 1</SdkBrandName>
<SharedFrameworkBrandName>Microsoft .NET Core Runtime 2.0.0</SharedFrameworkBrandName>
<SharedHostBrandName>Microsoft .NET Core Host 2.0.0</SharedHostBrandName>
<HostFxrBrandName>Microsoft .NET Core Host FX Resolver 2.0.0</HostFxrBrandName>
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
<SharedFrameworkNugetName>$(SharedFrameworkName)</SharedFrameworkNugetName>
@ -17,12 +17,12 @@
<ArtifactNameSdk>dotnet-sdk</ArtifactNameSdk>
<ArtifactNameSdkDebug>dotnet-sdk-debug</ArtifactNameSdkDebug>
<ArtifactNameCombinedHostHostFxrFrameworkSdk>dotnet-dev</ArtifactNameCombinedHostHostFxrFrameworkSdk>
<ArtifactNameCombinedFrameworkSdk>dotnet-sharedframework-sdk</ArtifactNameCombinedFrameworkSdk>
<ArtifactNameCombinedFrameworkSdk>dotnet-runtime-sdk</ArtifactNameCombinedFrameworkSdk>
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionSdk>
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionSdkDebug>
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
<ArtifactNameWithVersionCombinedFrameworkSdk>$(ArtifactNameCombinedFrameworkSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionCombinedFrameworkSdk>
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdkDebug>
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
<ArtifactNameWithVersionCombinedFrameworkSdk>$(ArtifactNameCombinedFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedFrameworkSdk>
</PropertyGroup>
</Project>

View file

@ -3,21 +3,24 @@
<CoreSetupRid>$(Rid)</CoreSetupRid>
<CoreSetupRid Condition=" '$(OSName)' == 'win' or '$(OSName)' == 'osx' ">$(ProductMonikerRid)</CoreSetupRid>
<!-- only the runtime OSX .pkgs have a `-internal` suffix -->
<InstallerStartSuffix Condition="'$(OSName)' == 'osx'">-internal</InstallerStartSuffix>
<!-- Downloaded Installers + Archives -->
<DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host-$(CoreSetupRid).$(SharedHostVersion)$(InstallerExtension)</DownloadedSharedHostInstallerFileName>
<DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerExtension)</DownloadedSharedHostInstallerFileName>
<DownloadedSharedHostInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedSharedHostInstallerFileName)</DownloadedSharedHostInstallerFile>
<DownloadedHostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr-$(CoreSetupRid).$(HostFxrVersion)$(InstallerExtension)</DownloadedHostFxrInstallerFileName>
<DownloadedHostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr$(InstallerStartSuffix)-$(HostFxrVersion)-$(CoreSetupRid)$(InstallerExtension)</DownloadedHostFxrInstallerFileName>
<DownloadedHostFxrInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedHostFxrInstallerFileName)</DownloadedHostFxrInstallerFile>
<DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(CoreSetupRid).$(SharedFrameworkVersion)$(InstallerExtension)</DownloadedSharedFrameworkInstallerFileName>
<DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-runtime$(InstallerStartSuffix)-$(SharedFrameworkVersion)-$(CoreSetupRid)$(InstallerExtension)</DownloadedSharedFrameworkInstallerFileName>
<DownloadedSharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedSharedFrameworkInstallerFileName)</DownloadedSharedFrameworkInstallerFile>
<!-- Use the portable linux-x64 Rid when downloading the shared framework compressed file.
NOTE: There isn't a 'linux-x64' version of the installers or the additional shared framweork. -->
<SharedFrameworkRid>$(CoreSetupRid)</SharedFrameworkRid>
<SharedFrameworkRid Condition=" '$(UsePortableLinuxSharedFramework)' == 'true' ">linux-x64</SharedFrameworkRid>
<CombinedFrameworkHostCompressedFileName>dotnet-$(SharedFrameworkRid).$(SharedFrameworkVersion)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
<CombinedFrameworkHostCompressedFileName>dotnet-runtime-$(SharedFrameworkVersion)-$(SharedFrameworkRid)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
</PropertyGroup>
<PropertyGroup>

View file

@ -17,9 +17,6 @@
<Copy SourceFiles="@(SdkContent)"
DestinationFiles="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
<!-- Remove unused directories for FSharp.NET.Sdk, just Sdk directory is needed -->
<RemoveDir Condition=" '$([System.IO.Path]::GetFileName($(SdkLayoutDirectory)))' == 'FSharp.NET.Sdk' " Directories="$(SdkLayoutDirectory)/build;$(SdkLayoutDirectory)/buildCrossTargeting" />
<Message Text="Copied Sdk $(SdkPackageName) from $(SdkNuPkgPath) to $(SdkLayoutDirectory)."
Importance="High" />
</Target>

View file

@ -5,6 +5,6 @@
<BundledSdk Include="Microsoft.NET.Sdk.Web" Version="$(CLI_WEBSDK_Version)" />
<BundledSdk Include="Microsoft.NET.Sdk.Publish" Version="$(CLI_WEBSDK_Version)" />
<BundledSdk Include="Microsoft.NET.Sdk.Web.ProjectSystem" Version="$(CLI_WEBSDK_Version)" />
<BundledSdk Include="FSharp.NET.Sdk" Version="1.0.0-beta-040011" />
<BundledSdk Include="FSharp.NET.Sdk" Version="1.0.4-bundled-0100" />
</ItemGroup>
</Project>

View file

@ -1,37 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CLI_SharedFrameworkVersion>2.0.0-preview2-25319-02</CLI_SharedFrameworkVersion>
<CLI_SharedFrameworkVersion>2.0.0-preview2-25331-01</CLI_SharedFrameworkVersion>
<CLI_MSBuild_Version>15.3.0-preview-000246-05</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.3.0-beta2-61716-09</CLI_Roslyn_Version>
<CLI_DiaSymNative_Version>1.6.0-beta2-25304</CLI_DiaSymNative_Version>
<CLI_FSharp_Version>1.0.0-rc-170511-0</CLI_FSharp_Version>
<CLI_NETSDK_Version>2.0.0-preview2-20170506-1</CLI_NETSDK_Version>
<CLI_NuGet_Version>4.3.0-preview1-2500</CLI_NuGet_Version>
<CLI_NETSDK_Version>2.0.0-preview2-20170531-2</CLI_NETSDK_Version>
<CLI_NuGet_Version>4.3.0-preview2-4082</CLI_NuGet_Version>
<CLI_WEBSDK_Version>2.0.0-rel-20170518-512</CLI_WEBSDK_Version>
<CLI_TestPlatform_Version>15.3.0-preview-20170502-03</CLI_TestPlatform_Version>
<CLI_TestPlatform_Version>15.3.0-preview-20170601-03</CLI_TestPlatform_Version>
<SharedFrameworkVersion>$(CLI_SharedFrameworkVersion)</SharedFrameworkVersion>
<SharedHostVersion>$(CLI_SharedFrameworkVersion)</SharedHostVersion>
<HostFxrVersion>$(CLI_SharedFrameworkVersion)</HostFxrVersion>
<TemplateEngineVersion>1.0.0-beta2-20170523-241</TemplateEngineVersion>
<TemplateEngineTemplateVersion>1.0.0-beta2-20170523-241</TemplateEngineTemplateVersion>
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170523-241</TemplateEngineTemplate2_0Version>
<PlatformAbstractionsVersion>2.0.0-preview2-25319-02</PlatformAbstractionsVersion>
<DependencyModelVersion>2.0.0-preview2-25319-02</DependencyModelVersion>
<TemplateEngineVersion>1.0.0-beta2-20170531-247</TemplateEngineVersion>
<TemplateEngineTemplateVersion>1.0.0-beta2-20170531-247</TemplateEngineTemplateVersion>
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170531-247</TemplateEngineTemplate2_0Version>
<PlatformAbstractionsVersion>2.0.0-preview2-25331-01</PlatformAbstractionsVersion>
<DependencyModelVersion>2.0.0-preview2-25331-01</DependencyModelVersion>
<CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion>
<CliMigrateVersion>1.2.1-alpha-002130</CliMigrateVersion>
<MicroBuildVersion>0.2.0</MicroBuildVersion>
<!-- This should either be timestamped or notimestamp as appropriate -->
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
<AspNetCoreRuntimeVersion>dev-125</AspNetCoreRuntimeVersion>
<AspNetCoreCoherenceTimestamp>preview2-25159</AspNetCoreCoherenceTimestamp>
<AspNetCoreRuntimeVersion>dev-134</AspNetCoreRuntimeVersion>
<AspNetCoreCoherenceTimestamp>preview2-25332</AspNetCoreCoherenceTimestamp>
</PropertyGroup>
<!-- infrastructure and test only dependencies -->
<PropertyGroup>
<VersionToolsVersion>1.0.27-prerelease-01611-04</VersionToolsVersion>
<DotnetDebToolVersion>2.0.0-preview1-001877</DotnetDebToolVersion>
<DotnetDebToolVersion>2.0.0-preview2-25331-01</DotnetDebToolVersion>
</PropertyGroup>
</Project>

View file

@ -10,7 +10,7 @@
<PropertyGroup>
<DotnetDebToolConsumerProjectName>dotnet-deb-tool-consumer.csproj</DotnetDebToolConsumerProjectName>
<DotnetDebToolDir>$(IntermediateDirectory)/$(DotnetDebToolConsumerProjectName)</DotnetDebToolDir>
<PackageTool>$(NuGetPackagesDir)/dotnet-deb-tool/$(DotnetDebToolVersion)/lib/netcoreapp1.0/tool/package_tool</PackageTool>
<PackageTool>$(NuGetPackagesDir)/dotnet-deb-tool/$(DotnetDebToolVersion)/lib/netcoreapp2.0/tool/package_tool</PackageTool>
</PropertyGroup>
<!-- constants -->
@ -29,10 +29,10 @@
<SdkDebianPackageVersion>$(SdkVersion)</SdkDebianPackageVersion>
<SdkDebianPackageName>dotnet-dev-$(SdkDebianPackageVersion)</SdkDebianPackageName>
<SharedFxDebianPackageVersion>$(SharedFrameworkVersion)</SharedFxDebianPackageVersion>
<SharedFxDebianPackageName>dotnet-sharedframework-$(SharedFrameworkName)-$(SharedFxDebianPackageVersion)</SharedFxDebianPackageName>
<SharedFxDebianPackageName>dotnet-runtime-$(SharedFxDebianPackageVersion)-$(CoreSetupRid)</SharedFxDebianPackageName>
<SharedFxDebianPackageName>$(SharedFxDebianPackageName.ToLower())</SharedFxDebianPackageName>
<HostFxrDebianPackageVersion>$(HostFxrVersion)</HostFxrDebianPackageVersion>
<HostFxrDebianPackageName>dotnet-hostfxr-$(HostFxrDebianPackageVersion)</HostFxrDebianPackageName>
<HostFxrDebianPackageName>dotnet-hostfxr-$(HostFxrDebianPackageVersion)-$(CoreSetupRid)</HostFxrDebianPackageName>
<HostFxrDebianPackageName>$(HostFxrDebianPackageName.ToLower())</HostFxrDebianPackageName>
<HostDebianPackageName>dotnet-host</HostDebianPackageName>
</PropertyGroup>

View file

@ -9,11 +9,11 @@ param(
if($Help)
{
Write-Host "Usage: .\update-dependencies.ps1"
Write-Host ""
Write-Host "Options:"
Write-Host " -Help Display this help message"
Write-Host " -Update Update dependencies (but don't open a PR)"
Write-Output "Usage: .\update-dependencies.ps1"
Write-Output ""
Write-Output "Options:"
Write-Output " -Help Display this help message"
Write-Output " -Update Update dependencies (but don't open a PR)"
exit 0
}
@ -35,7 +35,7 @@ if (!$env:DOTNET_INSTALL_DIR)
}
# Install a stage 0
Write-Host "Installing .NET Core CLI Stage 0"
Write-Output "Installing .NET Core CLI Stage 0"
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
@ -43,11 +43,11 @@ if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
# Restore the app
Write-Host "Restoring $ProjectPath..."
Write-Output "Restoring $ProjectPath..."
dotnet restore "$ProjectPath"
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
# Run the app
Write-Host "Invoking App $ProjectPath..."
Write-Output "Invoking App $ProjectPath..."
dotnet run -p "$ProjectPath" "$ProjectArgs"
if($LASTEXITCODE -ne 0) { throw "Build failed" }

View file

@ -7,9 +7,12 @@ echo "Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry
.NET Core Tools Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry."
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry."
su - $SUDO_USER -c "dotnet new > /dev/null 2>&1 || true"

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -7,22 +7,22 @@
<body>
<font face="Helvetica">
<h3>
Welcome to .NET Core!
Installation completed successfully. Welcome to .NET Core!
</h3>
<p>
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
</p>
<h3>
Telemetry
.NET Core Tools Telemetry
</h3>
<p>
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
</p>
<h3>
Configuration
</h3>
<p>
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
</p>
<p>
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
</p>
</font>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
<Window Width="620" Height="468" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
<Window Width="620" Height="418" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
<Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="FFFFFF">Segoe UI</Font>
<Font Id="1" Height="-24" Weight="900" Foreground="FFFFFF" Background="682079">Segoe UI</Font>
<Font Id="2" Height="-22" Weight="500" Foreground="666666">Segoe UI</Font>
@ -52,7 +52,6 @@
<Text X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Text>
<Text X="11" Y="121" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Text>
<Text Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Text>
<Text X="160" Y="180" Width="442" Height="300" FontId="3">#(loc.FirstTimeWelcomeMessage)</Text>
<Progressbar Name="OverallCalculatedProgressbar" X="11" Y="143" Width="-11" Height="15" />
<Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
</Page>
@ -70,7 +69,7 @@
<Text X="0" Y="0" Width="620" Height="75" FontId="1" />
<Text Name="SuccessHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessHeader)</Text>
<Text Name="SuccessInstallHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessInstallHeader)</Text>
<Richedit Name="SuccessInstallHeader" X="158" Y="81" Width="-12" Height="-71" FontId="5" HideWhenDisabled="yes">#(loc.FirstTimeWelcomeMessage)</Richedit>
<Text Name="SuccessRepairHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessRepairHeader)</Text>
<Text Name="SuccessUninstallHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessUninstallHeader)</Text>
<Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>

View file

@ -31,7 +31,6 @@ Ready? Set? Let's go!</String>
<String Id="ModifyCloseButton">&amp;Close</String>
<String Id="SuccessRepairHeader">Repair Successfully Completed</String>
<String Id="SuccessUninstallHeader">Uninstall Successfully Completed</String>
<String Id="SuccessInstallHeader">Installation Successfully Completed</String>
<String Id="SuccessHeader">Setup Successful</String>
<String Id="SuccessLaunchButton">&amp;Launch</String>
<String Id="SuccessRestartText">You must restart your computer before you can use the software.</String>
@ -51,11 +50,16 @@ Ready? Set? Let's go!</String>
<String Id="FilesInUseDontCloseRadioButton">&amp;Do not close applications. A reboot will be required.</String>
<String Id="FilesInUseOkButton">&amp;OK</String>
<String Id="FilesInUseCancelButton">&amp;Cancel</String>
<String Id="FirstTimeWelcomeMessage">Welcome to .NET Core!
<String Id="FirstTimeWelcomeMessage">Installation completed successfully. Welcome to .NET Core!
Learn more about .NET Core at https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry:
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry.
Configuration:
A command is running in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
.NET Core Tools Telemetry
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry.
</String>
</WixLocalization>

View file

@ -25,7 +25,7 @@ function RunCandleForBundle
$result = $true
pushd "$WixRoot"
Write-Host Running candle for bundle..
Write-Output Running candle for bundle..
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
.\candle.exe -nologo `
@ -52,7 +52,7 @@ function RunCandleForBundle
if($LastExitCode -ne 0)
{
$result = $false
Write-Host "Candle failed with exit code $LastExitCode."
Write-Output "Candle failed with exit code $LastExitCode."
}
popd
@ -64,7 +64,7 @@ function RunLightForBundle
$result = $true
pushd "$WixRoot"
Write-Host Running light for bundle..
Write-Output Running light for bundle..
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
.\light.exe -nologo `
@ -80,7 +80,7 @@ function RunLightForBundle
if($LastExitCode -ne 0)
{
$result = $false
Write-Host "Light failed with exit code $LastExitCode."
Write-Output "Light failed with exit code $LastExitCode."
}
popd
@ -98,7 +98,7 @@ if(!(Test-Path $ASPNETRuntimeWixLibFile))
throw "$ASPNETRuntimeWixLibFile not found"
}
Write-Host "Creating dotnet Bundle at $DotnetBundleOutput"
Write-Output "Creating dotnet Bundle at $DotnetBundleOutput"
if([string]::IsNullOrEmpty($WixRoot))
{
@ -121,6 +121,6 @@ if(!(Test-Path $DotnetBundleOutput))
Exit -1
}
Write-Host -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
Write-Output -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
exit $LastExitCode

View file

@ -24,14 +24,14 @@ function RunHeat
$result = $true
pushd "$WixRoot"
Write-Host Running heat..
Write-Output Running heat..
.\heat.exe dir `"$inputDir`" -template fragment -sreg -gg -var var.DotnetSrc -cg InstallFiles -srd -dr DOTNETHOME -out $InstallFileswsx | Out-Host
if($LastExitCode -ne 0)
{
$result = $false
Write-Host "Heat failed with exit code $LastExitCode."
Write-Output "Heat failed with exit code $LastExitCode."
}
popd
@ -43,7 +43,7 @@ function RunCandle
$result = $true
pushd "$WixRoot"
Write-Host Running candle..
Write-Output Running candle..
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
.\candle.exe -nologo `
@ -64,7 +64,7 @@ function RunCandle
if($LastExitCode -ne 0)
{
$result = $false
Write-Host "Candle failed with exit code $LastExitCode."
Write-Output "Candle failed with exit code $LastExitCode."
}
popd
@ -76,7 +76,7 @@ function RunLight
$result = $true
pushd "$WixRoot"
Write-Host Running light..
Write-Output Running light..
$CabCache = Join-Path $WixRoot "cabcache"
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
@ -95,7 +95,7 @@ function RunLight
if($LastExitCode -ne 0)
{
$result = $false
Write-Host "Light failed with exit code $LastExitCode."
Write-Output "Light failed with exit code $LastExitCode."
}
popd
@ -107,7 +107,7 @@ if(!(Test-Path $inputDir))
throw "$inputDir not found"
}
Write-Host "Creating dotnet MSI at $DotnetMSIOutput"
Write-Output "Creating dotnet MSI at $DotnetMSIOutput"
if([string]::IsNullOrEmpty($WixRoot))
{
@ -135,6 +135,6 @@ if(!(Test-Path $DotnetMSIOutput))
Exit -1
}
Write-Host -ForegroundColor Green "Successfully created dotnet MSI - $DotnetMSIOutput"
Write-Output -ForegroundColor Green "Successfully created dotnet MSI - $DotnetMSIOutput"
exit $LastExitCode

View file

@ -25,7 +25,7 @@ function DownloadNugetExe
}
if (-not (Test-Path $NuGetExe)) {
Write-Host 'Downloading nuget.exe to ' + $NuGetExe
Write-Output 'Downloading nuget.exe to ' + $NuGetExe
wget https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe -OutFile $NuGetExe
}
}
@ -34,7 +34,7 @@ function GenerateNupkg
{
if (-not (Test-Path $NuspecFile))
{
Write-Host 'Error nuspec not found - $NuspecFile'
Write-Output 'Error nuspec not found - $NuspecFile'
}
$SdkBundlePath = [System.IO.Path]::GetFullPath($SdkBundlePath)
@ -50,7 +50,7 @@ if(!(Test-Path $SdkBundlePath))
throw "$SdkBundlePath not found"
}
Write-Host "Creating nupkg for Sdk installer"
Write-Output "Creating nupkg for Sdk installer"
DownloadNugetExe
@ -69,6 +69,6 @@ if(!(Test-Path $NupkgFile))
throw "$NupkgFile not generated"
}
Write-Host -ForegroundColor Green "Successfully created installer nupkg - $NupkgFile"
Write-Output -ForegroundColor Green "Successfully created installer nupkg - $NupkgFile"
exit $LastExitCode

View file

@ -16,14 +16,14 @@ param(
if($Help)
{
Write-Host "Usage: .\build.ps1 [-Configuration <CONFIGURATION>] [-Architecture <ARCHITECTURE>] [-NoPackage] [-Help]"
Write-Host ""
Write-Host "Options:"
Write-Host " -Configuration <CONFIGURATION> Build the specified Configuration (Debug or Release, default: Debug)"
Write-Host " -Architecture <ARCHITECTURE> Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)"
Write-Host " -NoPackage Skip packaging targets"
Write-Host " -NoBuild Skip building the product"
Write-Host " -Help Display this help message"
Write-Output "Usage: .\build.ps1 [-Configuration <CONFIGURATION>] [-Architecture <ARCHITECTURE>] [-NoPackage] [-Help]"
Write-Output ""
Write-Output "Options:"
Write-Output " -Configuration <CONFIGURATION> Build the specified Configuration (Debug or Release, default: Debug)"
Write-Output " -Architecture <ARCHITECTURE> Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)"
Write-Output " -NoPackage Skip packaging targets"
Write-Output " -NoBuild Skip building the product"
Write-Output " -Help Display this help message"
exit 0
}
@ -80,16 +80,15 @@ $env:VSTEST_TRACE_BUILD=1
# install a stage0
$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1"
Write-Host "$dotnetInstallPath -Channel ""master"" -Version ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
Invoke-Expression "$dotnetInstallPath -Channel ""master"" ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
Write-Output "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
if ($LastExitCode -ne 0)
{
Write-Output "The .NET CLI installation failed with exit code $LastExitCode"
exit $LastExitCode
}
Write-Host "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
Write-Output "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
if ($LastExitCode -ne 0)
{
@ -102,8 +101,8 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
if ($NoBuild)
{
Write-Host "Not building due to --nobuild"
Write-Host "Command that would be run: 'dotnet msbuild build.proj /m /p:Architecture=$Architecture $ExtraParameters'"
Write-Output "Not building due to --nobuild"
Write-Output "Command that would be run: 'dotnet msbuild build.proj /m /p:Architecture=$Architecture $ExtraParameters'"
}
else
{

View file

@ -155,7 +155,7 @@ export VSTEST_TRACE_BUILD=1
DOTNET_MULTILEVEL_LOOKUP=0
# Install a stage 0
(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --version "2.0.0-preview1-005867" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS)
(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS)
EXIT_CODE=$?
if [ $EXIT_CODE != 0 ]; then
echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2

View file

@ -5,17 +5,17 @@
function header([string]$message)
{
Write-Host -ForegroundColor Green "*** $message ***"
Write-Output -ForegroundColor Green "*** $message ***"
}
function info([string]$message)
{
Write-Host -ForegroundColor Yellow "*** $message ***"
Write-Output -ForegroundColor Yellow "*** $message ***"
}
function error([string]$message)
{
Write-Host -ForegroundColor Red "$message"
Write-Output -ForegroundColor Red "$message"
}
function setEnvIfDefault([string]$envVarName, [string]$value)

View file

@ -15,7 +15,7 @@ try {
if (Test-Path $stage2) {
$env:PATH="$stage2;$env:PATH"
} else {
Write-Host "You don't have a dev build in the 'artifacts\$rid\stage2' folder!"
Write-Output "You don't have a dev build in the 'artifacts\$rid\stage2' folder!"
}
dotnet @args

View file

@ -136,5 +136,12 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \
-e COMMITCOUNT \
-e DROPSUFFIX \
-e RELEASESUFFIX \
-e COREFXAZURECONTAINER \
-e AZUREACCOUNTNAME \
-e AZUREACCESSTOKEN \
-e VSOPASSWORD \
-e RELEASETOOLSGITURL \
-e CORESETUPBLOBROOTURL \
-e CORESETUPBLOBACCESSTOKEN \
$DOTNET_BUILD_CONTAINER_TAG \
$BUILD_COMMAND "$@"

View file

@ -80,7 +80,7 @@ $VersionRegEx="/\d+\.\d+[^/]+/"
$OverrideNonVersionedFiles=$true
function Say($str) {
Write-Host "dotnet-install: $str"
Write-Output "dotnet-install: $str"
}
function Say-Verbose($str) {
@ -93,6 +93,25 @@ function Say-Invocation($Invocation) {
Say-Verbose "$command $args"
}
function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [int]$MaxAttempts = 3, [int]$SecondsBetweenAttempts = 1) {
$Attempts = 0
while ($true) {
try {
return $ScriptBlock.Invoke()
}
catch {
$Attempts++
if ($Attempts -lt $MaxAttempts) {
Start-Sleep $SecondsBetweenAttempts
}
else {
throw
}
}
}
}
function Get-Machine-Architecture() {
Say-Invocation $MyInvocation
@ -135,6 +154,9 @@ function Load-Assembly([string] $Assembly) {
function GetHTTPResponse([Uri] $Uri)
{
Invoke-With-Retry(
{
$HttpClient = $null
try {
@ -181,6 +203,7 @@ function GetHTTPResponse([Uri] $Uri)
$HttpClient.Dispose()
}
}
})
}
@ -223,10 +246,23 @@ function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel,
}
}
function Get-Download-Links([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
function Get-Download-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
Say-Invocation $MyInvocation
$ret = @()
if ($SharedRuntime) {
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
}
else {
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-$SpecificVersion-win-$CLIArchitecture.zip"
}
Say-Verbose "Constructed primary payload URL: $PayloadURL"
return $PayloadURL
}
function Get-AltDownload-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
Say-Invocation $MyInvocation
if ($SharedRuntime) {
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip"
@ -235,10 +271,9 @@ function Get-Download-Links([string]$AzureFeed, [string]$Channel, [string]$Speci
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip"
}
Say-Verbose "Constructed payload URL: $PayloadURL"
$ret += $PayloadURL
Say-Verbose "Constructed alternate payload URL: $PayloadURL"
return $ret
return $PayloadURL
}
function Get-User-Share-Path() {
@ -396,13 +431,13 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
$DownloadLinks = Get-Download-Links -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
$AltDownloadLink = Get-AltDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
if ($DryRun) {
Say "Payload URLs:"
foreach ($DownloadLink in $DownloadLinks) {
Say "- $DownloadLink"
}
Say "Primary - $DownloadLink"
Say "Alternate - $AltDownloadLink"
Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir"
exit 0
}
@ -420,22 +455,30 @@ if ($IsSdkInstalled) {
New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null
$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "$((Get-Item $InstallRoot).PSDrive.Name):"
if ($free.Freespace / 1MB -le 250 ) {
Say "there is not enough disk space on drive c:"
$installDrive = $((Get-Item $InstallRoot).PSDrive.Name);
Write-Output "${installDrive}:";
$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "${installDrive}:"
if ($free.Freespace / 1MB -le 100 ) {
Say "There is not enough disk space on drive ${installDrive}:"
exit 0
}
foreach ($DownloadLink in $DownloadLinks) {
$ZipPath = [System.IO.Path]::GetTempFileName()
Say "Downloading $DownloadLink"
try {
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
}
catch {
$DownloadLink = $AltDownloadLink
$ZipPath = [System.IO.Path]::GetTempFileName()
Say "Downloading $DownloadLink"
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
}
Say "Extracting zip from $DownloadLink"
Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot
Remove-Item $ZipPath
}
Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath

View file

@ -398,9 +398,9 @@ construct_download_link() {
local download_link=null
if [ "$shared_runtime" = true ]; then
download_link="$azure_feed/Runtime/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz"
download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz"
else
download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz"
download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$specific_version-$osname-$normalized_architecture.tar.gz"
fi
echo "$download_link"
@ -615,10 +615,8 @@ calculate_vars() {
download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version)
say_verbose "download_link=$download_link"
if [ "$(uname)" = "Linux" ]; then
alt_download_link=$(construct_alt_download_link $azure_feed $channel $normalized_architecture $specific_version)
say_verbose "alt_download_link=$alt_download_link"
fi
install_root=$(resolve_installation_path $install_dir)
say_verbose "install_root=$install_root"
@ -640,8 +638,8 @@ install_dotnet() {
say "Downloading link: $download_link"
download "$download_link" $zip_path || download_failed=true
# if the download fails, download the alt_download_link [Linux only]
if [ "$(uname)" = "Linux" ] && [ "$download_failed" = true ]; then
# if the download fails, download the alt_download_link
if [ "$download_failed" = true ]; then
say "Cannot download: $download_link"
zip_path=$(mktemp $temporary_file_template)
say_verbose "Alternate zip path: $zip_path"
@ -768,9 +766,7 @@ check_min_reqs
calculate_vars
if [ "$dry_run" = true ]; then
say "Payload URL: $download_link"
if [ "$(uname)" = "Linux" ]; then
say "Alternate payload URL: $alt_download_link"
fi
say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir"
exit 0
fi

View file

@ -12,5 +12,5 @@ if (Test-Path $stage2) {
$env:PATH="$stage2;$env:PATH"
}
} else {
Write-Host "You don't have a dev build in the 'artifacts\win10-x64\stage2' folder!"
Write-Output "You don't have a dev build in the 'artifacts\win10-x64\stage2' folder!"
}

View file

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
using System.Collections.Generic;
using System.Linq;
using Microsoft.DotNet.Cli.Utils;

View file

@ -40,5 +40,10 @@ namespace Microsoft.Extensions.EnvironmentAbstractions
{
}
}
public void WriteAllText(string path, string content)
{
File.WriteAllText(path, content);
}
}
}

View file

@ -22,5 +22,7 @@ namespace Microsoft.Extensions.EnvironmentAbstractions
FileOptions fileOptions);
void CreateEmptyFile(string path);
void WriteAllText(string path, string content);
}
}

View file

@ -5,6 +5,7 @@ using Microsoft.Build.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Microsoft.DotNet.MSBuildSdkResolver
{
@ -50,21 +51,33 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
}
msbuildSdksDir = Path.Combine(netcoreSdkDir, "Sdks");
netcoreSdkVersion = new DirectoryInfo(netcoreSdkDir).Name;;
}
netcoreSdkVersion = new DirectoryInfo(netcoreSdkDir).Name;
if (!IsNetCoreSDKOveridden(netcoreSdkVersion) &&
IsNetCoreSDKSmallerThanTheMinimumVersion(netcoreSdkVersion, sdkReference.MinimumVersion))
if (IsNetCoreSDKSmallerThanTheMinimumVersion(netcoreSdkVersion, sdkReference.MinimumVersion))
{
return factory.IndicateFailure(
new[]
{
$"Version {netcoreSdkVersion} of the SDK is smaller than the minimum version"
$"Version {netcoreSdkVersion} of the .NET Core SDK is smaller than the minimum version"
+ $" {sdkReference.MinimumVersion} requested. Check that a recent enough .NET Core SDK is"
+ " installed, increase the minimum version specified in the project, or increase"
+ " the version specified in global.json."
});
}
string minimumMSBuildVersionString = GetMinimumMSBuildVersion(netcoreSdkDir);
var minimumMSBuildVersion = Version.Parse(minimumMSBuildVersionString);
if (context.MSBuildVersion < minimumMSBuildVersion)
{
return factory.IndicateFailure(
new[]
{
$"Version {netcoreSdkVersion} of the .NET Core SDK requires at least version {minimumMSBuildVersionString}"
+ $" of MSBuild. The current available version of MSBuild is {context.MSBuildVersion.ToString()}."
+ " Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild"
+ " version currently available."
});
}
}
string msbuildSdkDir = Path.Combine(msbuildSdksDir, sdkReference.Name, "Sdk");
if (!Directory.Exists(msbuildSdkDir))
@ -80,9 +93,18 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
return factory.IndicateSuccess(msbuildSdkDir, netcoreSdkVersion);
}
private bool IsNetCoreSDKOveridden(string netcoreSdkVersion)
private static string GetMinimumMSBuildVersion(string netcoreSdkDir)
{
return netcoreSdkVersion == null;
string minimumVersionFilePath = Path.Combine(netcoreSdkDir, "minimumMSBuildVersion");
if (!File.Exists(minimumVersionFilePath))
{
// smallest version that had resolver support and also
// greater than or equal to the version required by any
// .NET Core SDK that did not have this file.
return "15.3.0";
}
return File.ReadLines(minimumVersionFilePath).First().Trim();
}
private bool IsNetCoreSDKSmallerThanTheMinimumVersion(string netcoreSdkVersion, string minimumVersion)
@ -101,7 +123,7 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
return true;
}
return FXVersion.Compare(netCoreSdkFXVersion, minimumFXVersion) == -1;
return FXVersion.Compare(netCoreSdkFXVersion, minimumFXVersion) < 0;
}
private string ResolveNetcoreSdkDirectory(SdkResolverContext context)

View file

@ -21,6 +21,7 @@ namespace Microsoft.DotNet.Cli
.With(name: LocalizableStrings.CmdOutputDir)
.ForwardAsSingle(o => $"/p:OutputPath={o.Arguments.Single()}")),
CommonOptions.FrameworkOption(),
CommonOptions.RuntimeOption(),
CommonOptions.ConfigurationOption(),
CommonOptions.VerbosityOption());
}

View file

@ -1,4 +1,5 @@
using Microsoft.DotNet.Tools.Help;
using Microsoft.DotNet.Tools;
using Microsoft.DotNet.Tools.Help;
internal static class HelpUsageText
{
@ -31,7 +32,7 @@ path-to-application:
-d|--diagnostics {LocalizableStrings.SDKDiagnosticsCommandDefinition}
{LocalizableStrings.CommonOptions}:
-v|--verbose {LocalizableStrings.VerboseDefinition}
-v|--verbosity {CommonLocalizableStrings.VerbosityOptionDescription}
-h|--help {LocalizableStrings.HelpDefinition}
{LocalizableStrings.RunDotnetCommandHelpForMore}

View file

@ -19,11 +19,9 @@ namespace Microsoft.DotNet.Tools.Help
public const string CommonOptions = "Common options";
public const string VerboseDefinition = "Enable verbose output";
public const string DiagnosticsDefinition = "Enable diagnostic output";
public const string HelpDefinition = "Show help";
public const string HelpDefinition = "Show help.";
public const string HostOptions = "Host options (passed before the command)";

View file

@ -31,13 +31,18 @@ namespace Microsoft.DotNet.Tools.New
var sessionId = Environment.GetEnvironmentVariable(MSBuildForwardingApp.TelemetrySessionIdEnvironmentVariableName);
var telemetry = new Telemetry(new NuGetCacheSentinel(new CliFallbackFolderPathCalculator()), sessionId);
var logger = new TelemetryLogger(null);
//(name, props, measures) =>
//{
// if (telemetry.Enabled)
// {
// telemetry.TrackEvent(name, props, measures);
// }
//});
if (telemetry.Enabled)
{
logger = new TelemetryLogger((name, props, measures) =>
{
if (telemetry.Enabled)
{
telemetry.TrackEvent(name, props, measures);
}
});
}
return New3Command.Run(CommandName, CreateHost(), logger, FirstRun, args);
}

View file

@ -0,0 +1,13 @@
using Microsoft.DotNet.Cli.Utils;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.Tools.Run.LaunchSettings
{
public interface ILaunchSettingsProvider
{
string CommandName { get; }
LaunchSettingsApplyResult TryApplySettings(JObject document, JObject model, ref ICommand command);
}
}

View file

@ -0,0 +1,18 @@
namespace Microsoft.DotNet.Tools.Run.LaunchSettings
{
public class LaunchSettingsApplyResult
{
public LaunchSettingsApplyResult(bool success, string failureReason, string runAfterLaunch = null)
{
Success = success;
FailureReason = failureReason;
RunAfterLaunch = runAfterLaunch;
}
public bool Success { get; }
public string FailureReason { get; }
public string RunAfterLaunch { get; }
}
}

View file

@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.DotNet.Cli.Utils;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.Tools.Run.LaunchSettings
{
internal class LaunchSettingsManager
{
private const string ProfilesKey = "profiles";
private const string CommandNameKey = "commandName";
private const string DefaultProfileCommandName = "Project";
private static IReadOnlyDictionary<string, ILaunchSettingsProvider> _providers;
static LaunchSettingsManager()
{
_providers = new Dictionary<string, ILaunchSettingsProvider>
{
{ ProjectLaunchSettingsProvider.CommandNameValue, new ProjectLaunchSettingsProvider() }
};
}
public static LaunchSettingsApplyResult TryApplyLaunchSettings(string launchSettingsJsonContents, ref ICommand command, string profileName = null)
{
try
{
var model = JObject.Parse(launchSettingsJsonContents);
var profilesObject = model[ProfilesKey] as JObject;
if (profilesObject == null)
{
return new LaunchSettingsApplyResult(false, LocalizableStrings.LaunchProfilesCollectionIsNotAJsonObject);
}
JObject profileObject;
if (profileName == null)
{
profileObject = profilesObject
.Properties()
.FirstOrDefault(IsDefaultProfileType)?.Value as JObject;
}
else
{
profileObject = profilesObject[profileName] as JObject;
if (profileObject == null)
{
return new LaunchSettingsApplyResult(false, LocalizableStrings.LaunchProfileIsNotAJsonObject);
}
}
if (profileObject == null)
{
foreach (var prop in profilesObject.Properties())
{
var profile = prop.Value as JObject;
if (profile != null)
{
var cmdName = profile[CommandNameKey]?.Value<string>();
if (_providers.ContainsKey(cmdName))
{
profileObject = profile;
break;
}
}
}
}
var commandName = profileObject?[CommandNameKey]?.Value<string>();
if (profileObject == null)
{
return new LaunchSettingsApplyResult(false, LocalizableStrings.UsableLaunchProfileCannotBeLocated);
}
if (!TryLocateHandler(commandName, out ILaunchSettingsProvider provider))
{
return new LaunchSettingsApplyResult(false, string.Format(LocalizableStrings.LaunchProfileHandlerCannotBeLocated, commandName));
}
return provider.TryApplySettings(model, profileObject, ref command);
}
catch (JsonException ex)
{
return new LaunchSettingsApplyResult(false, string.Format(LocalizableStrings.DeserializationExceptionMessage, ex.Message));
}
}
private static bool TryLocateHandler(string commandName, out ILaunchSettingsProvider provider)
{
return _providers.TryGetValue(commandName, out provider);
}
private static bool IsDefaultProfileType(JProperty profileProperty)
{
JObject profile = profileProperty.Value as JObject;
var commandName = profile?[CommandNameKey]?.Value<string>();
return string.Equals(commandName, DefaultProfileCommandName, StringComparison.Ordinal);
}
}
}

View file

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using Microsoft.DotNet.Cli.Utils;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.Tools.Run.LaunchSettings
{
public class ProjectLaunchSettingsProvider : ILaunchSettingsProvider
{
public static readonly string CommandNameValue = "Project";
public string CommandName => CommandNameValue;
public LaunchSettingsApplyResult TryApplySettings(JObject document, JObject model, ref ICommand command)
{
var config = model.ToObject<ProjectLaunchSettingsModel>();
//For now, ignore everything but the environment variables section
foreach (var entry in config.EnvironmentVariables)
{
string value = Environment.ExpandEnvironmentVariables(entry.Value);
//NOTE: MSBuild variables are not expanded like they are in VS
command.EnvironmentVariable(entry.Key, value);
}
if (!string.IsNullOrEmpty(config.ApplicationUrl))
{
command.EnvironmentVariable("ASPNETCORE_URLS", config.ApplicationUrl);
}
return new LaunchSettingsApplyResult(true, null, config.LaunchUrl);
}
private class ProjectLaunchSettingsModel
{
public ProjectLaunchSettingsModel()
{
EnvironmentVariables = new Dictionary<string, string>();
}
public string CommandLineArgs { get; set; }
public bool LaunchBrowser { get; set; }
public string LaunchUrl { get; set; }
public string ApplicationUrl { get; set; }
public Dictionary<string, string> EnvironmentVariables { get; }
}
}
}

View file

@ -17,6 +17,10 @@ namespace Microsoft.DotNet.Tools.Run
public const string CommandOptionProjectDescription = "The path to the project file to run (defaults to the current directory if there is only one project).";
public const string CommandOptionLaunchProfileDescription = "The name of the launch profile (if any) to use when launching the application.";
public const string CommandOptionNoLaunchProfileDescription = "Do not attempt to use launchSettings.json to configure the application.";
public const string RunCommandException = "The build failed. Please fix the build errors and run again.";
public const string RunCommandExceptionUnableToRunSpecifyFramework = "Unable to run your project\nYour project targets multiple frameworks. Please specify which framework to run using '{0}'.";
@ -28,5 +32,25 @@ namespace Microsoft.DotNet.Tools.Run
public const string RunCommandExceptionMultipleProjects = "Specify which project file to use because {0} contains more than one project file.";
public const string RunCommandAdditionalArgsHelpText = "Arguments passed to the application that is being run.";
public const string RunCommandExceptionCouldNotLocateALaunchSettingsFile = "The specified launch profile could not be located.";
public const string RunCommandExceptionCouldNotApplyLaunchSettings = "The launch profile \"{0}\" could not be applied.\n{1}";
public const string DefaultLaunchProfileDisplayName = "(Default)";
public const string UsingLaunchSettingsFromMessage = "Using launch settings from {0}...";
public const string LaunchProfileIsNotAJsonObject = "Launch profile is not a JSON object.";
public const string LaunchProfileHandlerCannotBeLocated = "The launch profile type '{0}' is not supported.";
public const string UsableLaunchProfileCannotBeLocated = "A usable launch profile could not be located.";
public const string UnexpectedExceptionProcessingLaunchSettings = "An unexpected exception occurred while processing launch settings:\n{0}";
public const string LaunchProfilesCollectionIsNotAJsonObject = "The 'profiles' property of the launch settings document is not a JSON object.";
public const string DeserializationExceptionMessage = "An error was encountered when reading launchSettings.json.\n{0}";
}
}

View file

@ -8,6 +8,7 @@ using System.Linq;
using Microsoft.Build.Evaluation;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.MSBuild;
using Microsoft.DotNet.Tools.Run.LaunchSettings;
namespace Microsoft.DotNet.Tools.Run
{
@ -22,6 +23,10 @@ namespace Microsoft.DotNet.Tools.Run
private List<string> _args;
private bool ShouldBuild => !NoBuild;
public string LaunchProfile { get; private set; }
public bool NoLaunchProfile { get; private set; }
private bool UseLaunchProfile => !NoLaunchProfile;
public int Start()
{
Initialize();
@ -32,6 +37,12 @@ namespace Microsoft.DotNet.Tools.Run
}
ICommand runCommand = GetRunCommand();
int launchSettingsApplicationResult = ApplyLaunchProfileSettingsIfNeeded(ref runCommand);
if (launchSettingsApplicationResult != 0)
{
return launchSettingsApplicationResult;
}
return runCommand
.Execute()
@ -42,12 +53,16 @@ namespace Microsoft.DotNet.Tools.Run
string framework,
bool noBuild,
string project,
string launchProfile,
bool noLaunchProfile,
IReadOnlyCollection<string> args)
{
Configuration = configuration;
Framework = framework;
NoBuild = noBuild;
Project = project;
LaunchProfile = launchProfile;
NoLaunchProfile = noLaunchProfile;
Args = args;
}
@ -55,6 +70,8 @@ namespace Microsoft.DotNet.Tools.Run
string framework = null,
bool? noBuild = null,
string project = null,
string launchProfile = null,
bool? noLaunchProfile = null,
IReadOnlyCollection<string> args = null)
{
return new RunCommand(
@ -62,10 +79,50 @@ namespace Microsoft.DotNet.Tools.Run
framework ?? this.Framework,
noBuild ?? this.NoBuild,
project ?? this.Project,
launchProfile ?? this.LaunchProfile,
noLaunchProfile ?? this.NoLaunchProfile,
args ?? this.Args
);
}
private int ApplyLaunchProfileSettingsIfNeeded(ref ICommand runCommand)
{
if (UseLaunchProfile)
{
var buildPathContainer = File.Exists(Project) ? Path.GetDirectoryName(Project) : Project;
var launchSettingsPath = Path.Combine(buildPathContainer, "Properties", "launchSettings.json");
if (File.Exists(launchSettingsPath))
{
Reporter.Output.WriteLine(string.Format(LocalizableStrings.UsingLaunchSettingsFromMessage, launchSettingsPath));
string profileName = string.IsNullOrEmpty(LaunchProfile) ? LocalizableStrings.DefaultLaunchProfileDisplayName : LaunchProfile;
try
{
var launchSettingsFileContents = File.ReadAllText(launchSettingsPath);
var applyResult = LaunchSettingsManager.TryApplyLaunchSettings(launchSettingsFileContents, ref runCommand, LaunchProfile);
if (!applyResult.Success)
{
//Error that the launch profile couldn't be applied
Reporter.Error.WriteLine(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, profileName, applyResult.FailureReason).Bold().Red());
}
}
catch (IOException ex)
{
Reporter.Error.WriteLine(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, profileName).Bold().Red());
Reporter.Error.WriteLine(ex.Message.Bold().Red());
return -1;
}
}
else if (!string.IsNullOrEmpty(LaunchProfile))
{
//Error that the launch profile couldn't be found
Reporter.Error.WriteLine(LocalizableStrings.RunCommandExceptionCouldNotLocateALaunchSettingsFile.Bold().Red());
}
}
return 0;
}
private void EnsureProjectIsBuilt()
{
List<string> buildArgs = new List<string>();

View file

@ -21,6 +21,8 @@ namespace Microsoft.DotNet.Cli
framework: o.SingleArgumentOrDefault("--framework"),
noBuild: o.HasOption("--no-build"),
project: o.SingleArgumentOrDefault("--project"),
launchProfile: o.SingleArgumentOrDefault("--launch-profile"),
noLaunchProfile: o.HasOption("--no-launch-profile"),
args: o.Arguments
)),
options: new[]
@ -32,6 +34,14 @@ namespace Microsoft.DotNet.Cli
"-p|--project",
LocalizableStrings.CommandOptionProjectDescription,
Accept.ExactlyOneArgument()),
Create.Option(
"--launch-profile",
LocalizableStrings.CommandOptionLaunchProfileDescription,
Accept.ExactlyOneArgument()),
Create.Option(
"--no-launch-profile",
LocalizableStrings.CommandOptionNoLaunchProfileDescription,
Accept.NoArguments()),
Create.Option(
"--no-build",
LocalizableStrings.CommandOptionNoBuildDescription,

View file

@ -0,0 +1 @@
15.3.0

View file

@ -21,7 +21,6 @@
<PackageReference Include="NuGet.Build.Tasks" Version="$(CLI_NuGet_Version)" />
<PackageReference Include="Microsoft.TestPlatform.CLI" Version="$(CLI_TestPlatform_Version)" />
<PackageReference Include="Microsoft.TestPlatform.Build" Version="$(CLI_TestPlatform_Version)" />
<PackageReference Include="NuGet.Packaging.Core.Types" Version="$(CLI_NuGet_Version)" />
<PackageReference Include="NuGet.ProjectModel" Version="$(CLI_NuGet_Version)" />
<!-- The project json migration commands depend on an older version of Roslyn.
Lift the version here to match what tool_roslyn depends on (otherwise an older version will
@ -36,6 +35,12 @@
<ProjectReference Include="..\tool_nuget\tool_nuget.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="minimumMSBuildVersion">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<Target Name="PublishAspNetRuntimePackageStore"
AfterTargets="CrossgenPublishDir">
<ItemGroup>

View file

@ -28,7 +28,7 @@ function CopyTestXUnitRunner([string]$destination)
Copy-Item $XUnitRunnerDir\xunit.runner.utility.desktop.dll -Destination:$destination
}
Write-Host "Running tests for MSI installer at $inputMsi."
Write-Output "Running tests for MSI installer at $inputMsi."
if(!(Test-Path $inputMsi))
{
@ -65,7 +65,7 @@ try {
CopyInstaller $testBin
CopyTestXUnitRunner $testBin
Write-Host "Running installer tests in Windows Container"
Write-Output "Running installer tests in Windows Container"
# --net="none" works around a networking issue on the containers on the CI machines.
# Since our installer tests don't require the network, it is fine to shut it off.

View file

@ -76,9 +76,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-back-compat.Tests",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-remove-package.Tests", "dotnet-remove-package.Tests\dotnet-remove-package.Tests.csproj", "{CF517B15-B307-4660-87D5-CC036ADECD4B}"
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver.Tests", "Microsoft.DotNet.MSBuildSdkResolver.Tests\Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj", "{42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-clean.Tests", "dotnet-clean.Tests\dotnet-clean.Tests.csproj", "{D9A582B8-1FE2-45D5-B139-0BA828FE3691}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -509,6 +510,18 @@ Global
{42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|x64.Build.0 = Release|Any CPU
{42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|x86.ActiveCfg = Release|Any CPU
{42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|x86.Build.0 = Release|Any CPU
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x64.ActiveCfg = Debug|x64
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x64.Build.0 = Debug|x64
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x86.ActiveCfg = Debug|x86
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x86.Build.0 = Debug|x86
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|Any CPU.Build.0 = Release|Any CPU
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x64.ActiveCfg = Release|x64
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x64.Build.0 = Release|x64
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x86.ActiveCfg = Release|x86
{D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using FluentAssertions;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Test.Utilities.Mock;

View file

@ -175,6 +175,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests
{
throw new NotImplementedException();
}
public void WriteAllText(string path, string content)
{
throw new NotImplementedException();
}
}
private class MockStream : MemoryStream

View file

@ -73,11 +73,38 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
result.Path.Should().BeNull();
result.Version.Should().BeNull();
result.Warnings.Should().BeNullOrEmpty();
result.Errors.Should().Contain("Version 99.99.99 of the SDK is smaller than the minimum version 999.99.99"
result.Errors.Should().Contain("Version 99.99.99 of the .NET Core SDK is smaller than the minimum version 999.99.99"
+ " requested. Check that a recent enough .NET Core SDK is installed, increase the minimum version"
+ " specified in the project, or increase the version specified in global.json.");
}
[Fact]
public void ItReturnsNullWhenTheSDKRequiresAHigherVersionOfMSBuildThanTheOneAvailable()
{
var environment = new TestEnvironment();
var expected =
environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99", new Version(2, 0));
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
var resolver = environment.CreateResolver();
var result = (MockResult)resolver.Resolve(
new SdkReference("Some.Test.Sdk", null, "99.99.99"),
new MockContext
{
MSBuildVersion = new Version(1, 0),
ProjectFilePath = environment.TestDirectory.FullName
},
new MockFactory());
result.Success.Should().BeFalse();
result.Path.Should().BeNull();
result.Version.Should().BeNull();
result.Warnings.Should().BeNullOrEmpty();
result.Errors.Should().Contain("Version 99.99.99 of the .NET Core SDK requires at least version 2.0 of MSBuild."
+ " The current available version of MSBuild is 1.0. Change the .NET Core SDK specified in global.json to an older"
+ " version that requires the MSBuild version currently available.");
}
[Fact]
public void ItReturnsTheVersionIfItIsEqualToTheMinVersion()
{
@ -147,27 +174,66 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
=> new DotNetMSBuildSdkResolver(GetEnvironmentVariable);
public DirectoryInfo GetSdkDirectory(ProgramFiles programFiles, string sdkName, string sdkVersion)
=> TestDirectory.GetDirectory(GetProgramFilesDirectory(programFiles).FullName, "dotnet", "sdk", sdkVersion, "Sdks", sdkName, "Sdk");
=> TestDirectory.GetDirectory(
GetProgramFilesDirectory(programFiles).FullName,
"dotnet",
"sdk",
sdkVersion,
"Sdks",
sdkName,
"Sdk");
public DirectoryInfo GetProgramFilesDirectory(ProgramFiles programFiles)
=> TestDirectory.GetDirectory($"ProgramFiles{programFiles}");
public DirectoryInfo CreateSdkDirectory(ProgramFiles programFiles, string sdkVersion, string sdkName)
public DirectoryInfo CreateSdkDirectory(
ProgramFiles programFiles,
string sdkName,
string sdkVersion,
Version minimumMSBuildVersion = null)
{
var dir = GetSdkDirectory(programFiles, sdkVersion, sdkName);
var dir = GetSdkDirectory(programFiles, sdkName, sdkVersion);
dir.Create();
if (minimumMSBuildVersion != null)
{
CreateMSBuildRequiredVersionFile(programFiles, sdkVersion, minimumMSBuildVersion);
}
return dir;
}
public void CreateMuxerAndAddToPath(ProgramFiles programFiles)
{
var muxerDirectory = TestDirectory.GetDirectory(GetProgramFilesDirectory(programFiles).FullName, "dotnet");
var muxerDirectory =
TestDirectory.GetDirectory(GetProgramFilesDirectory(programFiles).FullName, "dotnet");
new FileInfo(Path.Combine(muxerDirectory.FullName, Muxer)).Create();
PathEnvironmentVariable = $"{muxerDirectory}{Path.PathSeparator}{PathEnvironmentVariable}";
}
private void CreateMSBuildRequiredVersionFile(
ProgramFiles programFiles,
string sdkVersion,
Version minimumMSBuildVersion)
{
if (minimumMSBuildVersion == null)
{
minimumMSBuildVersion = new Version(1, 0);
}
var cliDirectory = TestDirectory.GetDirectory(
GetProgramFilesDirectory(programFiles).FullName,
"dotnet",
"sdk",
sdkVersion);
File.WriteAllText(
Path.Combine(cliDirectory.FullName, "minimumMSBuildVersion"),
minimumMSBuildVersion.ToString());
}
public void CreateGlobalJson(DirectoryInfo directory, string version)
=> File.WriteAllText(directory.GetFile("global.json").FullName,
$@"{{ ""sdk"": {{ ""version"": ""{version}"" }} }}");
@ -188,6 +254,12 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
{
public new string ProjectFilePath { get => base.ProjectFilePath; set => base.ProjectFilePath = value; }
public new string SolutionFilePath { get => base.SolutionFilePath; set => base.SolutionFilePath = value; }
public new Version MSBuildVersion { get => base.MSBuildVersion; set => base.MSBuildVersion = value; }
public MockContext()
{
MSBuildVersion = new Version(15, 3, 0);
}
}
private sealed class MockFactory : SdkResultFactory

View file

@ -191,6 +191,22 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
return new AndConstraint<DirectoryInfoAssertions>(this);
}
public AndConstraint<DirectoryInfoAssertions> BeEmpty()
{
Execute.Assertion.ForCondition(!_dirInfo.EnumerateFileSystemInfos().Any())
.FailWith($"The directory {_dirInfo.FullName} is not empty.");
return new AndConstraint<DirectoryInfoAssertions>(this);
}
public AndConstraint<DirectoryInfoAssertions> NotBeEmpty()
{
Execute.Assertion.ForCondition(_dirInfo.EnumerateFileSystemInfos().Any())
.FailWith($"The directory {_dirInfo.FullName} is empty.");
return new AndConstraint<DirectoryInfoAssertions>(this);
}
public AndConstraint<DirectoryInfoAssertions> NotExist(string because = "", params object[] reasonArgs)
{
Execute.Assertion

View file

@ -60,6 +60,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests
private class FileMock : IFile
{
private Dictionary<string, string> _files;
public FileMock(Dictionary<string, string> files)
{
_files = files;
@ -100,6 +101,11 @@ namespace Microsoft.Extensions.DependencyModel.Tests
{
_files.Add(path, string.Empty);
}
public void WriteAllText(string path, string content)
{
_files[path] = content;
}
}
private class DirectoryMock : IDirectory

View file

@ -0,0 +1,43 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using FluentAssertions;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
using System.Linq;
namespace Microsoft.DotNet.Cli.Clean.Tests
{
public class GivenDotnetCleanCleansBuildArtifacts : TestBase
{
[Fact]
public void ItCleansAProjectBuiltWithRuntimeIdentifier()
{
var testAppName = "MSBuildTestApp";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance(testAppName)
.WithSourceFiles()
.WithRestoreFiles();
new BuildCommand()
.WithRuntime("win7-x64")
.WithWorkingDirectory(testInstance.Root)
.Execute()
.Should().Pass();
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var outputFolder = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.0", "win7-x64");
outputFolder.Should().NotBeEmpty();
new CleanCommand()
.WithWorkingDirectory(testInstance.Root)
.Execute("-r win7-x64")
.Should().Pass();
outputFolder.Should().BeEmpty();
}
}
}

View file

@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AssemblyName>dotnet-clean.Tests</AssemblyName>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.4;portable-net451+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161024-02" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
<PackageReference Include="xunit" Version="2.2.0-beta4-build3444" />
</ItemGroup>
</Project>

View file

@ -43,8 +43,8 @@ SDK commands:
-d|--diagnostics Enable diagnostic output.
Common options:
-v|--verbose Enable verbose output
-h|--help Show help
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
-h|--help Show help.
Run 'dotnet COMMAND --help' for more information on a command.

View file

@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
using FluentAssertions;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
@ -200,5 +201,267 @@ namespace Microsoft.DotNet.Cli.Run.Tests
.Pass()
.And.HaveStdOutContaining("echo args:foo;bar;baz");
}
[Fact]
public void ItGivesAnErrorWhenAttemptingToUseALaunchProfileThatDoesNotExistWhenThereIsNoLaunchSettingsFile()
{
var testAppName = "MSBuildTestApp";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--launch-profile test")
.Should().Pass()
.And.HaveStdOutContaining("Hello World!")
.And.HaveStdErrContaining("The specified launch profile could not be located.");
}
[Fact]
public void ItUsesLaunchProfileOfTheSpecifiedName()
{
var testAppName = "AppWithLaunchSettings";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
var cmd = new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--launch-profile Second");
cmd.Should().Pass()
.And.HaveStdOutContaining("Second");
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void ItDefaultsToTheFirstUsableLaunchProfile()
{
var testAppName = "AppWithLaunchSettings";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
var cmd = new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput();
cmd.Should().Pass()
.And.HaveStdOutContaining("First");
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void ItGivesAnErrorWhenTheLaunchProfileNotFound()
{
var testAppName = "AppWithLaunchSettings";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--launch-profile Third")
.Should().Pass()
.And.HaveStdOutContaining("(NO MESSAGE)")
.And.HaveStdErrContaining("The launch profile \"Third\" could not be applied.");
}
[Fact]
public void ItGivesAnErrorWhenTheLaunchProfileCanNotBeHandled()
{
var testAppName = "AppWithLaunchSettings";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--launch-profile \"IIS Express\"")
.Should().Pass()
.And.HaveStdOutContaining("(NO MESSAGE)")
.And.HaveStdErrContaining("The launch profile \"IIS Express\" could not be applied.");
}
[Fact]
public void ItSkipsLaunchProfilesWhenTheSwitchIsSupplied()
{
var testAppName = "AppWithLaunchSettings";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
var cmd = new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--no-launch-profile");
cmd.Should().Pass()
.And.HaveStdOutContaining("(NO MESSAGE)");
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void ItSkipsLaunchProfilesWhenTheSwitchIsSuppliedWithoutErrorWhenThereAreNoLaunchSettings()
{
var testAppName = "MSBuildTestApp";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
var cmd = new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--no-launch-profile");
cmd.Should().Pass()
.And.HaveStdOutContaining("Hello World!");
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void ItSkipsLaunchProfilesWhenThereIsNoUsableDefault()
{
var testAppName = "AppWithLaunchSettingsNoDefault";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
var cmd = new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput();
cmd.Should().Pass()
.And.HaveStdOutContaining("(NO MESSAGE)")
.And.HaveStdErrContaining("The launch profile \"(Default)\" could not be applied.");
}
[Fact]
public void ItPrintsAnErrorWhenLaunchSettingsAreCorrupted()
{
var testAppName = "AppWithCorruptedLaunchSettings";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute("/p:SkipInvalidConfigurations=true")
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
var cmd = new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput();
cmd.Should().Pass()
.And.HaveStdOutContaining("(NO MESSAGE)")
.And.HaveStdErrContaining("The launch profile \"(Default)\" could not be applied.");
}
}
}

View file

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
</Project>