diff --git a/.deployment b/.deployment index 4b976d6dc5..38d6c4630b 100644 --- a/.deployment +++ b/.deployment @@ -1,2 +1,2 @@ +[config] -+project = src/MusicStore/project.json ++project = src/MusicStore/MusicStore.csproj diff --git a/.dockerignore b/.dockerignore index 10813e37c3..4a71c20425 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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 diff --git a/.gitignore b/.gitignore index 31ab979729..aacd4c880c 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +launchSettings.json +.vscode/ diff --git a/Dockerfile.windows b/Dockerfile.windows index f388d11596..fc0f17ee3f 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -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 diff --git a/MusicStore.sln b/MusicStore.sln index e4877882e5..63a47628e9 100644 --- a/MusicStore.sln +++ b/MusicStore.sln @@ -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 diff --git a/NuGet.config b/NuGet.config index 0fd623ffdd..93f1ac47df 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,6 +2,7 @@ + diff --git a/README.md b/README.md index 6aff27a49b..38edeaf7b8 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/appveyor.yml b/appveyor.yml index b9a9bcd1e6..df67923781 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,4 +10,5 @@ build_script: - build.cmd verify clone_depth: 1 test: off -deploy: off \ No newline at end of file +deploy: off +os: Visual Studio 2017 RC diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..0605b59c01 100644 --- a/build.ps1 +++ b/build.ps1 @@ -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 diff --git a/build.sh b/build.sh index 4fd7ede788..07997d6c83 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/build/common.props b/build/common.props new file mode 100644 index 0000000000..0e4949c657 --- /dev/null +++ b/build/common.props @@ -0,0 +1,13 @@ + + + + + 1.2.0-* + + + + + + + + \ No newline at end of file diff --git a/global.json b/global.json deleted file mode 100644 index 3a103ddd3d..0000000000 --- a/global.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "projects": [ - "samples", - "test" - ], - "sdk": { - "version": "1.0.0-preview2-1-003180" - } -} \ No newline at end of file diff --git a/makefile.shade b/makefile.shade index 1a2297d0cf..a0ccc1c675 100644 --- a/makefile.shade +++ b/makefile.shade @@ -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); } \ No newline at end of file diff --git a/samples/MusicStore.Standalone/MusicStore.Standalone.xproj b/samples/MusicStore.Standalone/MusicStore.Standalone.xproj deleted file mode 100644 index 2cd0fbd252..0000000000 --- a/samples/MusicStore.Standalone/MusicStore.Standalone.xproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - c4222506-9d5b-469d-90c1-196a3f27cb44 - .\obj - .\bin\ - - - 2.0 - - - diff --git a/samples/MusicStore.Standalone/Program.cs b/samples/MusicStore.Standalone/Program.cs deleted file mode 100644 index 0ce80f4b4d..0000000000 --- a/samples/MusicStore.Standalone/Program.cs +++ /dev/null @@ -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(); - } - } -} diff --git a/samples/MusicStore.Standalone/project.json b/samples/MusicStore.Standalone/project.json deleted file mode 100644 index 1db10d4c03..0000000000 --- a/samples/MusicStore.Standalone/project.json +++ /dev/null @@ -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 - } - } -} \ No newline at end of file diff --git a/samples/MusicStore.Standalone/web.config b/samples/MusicStore.Standalone/web.config deleted file mode 100644 index de1c22085c..0000000000 --- a/samples/MusicStore.Standalone/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/samples/MusicStore/ForTesting/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs b/samples/MusicStore/ForTesting/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs index 16ebfcfd4e..052a721a19 100644 --- a/samples/MusicStore/ForTesting/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs +++ b/samples/MusicStore/ForTesting/Mocks/OpenIdConnect/OpenIdConnectBackChannelHttpHandler.cs @@ -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") { diff --git a/samples/MusicStore/ForTesting/Mocks/Readme.md b/samples/MusicStore/ForTesting/Mocks/Readme.md deleted file mode 100644 index 8af1144a4a..0000000000 --- a/samples/MusicStore/ForTesting/Mocks/Readme.md +++ /dev/null @@ -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. \ No newline at end of file diff --git a/samples/MusicStore/MusicStore.csproj b/samples/MusicStore/MusicStore.csproj new file mode 100644 index 0000000000..52162cea6b --- /dev/null +++ b/samples/MusicStore/MusicStore.csproj @@ -0,0 +1,37 @@ + + + + + + Music store application on ASP.NET Core + Microsoft + net451;netcoreapp1.1 + $(DefineConstants);DEMO + true + Exe + win7-x64 + 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 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/MusicStore/MusicStore.xproj b/samples/MusicStore/MusicStore.xproj deleted file mode 100644 index 3c20ddf72b..0000000000 --- a/samples/MusicStore/MusicStore.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 3cfbed5d-2ed8-49db-96fb-bdaa748dc5a0 - .\obj - .\bin\ - - - 2.0 - 5001 - - - \ No newline at end of file diff --git a/samples/MusicStore/Platform.cs b/samples/MusicStore/Platform.cs index aee70ad680..4124e39065 100644 --- a/samples/MusicStore/Platform.cs +++ b/samples/MusicStore/Platform.cs @@ -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; } } diff --git a/samples/MusicStore/Startup.cs b/samples/MusicStore/Startup.cs index 6acb577bc1..3765d165f6 100644 --- a/samples/MusicStore/Startup.cs +++ b/samples/MusicStore/Startup.cs @@ -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?): diff --git a/samples/MusicStore/project.json b/samples/MusicStore/project.json deleted file mode 100644 index 5be1dd756d..0000000000 --- a/samples/MusicStore/project.json +++ /dev/null @@ -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 - } - } -} \ No newline at end of file diff --git a/samples/MusicStore/runtimeconfig.template.json b/samples/MusicStore/runtimeconfig.template.json new file mode 100644 index 0000000000..7305508a37 --- /dev/null +++ b/samples/MusicStore/runtimeconfig.template.json @@ -0,0 +1,5 @@ +{ + "configProperties": { + "System.GC.Server": true + } +} \ No newline at end of file diff --git a/test/E2ETests/Common/DbUtils.cs b/test/E2ETests/Common/DbUtils.cs index c1acbe476d..22d4a65cd0 100644 --- a/test/E2ETests/Common/DbUtils.cs +++ b/test/E2ETests/Common/DbUtils.cs @@ -23,8 +23,7 @@ namespace E2ETests public static void DropDatabase(string databaseName, ILogger logger) { - if (Helpers.RunningOnMono - || !TestPlatformHelper.IsWindows) + if (!TestPlatformHelper.IsWindows) { return; } diff --git a/test/E2ETests/Common/Helpers.cs b/test/E2ETests/Common/Helpers.cs index b78fe17a0b..edbf367450 100644 --- a/test/E2ETests/Common/Helpers.cs +++ b/test/E2ETests/Common/Helpers.cs @@ -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) diff --git a/test/E2ETests/E2ETests.csproj b/test/E2ETests/E2ETests.csproj new file mode 100644 index 0000000000..cecd0da8c1 --- /dev/null +++ b/test/E2ETests/E2ETests.csproj @@ -0,0 +1,71 @@ + + + + + + netcoreapp1.1 + MusicStore.E2ETests + Exe + true + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.2.0-preview2-build1029 + + + + + + + + + + + dotnet-test-xunit.dll + + + dotnet-test-xunit.deps.json + + + dotnet-test-xunit.runtimeconfig.json + + + dotnet-test-xunit.runtimeconfig.dev.json + + + + + + + + + + diff --git a/test/E2ETests/E2ETests.xproj b/test/E2ETests/E2ETests.xproj deleted file mode 100644 index 4058b43307..0000000000 --- a/test/E2ETests/E2ETests.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - a319acce-060b-4385-9534-9f2202f6180e - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/E2ETests/Implementation/FacebookLoginScenarios.cs b/test/E2ETests/Implementation/FacebookLoginScenarios.cs index 22aacd5a56..76640c1d0d 100644 --- a/test/E2ETests/Implementation/FacebookLoginScenarios.cs +++ b/test/E2ETests/Implementation/FacebookLoginScenarios.cs @@ -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); diff --git a/test/E2ETests/Implementation/GoogleLoginScenarios.cs b/test/E2ETests/Implementation/GoogleLoginScenarios.cs index b17d451f3a..facd839dce 100644 --- a/test/E2ETests/Implementation/GoogleLoginScenarios.cs +++ b/test/E2ETests/Implementation/GoogleLoginScenarios.cs @@ -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); diff --git a/test/E2ETests/Implementation/MicrosoftAccountAuthenticationScenarios.cs b/test/E2ETests/Implementation/MicrosoftAccountAuthenticationScenarios.cs index 4c1308e2f9..01ecdd2295 100644 --- a/test/E2ETests/Implementation/MicrosoftAccountAuthenticationScenarios.cs +++ b/test/E2ETests/Implementation/MicrosoftAccountAuthenticationScenarios.cs @@ -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> diff --git a/test/E2ETests/Implementation/TwitterLoginScenarios.cs b/test/E2ETests/Implementation/TwitterLoginScenarios.cs index d9902a1864..0def05c28c 100644 --- a/test/E2ETests/Implementation/TwitterLoginScenarios.cs +++ b/test/E2ETests/Implementation/TwitterLoginScenarios.cs @@ -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> diff --git a/test/E2ETests/Implementation/Validator.cs b/test/E2ETests/Implementation/Validator.cs index 214745513f..6ecf034177 100644 --- a/test/E2ETests/Implementation/Validator.cs +++ b/test/E2ETests/Implementation/Validator.cs @@ -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) diff --git a/test/E2ETests/NtlmAuthentationTest.cs b/test/E2ETests/NtlmAuthentationTest.cs index 48c22ef45b..f5cb2b79f7 100644 --- a/test/E2ETests/NtlmAuthentationTest.cs +++ b/test/E2ETests/NtlmAuthentationTest.cs @@ -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( diff --git a/test/E2ETests/OpenIdConnectTests.cs b/test/E2ETests/OpenIdConnectTests.cs index b5e9e19b34..a61f655923 100644 --- a/test/E2ETests/OpenIdConnectTests.cs +++ b/test/E2ETests/OpenIdConnectTests.cs @@ -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( diff --git a/test/E2ETests/PublishAndRunTests.cs b/test/E2ETests/PublishAndRunTests.cs index ce4204483f..62f710921e 100644 --- a/test/E2ETests/PublishAndRunTests.cs +++ b/test/E2ETests/PublishAndRunTests.cs @@ -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( diff --git a/test/E2ETests/SmokeTests.cs b/test/E2ETests/SmokeTests.cs index 21170f6cf9..70928986f1 100644 --- a/test/E2ETests/SmokeTests.cs +++ b/test/E2ETests/SmokeTests.cs @@ -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( diff --git a/test/E2ETests/SmokeTestsOnNanoServer.cs b/test/E2ETests/SmokeTestsOnNanoServer.cs index 49027c66ea..69550d762d 100644 --- a/test/E2ETests/SmokeTestsOnNanoServer.cs +++ b/test/E2ETests/SmokeTestsOnNanoServer.cs @@ -287,7 +287,7 @@ namespace E2ETests var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("remoteDeploymentConfig.json") - .AddUserSecrets() + .AddUserSecrets("MusicStore.E2ETests") .AddEnvironmentVariables() .Build(); diff --git a/test/E2ETests/project.json b/test/E2ETests/project.json deleted file mode 100644 index f83672947f..0000000000 --- a/test/E2ETests/project.json +++ /dev/null @@ -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": {} - } -} \ No newline at end of file diff --git a/test/MusicStore.Test/MusicStore.Test.csproj b/test/MusicStore.Test/MusicStore.Test.csproj new file mode 100644 index 0000000000..475df8a4b7 --- /dev/null +++ b/test/MusicStore.Test/MusicStore.Test.csproj @@ -0,0 +1,23 @@ + + + + + + netcoreapp1.1;net451 + netcoreapp1.1 + win7-x64 + + + + + + + + + + + + + + + diff --git a/test/MusicStore.Test/MusicStore.Test.xproj b/test/MusicStore.Test/MusicStore.Test.xproj deleted file mode 100644 index 5f0b39b3f6..0000000000 --- a/test/MusicStore.Test/MusicStore.Test.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - ca663205-77de-4e55-b300-85594181b5a9 - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/MusicStore.Test/project.json b/test/MusicStore.Test/project.json deleted file mode 100644 index 95ea6e4990..0000000000 --- a/test/MusicStore.Test/project.json +++ /dev/null @@ -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" -} \ No newline at end of file diff --git a/test/RemoteTest.ps1 b/test/RemoteTest.ps1 index c99c88b235..e8020dfbc2 100644 --- a/test/RemoteTest.ps1 +++ b/test/RemoteTest.ps1 @@ -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 diff --git a/tools/BundleAndDeploy.ps1 b/tools/BundleAndDeploy.ps1 index 7f47b4ad54..2dced78603 100644 --- a/tools/BundleAndDeploy.ps1 +++ b/tools/BundleAndDeploy.ps1 @@ -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 } diff --git a/version.props b/version.props new file mode 100644 index 0000000000..38c93687ab --- /dev/null +++ b/version.props @@ -0,0 +1,7 @@ + + + + 1.2.0 + preview1 + + \ No newline at end of file