Skip to content

Commit

Permalink
Update to .NET Core 2.0 MVC + ServiceStack v5
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 28, 2017
1 parent c983577 commit 60d0700
Show file tree
Hide file tree
Showing 40 changed files with 324 additions and 6,960 deletions.
60 changes: 60 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Mvc/bin/Debug/netcoreapp2.0/Mvc.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Mvc",
"console": "internalConsole",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Mvc/bin/Debug/netcoreapp2.0/Mvc.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Mvc",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet build",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"options": {
"cwd": "${workspaceFolder}/src/Mvc"
},
"problemMatcher": "$msCompile"
}
]
}
3 changes: 0 additions & 3 deletions src/Mvc/.bowerrc

This file was deleted.

11 changes: 11 additions & 0 deletions src/Mvc/Models/ErrorViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace Mvc.Models
{
public class ErrorViewModel
{
public string RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}
55 changes: 15 additions & 40 deletions src/Mvc/Mvc.csproj
Original file line number Diff line number Diff line change
@@ -1,55 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Mvc</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Mvc</PackageId>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<None Update="wwwroot\**\*">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.*" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.*" />
<PackageReference Include="ServiceStack" Version="5.*" />
<PackageReference Include="ServiceStack.Interfaces" Version="5.*" />
<PackageReference Include="ServiceStack.Text" Version="5.*" />
<PackageReference Include="ServiceStack.Client" Version="5.*" />
<PackageReference Include="ServiceStack.Common" Version="5.*" />
<PackageReference Include="ServiceStack.Mvc" Version="5.*" />
<PackageReference Include="ServiceStack.Redis" Version="5.*" />
<PackageReference Include="ServiceStack.OrmLite" Version="5.*" />
<PackageReference Include="ServiceStack.OrmLite.Sqlite" Version="5.*" />
<PackageReference Include="ServiceStack.Server" Version="5.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.*" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.*" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.*" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.*" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.*" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.*" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.*" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.*" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="1.*" />
<PackageReference Include="ServiceStack.Text.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.Interfaces.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.Client.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.Common.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.Mvc.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.Redis.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.OrmLite.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.OrmLite.Sqlite.Core" Version="1.0.*" />
<PackageReference Include="ServiceStack.Server.Core" Version="1.0.*" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.1" />
</ItemGroup>

<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command="bower install" />
<Exec Command="dotnet bundle" />
</Target>

<ItemGroup>
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.301" />
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.6.362" />
</ItemGroup>

</Project>
16 changes: 8 additions & 8 deletions src/Mvc/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace Mvc
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseUrls("http://0.0.0.0:11001/")
BuildWebHost(args).Run();
}

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();

host.Run();
}
}
}
187 changes: 0 additions & 187 deletions src/Mvc/Project_Readme.html

This file was deleted.

Loading

0 comments on commit 60d0700

Please sign in to comment.