Upgrade to VS 2017

This commit is contained in:
Nate McMaster 2017-01-11 16:45:51 -08:00
parent 8ce50e3fb3
commit b099e03893
46 changed files with 264 additions and 551 deletions

View File

@ -1,2 +1,2 @@
+[config]
+project = src/MusicStore/project.json
+project = src/MusicStore/MusicStore.csproj

View File

@ -1,5 +1,4 @@
.git
**/project.lock.json
**/Obj/
**/obj/
@ -41,7 +40,6 @@ node_modules
*.sln.ide
*.ng.ts
*.sln.ide
project.lock.json
.build/
.testpublish/
launchSettings.json

7
.gitignore vendored
View File

@ -9,13 +9,13 @@
*.suo
*.cache
*.docstates
*.log
_ReSharper.*
*.csproj.user
*[Rr]e[Ss]harper.user
_ReSharper.*/
packages/*
artifacts/*
msbuild.log
PublishProfiles/
*.psess
*.vsp
@ -27,7 +27,6 @@ PublishProfiles/
*.vspx
/.symbols
nuget.exe
build/
*net45.csproj
*k10.csproj
App_Data/
@ -36,7 +35,7 @@ node_modules
*.sln.ide
*.ng.ts
*.sln.ide
project.lock.json
.build/
.testpublish/
launchSettings.json
launchSettings.json
.vscode/

View File

@ -1,17 +1,17 @@
FROM microsoft/dotnet-nightly:1.1-sdk-projectjson-nanoserver
FROM microsoft/dotnet:1.1-sdk-msbuild
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN New-Item -Path \MusicStore\samples\MusicStore.Standalone -Type Directory
RUN New-Item -Path \MusicStore\samples\MusicStore -Type Directory
WORKDIR MusicStore
ADD samples/MusicStore.Standalone/project.json samples/MusicStore.Standalone/project.json
ADD samples/MusicStore/MusicStore.csproj samples/MusicStore/MusicStore.csproj
ADD NuGet.config .
RUN dotnet restore .\samples\MusicStore.Standalone
RUN dotnet restore .\samples\MusicStore
ADD samples samples
RUN dotnet build .\samples\MusicStore.Standalone
RUN dotnet build .\samples\MusicStore
EXPOSE 5000
ENV ASPNETCORE_URLS http://0.0.0.0:5000
CMD dotnet run -p .\samples\MusicStore.Standalone
CMD dotnet run -p .\samples\MusicStore

View File

@ -1,11 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.25605.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7D749BDA-4638-4517-B66A-D40DEDEEB141}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
NuGet.config = NuGet.config
EndProjectSection
EndProject
@ -13,13 +12,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{B7B1
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{363D2681-31A6-48C9-90BB-9ACFF4A41F06}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "E2ETests", "test\E2ETests\E2ETests.xproj", "{A319ACCE-060B-4385-9534-9F2202F6180E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "E2ETests", "test\E2ETests\E2ETests.csproj", "{A319ACCE-060B-4385-9534-9F2202F6180E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\MusicStore\MusicStore.xproj", "{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicStore", "samples\MusicStore\MusicStore.csproj", "{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore.Test", "test\MusicStore.Test\MusicStore.Test.xproj", "{CA663205-77DE-4E55-B300-85594181B5A9}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore.Standalone", "samples\MusicStore.Standalone\MusicStore.Standalone.xproj", "{C4222506-9D5B-469D-90C1-196A3F27CB44}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicStore.Test", "test\MusicStore.Test\MusicStore.Test.csproj", "{CA663205-77DE-4E55-B300-85594181B5A9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -63,18 +60,6 @@ Global
{CA663205-77DE-4E55-B300-85594181B5A9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CA663205-77DE-4E55-B300-85594181B5A9}.Release|x86.ActiveCfg = Release|Any CPU
{CA663205-77DE-4E55-B300-85594181B5A9}.Release|x86.Build.0 = Release|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Debug|x86.ActiveCfg = Debug|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Debug|x86.Build.0 = Debug|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Release|Any CPU.Build.0 = Release|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Release|x86.ActiveCfg = Release|Any CPU
{C4222506-9D5B-469D-90C1-196A3F27CB44}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -83,6 +68,5 @@ Global
{A319ACCE-060B-4385-9534-9F2202F6180E} = {363D2681-31A6-48C9-90BB-9ACFF4A41F06}
{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0} = {B7B176B6-8D4D-4EF1-BBD2-DDA650C78FFF}
{CA663205-77DE-4E55-B300-85594181B5A9} = {363D2681-31A6-48C9-90BB-9ACFF4A41F06}
{C4222506-9D5B-469D-90C1-196A3F27CB44} = {B7B176B6-8D4D-4EF1-BBD2-DDA650C78FFF}
EndGlobalSection
EndGlobal

View File

@ -2,6 +2,7 @@
<configuration>
<packageSources>
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
<add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

View File

@ -1,4 +1,5 @@
# MusicStore application
MusicStore (Sample ASP.NET Core application)
============================================
AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/ja8a7j6jscj7k3xa/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/MusicStore/branch/dev)
@ -6,24 +7,16 @@ Travis: [![Travis](https://travis-ci.org/aspnet/MusicStore.svg?branch=dev)](ht
This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.
## Run the application on Helios:
* If you have Visual Studio 2015
1. Open MusicStore.sln in Visual Studio 2015 and run the individual applications on `IIS Express`.
* If you don't have Visual Studio 2015
1. Open a command prompt and execute `cd \src\MusicStore\`.
2. Execute `dnu restore`.
3. Execute `Helios.cmd` to launch the app on IISExpress from command line (Application started at URL **http://localhost:5001/**).
**NOTE:** App and tests require Visual Studio 2015 LocalDB on the machine to run.
## Run the application:
* If you have Visual Studio 2017
1. Open MusicStore.sln in Visual Studio 2017 and run the individual applications on `IIS Express`.
## Run on WebListener/Kestrel:
* Open a command prompt and cd `\src\MusicStore\`.
* **[WebListener]:**
4. Run `dnx . web` (Application started at URL **http://localhost:5002/**).
* **[Kestrel]:**
5. Run `dnx . kestrel` (Application started at URL **http://localhost:5004/**).
* **[CustomHost]:**
6. Run `dnx . run` (This hosts the app in a console application - Application started at URL **http://localhost:5003/**).
* If you don't have Visual Studio 2017
1. Open a command prompt and execute `cd \src\MusicStore\`.
2. Execute `dotnet restore`.
**NOTE:** App and tests require Visual Studio 2017 LocalDB on the machine to run.
**NOTE:** Since SQL Server is not generlly available on Mac, the InMemoryStore is used to run the application. So the changes that you make will not be persisted.
## Run on Docker Windows Containers
@ -32,16 +25,8 @@ This project is part of ASP.NET Core. You can find samples, documentation and ge
* `docker-compose -f .\docker-compose.windows.yml up`
* Access MusicStore on either the Windows VM IP or (if container is running locally) on the container IP: `docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" musicstore_web_1`
## To run the sample on Mac/Mono:
* Follow the instructions at the [Home](https://github.com/aspnet/Home) repository to install Mono and DNVM on Mac OS X.
* Open a command prompt and execute `cd samples/MusicStore.Standalone`.
* Execute `dotnet restore`.
* Try `dotnet run` to run the application.
**NOTE:** Since on Mono SQL client is not available the sample uses an InMemoryStore to run the application. So the changes that you make will not be persisted.
###NTLM authentication
## NTLM authentication
More information at [src/MusicStore/StartupNtlmAuthentication.cs](src/MusicStore/StartupNtlmAuthentication.cs).
###OpenIdConnect authentication
## OpenIdConnect authentication
More information at [src/MusicStore/StartupOpenIdConnect.cs](src/MusicStore/StartupOpenIdConnect.cs).

View File

@ -10,4 +10,5 @@ build_script:
- build.cmd verify
clone_depth: 1
test: off
deploy: off
deploy: off
os: Visual Studio 2017 RC

View File

@ -33,7 +33,7 @@ cd $PSScriptRoot
$repoFolder = $PSScriptRoot
$env:REPO_FOLDER = $repoFolder
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip"
if ($env:KOREBUILD_ZIP)
{
$koreBuildZip=$env:KOREBUILD_ZIP

View File

@ -2,7 +2,7 @@
repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $repoFolder
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip"
if [ ! -z $KOREBUILD_ZIP ]; then
koreBuildZip=$KOREBUILD_ZIP
fi

13
build/common.props Normal file
View File

@ -0,0 +1,13 @@
<Project>
<Import Project="..\version.props" />
<PropertyGroup>
<NetCoreAppImplicitPackageVersion>1.2.0-*</NetCoreAppImplicitPackageVersion>
</PropertyGroup>
<ItemGroup>
<!-- TODO remove this. Currently only required to workaround issues in dotnet/sdk -->
<PackageReference Include="Internal.AspNetCore.Sdk" Version="1.0.1-*" PrivateAssets="All" />
</ItemGroup>
</Project>

View File

@ -1,9 +0,0 @@
{
"projects": [
"samples",
"test"
],
"sdk": {
"version": "1.0.0-preview2-1-003180"
}
}

View File

@ -3,17 +3,6 @@ k-standard-goals
#run-nano-tests .compile
@{
var configuration = Environment.GetEnvironmentVariable("Configuration");
if (string.IsNullOrEmpty(configuration))
{
configuration = "Debug";
}
var e2eTestsDirectory = Path.Combine(Directory.GetCurrentDirectory(), "test", "E2ETests");
var testArgs = "";
testArgs += " --configuration " + configuration;
testArgs += " -trait E2ETests=NanoServer";
testArgs += " -parallel none";
Dotnet("test" + testArgs, e2eTestsDirectory);
Dotnet("msbuild /t:TestNano /p:Configuration=" + E("Configuration"), e2eTestsDirectory);
}

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>c4222506-9d5b-469d-90c1-196a3f27cb44</ProjectGuid>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -1,58 +0,0 @@
using System;
using System.IO;
using System.Reflection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.Configuration;
namespace MusicStore.Standalone
{
public static class Program
{
public static void Main(string[] args)
{
var config = new ConfigurationBuilder()
.AddCommandLine(args)
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
.Build();
var currentExecutingAssemblyFileInfo = new FileInfo(typeof(Program).GetTypeInfo().Assembly.Location);
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseIISIntegration()
.UseStartup("MusicStore.Standalone")
.UseContentRoot(currentExecutingAssemblyFileInfo.Directory.FullName);
if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.HttpSys", System.StringComparison.Ordinal))
{
var environment = builder.GetSetting("environment") ??
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
if (string.Equals(environment, "NtlmAuthentication", System.StringComparison.Ordinal))
{
// Set up NTLM authentication for WebListener like below.
// For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or
// modify the applicationHost.config to enable NTLM.
builder.UseHttpSys(options =>
{
options.Authentication.Schemes = AuthenticationSchemes.NTLM;
options.Authentication.AllowAnonymous = false;
});
}
else
{
builder.UseHttpSys();
}
}
else
{
builder.UseKestrel();
}
var host = builder.Build();
host.Run();
}
}
}

View File

@ -1,96 +0,0 @@
{
"authors": [
"Microsoft"
],
"description": "Music store application on ASP.NET Core",
"version": "1.2.0-*",
"buildOptions": {
"compile": {
"exclude": [
"../MusicStore/Program.cs",
"../MusicStore/bin",
"../MusicStore/obj"
],
"include": [
"../MusicStore/**/*.cs"
]
},
"copyToOutput": {
"mappings": {
"Areas/": "../MusicStore/Areas/**/*.cshtml",
"Views/": "../MusicStore/Views/**/*.cshtml",
"wwwroot/": "../MusicStore/wwwroot/",
"web.config": "../MusicStore/web.config",
"config.json": "../MusicStore/config.json",
"ForTesting/": "../MusicStore/ForTesting/**/*.json"
}
},
"define": [
"DEMO",
"TESTING"
],
"emitEntryPoint": true,
"preserveCompilationContext": true,
"warningsAsErrors": true
},
"publishOptions": {
"mappings": {
"Areas/": "../MusicStore/Areas/**/*.cshtml",
"Views/": "../MusicStore/Views/**/*.cshtml",
"wwwroot/": "../MusicStore/wwwroot/",
"web.config": "../MusicStore/web.config",
"config.json": "../MusicStore/config.json",
"ForTesting/": "../MusicStore/ForTesting/**/*.json"
}
},
"dependencies": {
"Microsoft.AspNetCore": "1.2.0-*",
"Microsoft.AspNetCore.AspNetCoreModule": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.Cookies": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.Facebook": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.Google": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.MicrosoftAccount": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.Twitter": "1.2.0-*",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.2.0-*",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.2.0-*",
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.2.0-*",
"Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*",
"Microsoft.AspNetCore.Session": "1.2.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*",
"Microsoft.EntityFrameworkCore.InMemory": "1.2.0-*",
"Microsoft.EntityFrameworkCore.SqlServer": "1.2.0-*",
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.2.0-*"
}
}
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
},
"runtimes": {
"win7-x64": {},
"win7-x86": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"ubuntu.15.04-x64": {},
"centos.7-x64": {},
"rhel.7.2-x64": {}
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
}
}

View File

@ -1,9 +0,0 @@
<?xml version="1.0"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="true"/>
</system.webServer>
</configuration>

View File

@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@ -12,7 +13,12 @@ namespace MusicStore.Mocks.OpenIdConnect
var response = new HttpResponseMessage();
var basePath = Path.GetFullPath(Path.Combine(
Directory.GetCurrentDirectory(), "ForTesting", "Mocks", "OpenIdConnect"));
#if NET451
AppDomain.CurrentDomain.BaseDirectory,
#else
AppContext.BaseDirectory,
#endif
"ForTesting", "Mocks", "OpenIdConnect"));
if (request.RequestUri.AbsoluteUri == "https://login.windows.net/[tenantName].onmicrosoft.com/.well-known/openid-configuration")
{

View File

@ -1,4 +0,0 @@
# Mock code added only for testing purposes. Not to be used for production deployments.
This code is compiled with the application by explicitly including the location in the application `project.json`'s "code" node.
It is automatically excluded from compilation of current project by its presence in the compiler\shared\** special folder.

View File

@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>Music store application on ASP.NET Core</Description>
<Authors>Microsoft</Authors>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<DefineConstants>$(DefineConstants);DEMO</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<OutputType>Exe</OutputType>
<RuntimeIdentifier Condition="'$(TargetFramework)'!='netcoreapp1.1'">win7-x64</RuntimeIdentifier>
<RuntimeIdentifiers>win7-x64;win7-x86;win10-x64;win10-x86;osx.10.10-x64;osx.10.11-x64;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.15.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.AspNetCoreModule" Version="1.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Server.HttpSys" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.2.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="1.2.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.2.0-*" />
</ItemGroup>
</Project>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>3cfbed5d-2ed8-49db-96fb-bdaa748dc5a0</ProjectGuid>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<DevelopmentServerPort>5001</DevelopmentServerPort>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -19,7 +19,6 @@ namespace MusicStore
out int pdwReturnedProductType);
private bool? _isNano;
private bool? _isMono;
private bool? _isWindows;
public bool IsRunningOnWindows
@ -35,19 +34,6 @@ namespace MusicStore
}
}
public bool IsRunningOnMono
{
get
{
if (_isMono == null)
{
_isMono = Type.GetType("Mono.Runtime") != null;
}
return _isMono.Value;
}
}
public bool IsRunningOnNanoServer
{
get
@ -87,7 +73,7 @@ namespace MusicStore
{
get
{
return !IsRunningOnWindows || IsRunningOnMono || IsRunningOnNanoServer;
return !IsRunningOnWindows || IsRunningOnNanoServer;
}
}

View File

@ -170,8 +170,6 @@ namespace MusicStore
// http://localhost:5001/ for test applications.
// As such, here is how to change this sample to uses http://ktesting.com:5001/ instead.
// Edit the Project.json file and replace http://localhost:5001/ with http://ktesting.com:5001/.
// From an admin command console first enter:
// notepad C:\Windows\System32\drivers\etc\hosts
// and add this to the file, save, and exit (and reboot?):

View File

@ -1,77 +0,0 @@
{
"authors": [
"Microsoft"
],
"description": "Music store application on ASP.NET Core",
"version": "1.2.0-*",
"buildOptions": {
"copyToOutput": {
"include": [
"Areas",
"Views",
"wwwroot",
"config.json",
"web.config",
"ForTesting/**/*.json"
]
},
"define": [
"DEMO"
],
"emitEntryPoint": true,
"preserveCompilationContext": true,
"warningsAsErrors": true
},
"publishOptions": {
"include": [
"Areas",
"Views",
"wwwroot",
"config.json",
"web.config",
"ForTesting/**/*.json"
]
},
"dependencies": {
"Microsoft.AspNetCore": "1.2.0-*",
"Microsoft.AspNetCore.AspNetCoreModule": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.Cookies": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.Facebook": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.Google": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.MicrosoftAccount": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.Twitter": "1.2.0-*",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.2.0-*",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.2.0-*",
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.2.0-*",
"Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*",
"Microsoft.AspNetCore.Session": "1.2.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*",
"Microsoft.EntityFrameworkCore.InMemory": "1.2.0-*",
"Microsoft.EntityFrameworkCore.SqlServer": "1.2.0-*",
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*"
},
"frameworks": {
"net451": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.2.0-*",
"type": "platform"
}
}
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
}
}

View File

@ -0,0 +1,5 @@
{
"configProperties": {
"System.GC.Server": true
}
}

View File

@ -23,8 +23,7 @@ namespace E2ETests
public static void DropDatabase(string databaseName, ILogger logger)
{
if (Helpers.RunningOnMono
|| !TestPlatformHelper.IsWindows)
if (!TestPlatformHelper.IsWindows)
{
return;
}

View File

@ -8,17 +8,24 @@ namespace E2ETests
{
public class Helpers
{
public static bool RunningOnMono
{
get
{
return Type.GetType("Mono.Runtime") != null;
}
}
public static string GetApplicationPath(ApplicationType applicationType)
{
return Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "samples", applicationType == ApplicationType.Standalone ? "MusicStore.Standalone" : "MusicStore"));
var current = new DirectoryInfo(AppContext.BaseDirectory);
while (current != null)
{
if (File.Exists(Path.Combine(current.FullName, "MusicStore.sln")))
{
break;
}
current = current.Parent;
}
if (current == null)
{
throw new InvalidOperationException("Could not find the solution directory");
}
return Path.GetFullPath(Path.Combine(current.FullName, "samples", "MusicStore"));
}
public static void SetInMemoryStoreForIIS(DeploymentParameters deploymentParameters, ILogger logger)

View File

@ -0,0 +1,71 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<UserSecretsId>MusicStore.E2ETests</UserSecretsId>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RuntimeIdentifiers>win7-x86;win7-x64;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.14.10-x64;ubuntu.15.04-x64;ubuntu.16.04-x64;centos.7-x64;debian.8-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<None Include="*.config" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="0.3.0-*" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="1.2.0-*" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.2.0-*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-*" />
<PackageReference Include="System.Data.SqlClient" Version="4.4.0-*" />
<PackageReference Include="System.Xml.XmlDocument" Version="4.4.0-*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-*" />
<PackageReference Include="xunit" Version="2.2.0-*" />
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.1-*" />
</ItemGroup>
<!-- workaround inability to filter by traits using xunit.runner.visualstudio -->
<PropertyGroup>
<XunitConsoleVersion>2.2.0-preview2-build1029</XunitConsoleVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="dotnet-test-xunit" Version="$(XunitConsoleVersion)" />
</ItemGroup>
<Target Name="TestNano" DependsOnTargets="Build">
<ItemGroup>
<CopyTestFiles Include="$(NuGetPackageRoot)dotnet-test-xunit\$(XunitConsoleVersion)\lib\netcoreapp1.0\dotnet-test-xunit.dll">
<RelativePath>dotnet-test-xunit.dll</RelativePath>
</CopyTestFiles>
<CopyTestFiles Include="$(ProjectDepsFilePath)">
<RelativePath>dotnet-test-xunit.deps.json</RelativePath>
</CopyTestFiles>
<CopyTestFiles Include="$(ProjectRuntimeConfigFilePath)">
<RelativePath>dotnet-test-xunit.runtimeconfig.json</RelativePath>
</CopyTestFiles>
<CopyTestFiles Include="$(ProjectRuntimeConfigDevFilePath)">
<RelativePath>dotnet-test-xunit.runtimeconfig.dev.json</RelativePath>
</CopyTestFiles>
</ItemGroup>
<Copy SourceFiles="%(CopyTestFiles.Identity)" DestinationFiles="$(OutputPath)\%(RelativePath)" />
<Exec Command="dotnet dotnet-test-xunit.dll $(AssemblyName).dll -parallel None -trait E2ETests=NanoServer"
WorkingDirectory="$(OutputPath)" />
</Target>
<!-- end workaround -->
</Project>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>a319acce-060b-4385-9534-9f2202f6180e</ProjectGuid>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -66,10 +66,7 @@ namespace E2ETests
responseContent = await response.Content.ReadAsStringAsync();
//Correlation cookie not getting cleared after successful signin?
if (!Helpers.RunningOnMono)
{
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Facebook"));
}
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Facebook"));
Assert.Equal(_deploymentResult.ApplicationBaseUri + "Account/ExternalLoginCallback?ReturnUrl=%2F", response.RequestMessage.RequestUri.AbsoluteUri);
Assert.Contains("AspnetvnextTest@test.com", responseContent, StringComparison.OrdinalIgnoreCase);

View File

@ -68,10 +68,7 @@ namespace E2ETests
responseContent = await response.Content.ReadAsStringAsync();
//Correlation cookie not getting cleared after successful signin?
if (!Helpers.RunningOnMono)
{
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Google"));
}
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Google"));
Assert.Equal(_deploymentResult.ApplicationBaseUri + "Account/ExternalLoginCallback?ReturnUrl=%2F", response.RequestMessage.RequestUri.AbsoluteUri);
Assert.Contains("AspnetvnextTest@gmail.com", responseContent, StringComparison.OrdinalIgnoreCase);

View File

@ -67,10 +67,7 @@ namespace E2ETests
responseContent = await response.Content.ReadAsStringAsync();
//Correlation cookie not getting cleared after successful signin?
if (!Helpers.RunningOnMono)
{
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Microsoft"));
}
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Microsoft"));
Assert.Equal(_deploymentResult.ApplicationBaseUri + "Account/ExternalLoginCallback?ReturnUrl=%2F", response.RequestMessage.RequestUri.AbsoluteUri);
formParameters = new List<KeyValuePair<string, string>>

View File

@ -61,12 +61,9 @@ namespace E2ETests
responseContent = await response.Content.ReadAsStringAsync();
//Check correlation cookie not getting cleared after successful signin
if (!Helpers.RunningOnMono)
{
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri))["__TwitterState"]);
}
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri))["__TwitterState"]);
Assert.Equal(_deploymentResult.ApplicationBaseUri + "Account/ExternalLoginCallback?ReturnUrl=%2F", response.RequestMessage.RequestUri.AbsoluteUri);
//Twitter does not give back the email claim for some reason.
//Twitter does not give back the email claim for some reason.
//Assert.Contains("AspnetvnextTest@gmail.com", responseContent, StringComparison.OrdinalIgnoreCase);
formParameters = new List<KeyValuePair<string, string>>

View File

@ -301,23 +301,14 @@ namespace E2ETests
response = await DoPostAsync("Account/LogOff", content);
responseContent = await response.Content.ReadAsStringAsync();
if (!Helpers.RunningOnMono)
{
Assert.Contains("ASP.NET MVC Music Store", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("Register", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("Login", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("www.github.com/aspnet/MusicStore", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("/Images/home-showcase.png", responseContent, StringComparison.OrdinalIgnoreCase);
//Verify cookie cleared on logout
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(IdentityCookieName));
_logger.LogInformation("Successfully signed out of '{email}''s session", email);
}
else
{
//Bug in Mono - on logout the cookie is not cleared in the cookie container and not redirected. Work around by reinstantiating the httpClient.
_httpClientHandler = new HttpClientHandler();
_httpClient = new HttpClient(_httpClientHandler) { BaseAddress = new Uri(_deploymentResult.ApplicationBaseUri) };
}
Assert.Contains("ASP.NET MVC Music Store", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("Register", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("Login", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("www.github.com/aspnet/MusicStore", responseContent, StringComparison.OrdinalIgnoreCase);
Assert.Contains("/Images/home-showcase.png", responseContent, StringComparison.OrdinalIgnoreCase);
//Verify cookie cleared on logout
Assert.Null(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(IdentityCookieName));
_logger.LogInformation("Successfully signed out of '{email}''s session", email);
}
public async Task SignInWithInvalidPassword(string email, string invalidPassword)

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using E2ETests.Common;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
@ -44,7 +45,7 @@ namespace E2ETests
ApplicationType = applicationType,
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("NtlmAuthentation.config") : null,
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "NtlmAuthentation.config")) : null,
SiteName = "MusicStoreNtlmAuthentication", //This is configured in the NtlmAuthentication.config
UserAdditionalCleanup = parameters =>
{
@ -52,6 +53,11 @@ namespace E2ETests
}
};
if (applicationType == ApplicationType.Standalone)
{
deploymentParameters.AdditionalPublishParameters = "/p:RuntimeIdentifier=" + RuntimeEnvironment.GetRuntimeIdentifier();
}
// Override the connection strings using environment based configuration
deploymentParameters.EnvironmentVariables
.Add(new KeyValuePair<string, string>(

View File

@ -4,8 +4,8 @@ using System.Net.Http;
using System.Threading.Tasks;
using E2ETests.Common;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
@ -78,6 +78,11 @@ namespace E2ETests
}
};
if (applicationType == ApplicationType.Standalone)
{
deploymentParameters.AdditionalPublishParameters = "/p:RuntimeIdentifier=" + RuntimeEnvironment.GetRuntimeIdentifier();
}
// Override the connection strings using environment based configuration
deploymentParameters.EnvironmentVariables
.Add(new KeyValuePair<string, string>(

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using E2ETests.Common;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
@ -28,7 +29,7 @@ namespace E2ETests
//[InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, "http://localhost:5025/", false)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable, "http://localhost:5026/", false)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, "http://localhost:5027/", false)]
//[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, "http://localhost:5028/", false)]
// [InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, "http://localhost:5028/", false)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable, "http://localhost:5029/", false)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, "http://localhost:5030/", false)]
public async Task WindowsOS(
@ -158,6 +159,11 @@ namespace E2ETests
}
};
if (applicationType == ApplicationType.Standalone)
{
deploymentParameters.AdditionalPublishParameters = "--runtime " + RuntimeEnvironment.GetRuntimeIdentifier();
}
// Override the connection strings using environment based configuration
deploymentParameters.EnvironmentVariables
.Add(new KeyValuePair<string, string>(

View File

@ -5,6 +5,7 @@ using System.Threading.Tasks;
using E2ETests.Common;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
@ -192,6 +193,11 @@ namespace E2ETests
}
};
if (applicationType == ApplicationType.Standalone)
{
deploymentParameters.AdditionalPublishParameters = "/p:RuntimeIdentifier=" + RuntimeEnvironment.GetRuntimeIdentifier();
}
// Override the connection strings using environment based configuration
deploymentParameters.EnvironmentVariables
.Add(new KeyValuePair<string, string>(

View File

@ -287,7 +287,7 @@ namespace E2ETests
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("remoteDeploymentConfig.json")
.AddUserSecrets()
.AddUserSecrets("MusicStore.E2ETests")
.AddEnvironmentVariables()
.Build();

View File

@ -1,46 +0,0 @@
{
"buildOptions": {
"warningsAsErrors": true
},
"dependencies": {
"dotnet-test-xunit": "2.2.0-*",
"Microsoft.AspNetCore.Authentication.Cookies": "1.2.0-*",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.2.0-*",
"Microsoft.AspNetCore.Identity": "1.2.0-*",
"Microsoft.AspNetCore.Server.IntegrationTesting": "0.3.0-*",
"Microsoft.AspNetCore.WebUtilities": "1.2.0-*",
"Microsoft.Extensions.Configuration.Binder": "1.2.0-*",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.2.0-*",
"Microsoft.Extensions.Configuration.Json": "1.2.0-*",
"Microsoft.Extensions.Configuration.UserSecrets": "1.2.0-*",
"Microsoft.Extensions.Logging": "1.2.0-*",
"Microsoft.Extensions.Logging.Console": "1.2.0-*",
"Microsoft.NETCore.App": {
"version": "1.2.0-*",
"type": "platform"
},
"System.Data.SqlClient": "4.4.0-*",
"System.Xml.XmlDocument": "4.4.0-*",
"xunit": "2.2.0-*"
},
"frameworks": {
"netcoreapp1.1": {}
},
"tools": {
"Microsoft.Extensions.SecretManager.Tools": "1.0.0-*"
},
"testRunner": "xunit",
"userSecretsId": "MusicStore.E2ETests",
"runtimes": {
"win7-x86": {},
"win7-x64": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"ubuntu.14.10-x64": {},
"ubuntu.15.04-x64": {},
"ubuntu.16.04-x64": {},
"centos.7-x64": {},
"debian.8-x64": {}
}
}

View File

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)'!='Windows_NT'">netcoreapp1.1</TargetFrameworks>
<RuntimeIdentifier Condition="'$(TargetFramework)'!='netcoreapp1.1'">win7-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\samples\MusicStore\MusicStore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Testing" Version="1.2.0-*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-*" />
<PackageReference Include="xunit" Version="2.2.0-*" />
</ItemGroup>
</Project>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>ca663205-77de-4e55-b300-85594181b5a9</ProjectGuid>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -1,24 +0,0 @@
{
"buildOptions": {
"warningsAsErrors": true
},
"dependencies": {
"dotnet-test-xunit": "2.2.0-*",
"Microsoft.Extensions.Logging.Testing": "1.2.0-*",
"Microsoft.DotNet.InternalAbstractions": "1.0.0",
"MusicStore": "1.2.0-*",
"xunit": "2.2.0-*"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.2.0-*",
"type": "platform"
}
}
},
"net451": {}
},
"testRunner": "xunit"
}

View File

@ -6,7 +6,7 @@ param(
)
$ErrorActionPreference = "Stop"
$projectFile = "MusicStore.Test\project.json"
$projectFile = "MusicStore.Test\MusicStore.Test.csproj"
Write-Host "Test server: $server"
Write-Host "Test folder: $serverFolder"
@ -25,9 +25,9 @@ Set-Item WSMan:\localhost\Client\TrustedHosts "$server" -Force
$remoteScript = {
$ErrorActionPreference = "Continue"
cd C:\$using:serverFolder\$using:projectName
dir
dir
$env:DNX_TRACE=1
$output = & .\approot\test.cmd 2>&1
$output
$lastexitcode

View File

@ -15,13 +15,13 @@ $ErrorActionPreference = "Stop"
function UpdateHostInProjectJson($projectFile, $newhost)
{
(Get-Content $projectFile) |
(Get-Content $projectFile) |
Foreach-Object {
$_ -replace "http://localhost", "http://$newhost"
} |
Set-Content $projectFile
Set-Content $projectFile
}
if (-not (Test-Path $projectFile)) {
Write-Error "Couldn't find $projectFile"
exit 1
@ -62,13 +62,13 @@ try
}
if ($remoteInvoke) {
$packedProjectJsonFile = Join-Path $packDir -ChildPath "approot\src\$projectName\project.json"
$packedProjectJsonFile = Join-Path $packDir -ChildPath "approot\src\$projectName\$projectName.csproj"
Write-Host "Setting host to $server in $packedProjectJsonFile"
if (-not (Test-Path $packedProjectJsonFile)) {
Write-Error "Couldn't find $packedProjectJsonFile"
exit 1
}
UpdateHostInProjectJson $packedProjectJsonFile $server
}

7
version.props Normal file
View File

@ -0,0 +1,7 @@
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
<Project>
<PropertyGroup>
<VersionPrefix>1.2.0</VersionPrefix>
<VersionSuffix>preview1</VersionSuffix>
</PropertyGroup>
</Project>