Skip to content

Commit

Permalink
Switch from Mono to .NET Core
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel15 committed Nov 9, 2017
1 parent ef5033c commit b239a44
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
5 changes: 4 additions & 1 deletion Daniel15.Web/Daniel15.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Daniel15.Web</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -24,6 +24,8 @@

<ItemGroup>
<PackageReference Include="Daniel15.SimpleIdentity" Version="2.0.0" />
<PackageReference Include="JavaScriptEngineSwitcher.ChakraCore" Version="2.4.10" />
<PackageReference Include="JavaScriptEngineSwitcher.ChakraCore.Native.debian-x64" Version="2.4.6" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.0.0-alpha9-00202" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.0.0-alpha9-00202" />
<PackageReference Include="React.AspNet" Version="3.1.0" />
Expand All @@ -43,6 +45,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" />
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions Daniel15.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Linq;
using Daniel15.Infrastructure;
using Daniel15.SimpleIdentity;
using JavaScriptEngineSwitcher.ChakraCore;
using JavaScriptEngineSwitcher.Core;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand Down Expand Up @@ -36,6 +38,7 @@ public IServiceProvider ConfigureServices(IServiceCollection services)

services.AddSession();
services.AddMvc();
JsEngineSwitcher.Instance.EngineFactories.Add(new ChakraCoreJsEngineFactory());
services.AddReact();
services.AddDaniel15(Configuration);
services.AddDaniel15Config(Configuration);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This is the code that powers [my personal website](https://dan.cx/) and blog. It uses C# and the ASP.NET Core MVC framework, with some older bits in PHP.

The live site is currently running on [Mono](http://www.mono-project.com/) 3.8.0.
The live site is currently running on .NET Core 2.0

Blog
====
Expand Down
12 changes: 2 additions & 10 deletions publishToTemp.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
::: ASP.NET Core view precompilation doesn't work when cross-compiling for Linux
::: (https://github.com/aspnet/MvcPrecompilation/issues/102). This works around it by building first
::: for Windows, then building again for Debian, then copying across the view assembly.
dotnet restore
dotnet publish Daniel15.Web -o "C:\TempPublish\site_win" -c Release
dotnet restore -r debian.8-x64
dotnet publish Daniel15.Web -o "C:\TempPublish\site" -c Release -r debian.8-x64 /p:MvcRazorCompileOnPublish=false
dotnet publish Daniel15.Cron -o "C:\TempPublish\cron" -c Release -r debian.8-x64

copy c:\TempPublish\site_win\Daniel15.Web.PrecompiledViews.dll c:\TempPublish\site\
rd /s /q c:\TempPublish\site\Views
dotnet publish Daniel15.Web -o "C:\TempPublish\site" -c Release
dotnet publish Daniel15.Cron -o "C:\TempPublish\cron" -c Release

0 comments on commit b239a44

Please sign in to comment.