Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ASP.NET Core 3.0 Support #400

Merged
merged 32 commits into from
Jul 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
481c192
Add ASP.NET Core 3 support
Jul 6, 2019
38d3a8c
ASP.NET Core: split v2 and v3 samples
Jul 6, 2019
89de17e
Try to get the 3.0.100-preview6-012264 SDK installed here
Jul 6, 2019
ce607dc
I'm an idiot
Jul 6, 2019
5cc6001
Move Azure pipelines back to the Ubuntu build
Jul 6, 2019
a0988dc
Adjust port syntax for service containers
Jul 6, 2019
c5df9b5
Add reference assemblies via NuGet and proper case files
Jul 6, 2019
d0c62ec
Drop netcoreapp1.1 support
Jul 6, 2019
1804785
Move to preview SDK and drop old build file
Jul 6, 2019
1e66a47
Try to fix xunit on Linux
Jul 6, 2019
7190e9c
Let's try manually installing .NET Core 2.2.5
Jul 6, 2019
608bee4
Fix the include...
Jul 6, 2019
3de06e2
Add AspNetCore test suite to the build run
Jul 6, 2019
72d7798
Update build packages versions
Jul 6, 2019
208edc8
Disable net461 tests on unix
Jul 6, 2019
0d971ac
Woops, need the base project to build
Jul 6, 2019
50c7963
Fix file copies in unix
Jul 6, 2019
7968d77
SQLFormatterTests: don't assume \r\n.
May 4, 2019
df24ec1
Fix test null ref
Jul 6, 2019
2d06cc1
Logging: use .trx output
Jul 6, 2019
ef4df69
Fix test result publishing pattern
Jul 6, 2019
400148d
Skip SQL Server CE cleanup failures
Jul 6, 2019
b850ae3
Skipping Windows-only tests on Linux
Jul 6, 2019
e1c7e4e
Remove unused test project
Jul 6, 2019
cef9393
Fix appeyor build
Jul 6, 2019
d976b16
SQL Line endings: always \n all the time
Jul 6, 2019
006949e
Container port mappings, step 1
Jul 6, 2019
cf999ff
Service container ports, part 2
Jul 6, 2019
e6c879f
Azure DevOps: Ah, MySQL is already installed
Jul 6, 2019
6ca0487
Azure: simplify config
Jul 6, 2019
9d48b94
Bump version to 4.1.0-prerelease
Jul 6, 2019
43548e4
Eh, let's call it preview
Jul 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ src/MiniProfiler.Shared/ui/lib/MiniProfiler.js.map
src/MiniProfiler.Shared/ui/includes.js
src/MiniProfiler.Shared/ui/includes.min.js
tests/MiniProfiler.Tests/Test-*.xml
*.trx
17 changes: 12 additions & 5 deletions MiniProfiler.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
# Visual Studio Version 16
VisualStudioVersion = 16.0.29021.104
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{CC40098D-04F2-4F43-B5CF-B74F74351761}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -35,7 +35,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiniProfiler.Providers.SqlS
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Mvc5", "samples\Samples.Mvc5\Samples.Mvc5.csproj", "{C179CF56-7AC2-4340-8D43-2A3DCDB2E448}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCore", "samples\Samples.AspNetCore\Samples.AspNetCore.csproj", "{A3946CAB-4BF9-47C1-A517-104CD8D7F46C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCore2", "samples\Samples.AspNetCore2\Samples.AspNetCore2.csproj", "{A3946CAB-4BF9-47C1-A517-104CD8D7F46C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiniProfiler.AspNetCore", "src\MiniProfiler.AspNetCore\MiniProfiler.AspNetCore.csproj", "{6A2B5B70-1C32-482F-B5C6-0597E2D4E376}"
EndProject
Expand Down Expand Up @@ -78,10 +78,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Mvc5.EFCore", "samp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiniProfiler.Providers.MongoDB", "src\MiniProfiler.Providers.MongoDB\MiniProfiler.Providers.MongoDB.csproj", "{001EFFB2-E56C-4A63-9954-79D7AEB052DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Misc", "samples\Misc\Misc.csproj", "{44075C61-13E9-4C78-B340-6045EA115433}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Misc", "samples\Misc\Misc.csproj", "{44075C61-13E9-4C78-B340-6045EA115433}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiniProfiler.Providers.PostgreSql", "src\MiniProfiler.Providers.PostgreSql\MiniProfiler.Providers.PostgreSql.csproj", "{61E02A52-EB05-4B48-9AAE-BC7C1741E557}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCore3", "samples\Samples.AspNetCore3\Samples.AspNetCore3.csproj", "{D95A09CD-A291-42D0-AA41-8426090D0476}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -188,6 +190,10 @@ Global
{61E02A52-EB05-4B48-9AAE-BC7C1741E557}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61E02A52-EB05-4B48-9AAE-BC7C1741E557}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61E02A52-EB05-4B48-9AAE-BC7C1741E557}.Release|Any CPU.Build.0 = Release|Any CPU
{D95A09CD-A291-42D0-AA41-8426090D0476}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D95A09CD-A291-42D0-AA41-8426090D0476}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D95A09CD-A291-42D0-AA41-8426090D0476}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D95A09CD-A291-42D0-AA41-8426090D0476}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -218,10 +224,11 @@ Global
{001EFFB2-E56C-4A63-9954-79D7AEB052DB} = {6A510DBF-E85F-4D2C-B8F7-006DA31B3418}
{44075C61-13E9-4C78-B340-6045EA115433} = {E0DA4035-4D64-4BB8-8EA1-42197DE62519}
{61E02A52-EB05-4B48-9AAE-BC7C1741E557} = {6A510DBF-E85F-4D2C-B8F7-006DA31B3418}
{D95A09CD-A291-42D0-AA41-8426090D0476} = {E0DA4035-4D64-4BB8-8EA1-42197DE62519}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9373F37A-A996-4545-A251-1902C8886E3F}
LessCompiler = 6a2b5b70-1c32-482f-b5c6-0597e2d4e376
SolutionGuid = {9373F37A-A996-4545-A251-1902C8886E3F}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = StackExchange.Profiling.vsmdi
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
image: Visual Studio 2017

init:
- git config --global core.autocrlf input
- SET PATH=%POSTGRES_PATH%\bin;%MYSQL_PATH%\bin;%PATH%

install:
- choco install dotnetcore-sdk --version 3.0.100-preview6-012264
- nuget install redis-64 -excludeversion
- redis-64\tools\redis-server.exe --service-install
- redis-64\tools\redis-server.exe --service-start
Expand Down Expand Up @@ -48,7 +48,6 @@ build_script:
- createdb test
# MySQL
- mysql -e "create database test;" --user=root
- ps: .\build\dotnet-install.ps1 -Version 2.1.300
- ps: .\build.ps1 -PullRequestNumber "$env:APPVEYOR_PULL_REQUEST_NUMBER" -CreatePackages $true

test: off
Expand Down
40 changes: 16 additions & 24 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ resources:
image: mongo
ports:
- 27017:27017
- container: mysql
image: mysql
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
- container: postgres
image: postgres
ports:
Expand All @@ -23,19 +16,13 @@ resources:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test

services:
redis: redis
mongo: mongo
mysql: mysql
postgres: postgres

pool:
name: Hosted Windows Container
vmImage: win1803
vmImage: 'ubuntu-16.04'

# Build Variables
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
MYSQL_DATABASE: test
RedisConnectionString: localhost:6379
MongoDbConnectionString: mongodb://localhost:27017/test
MySQLConnectionString: server=localhost;uid=root;pwd=root;database=test;Allow User Variables=true
Expand Down Expand Up @@ -65,23 +52,28 @@ pr:
- '**/*.md'

steps:
- task: DotNetCoreInstaller@0
displayName: 'Install DotNet Core 2.1.3'
- task: UseDotNet@2
inputs:
packageType: 'runtime'
version: '2.2.5'

- task: UseDotNet@2
inputs:
version: 2.1.300
packageType: 'sdk'
version: '3.0.100-preview6-012264'

- task: PowerShell@2
displayName: 'Build / Test / Create Packages'
inputs:
targetType: filePath
filePath: build.AzureDevops.ps1
targetType: inline
script: .\build.ps1 -CreatePackages $true -PullRequestNumber $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER

- task: PublishTestResults@2
displayName: 'Publish Test Results **/Test-*.xml'
displayName: 'Publish Test Results **/*.trx'
condition: succeededOrFailed()
inputs:
testResultsFormat: XUnit
testResultsFiles: '**/Test-*.xml'
mergeTestResults: true
testRunner: VSTest
testResultsFiles: '**/*.trx'

# PR doesn't create nuget packages. So publish artifact step disabled for PR's
- task: PublishBuildArtifacts@1
Expand Down
2 changes: 0 additions & 2 deletions build.azureDevops.ps1

This file was deleted.

5 changes: 3 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ $projectsToBuild =

$testsToRun =
'MiniProfiler.Tests',
'MiniProfiler.Tests.AspNet'
'MiniProfiler.Tests.AspNet',
'MiniProfiler.Tests.AspNetCore'

if ($PullRequestNumber) {
Write-Host "Building for a pull request (#$PullRequestNumber), skipping packaging." -ForegroundColor Yellow
Expand All @@ -46,7 +47,7 @@ if ($RunTests) {
Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta"
Push-Location ".\tests\$project"

dotnet test -c Release --no-build
dotnet test -c Release --no-build --logger trx
if ($LastExitCode -ne 0) {
Write-Host "Error with tests, aborting build." -Foreground "Red"
Pop-Location
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "2.1.300"
"version": "3.0.100-preview6-012264"
}
}
File renamed without changes.
3 changes: 3 additions & 0 deletions samples/Samples.AspNetCore2/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ASP.NET Core 2.2
--------
This is a sample project demonstrating how MiniProfiler can be used in ASP.NET Core 2.2.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@
<ProjectReference Include="..\..\src\MiniProfiler.Providers.SqlServer\MiniProfiler.Providers.SqlServer.csproj" />
<ProjectReference Include="..\..\src\MiniProfiler.Providers.Sqlite\MiniProfiler.Providers.Sqlite.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions samples/Samples.AspNetCore3/Controllers/AreaController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;

namespace Samples.AspNetCore.Controllers
{
[Area("MySpace")]
public class AreaController : Controller
{
public IActionResult Simple() => Content("Simple");

public IActionResult Index() => View();
}
}
26 changes: 26 additions & 0 deletions samples/Samples.AspNetCore3/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Mvc;
using StackExchange.Profiling;

namespace Samples.AspNetCore.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
using (MiniProfiler.Current.Step("Example Step"))
{
using (MiniProfiler.Current.Step("Sub timing"))
{
// Not trying to delay the page load here, only serve as an example
}
using (MiniProfiler.Current.Step("Sub timing 2"))
{
// Not trying to delay the page load here, only serve as an example
}
}
return View();
}

public IActionResult Error() => View();
}
}
Loading