Skip to content

Commit

Permalink
.NET 5.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nm-a committed Nov 12, 2020
1 parent 4c5ff44 commit 3b98bd7
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 50 deletions.
5 changes: 5 additions & 0 deletions RazorLight.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Publish", "Publish", "{03C5
makeNuget.cmd = makeNuget.cmd
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EC25D85F-CCCC-43E1-AACD-2D710C1B760B}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion samples/RazorLight.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void Main(string[] args)
string templateKey = "2";
var model = new TestViewModel() { Name = "Johny", Age = 22 };

#if (NETCOREAPP3_0 || NETCOREAPP3_1)
#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0)
model.Age = 40;
#endif
string result = engine.CompileRenderAsync(templateKey, model).Result;
Expand Down
42 changes: 21 additions & 21 deletions samples/RazorLight.Samples/Samples.EntityFrameworkProject.csproj
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.0;netcoreapp3.1;net5.0</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.1.14" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.5" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\RazorLight\RazorLight.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\RazorLight\RazorLight.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion sandbox/RazorLight.Sandbox/RazorLight.Sandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>net5.0</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/RazorLight.Precompile/RazorLight.Precompile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/RazorLight/DefaultRazorEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public override IEnumerable<RazorProjectItem> EnumerateItems(string basePath)
}


#if (NETCOREAPP3_0 || NETCOREAPP3_1)
#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0)
[System.Obsolete]
#endif
public override RazorProjectItem GetItem(string path)
{
throw new System.NotImplementedException();
}

#if (NETCOREAPP3_0 || NETCOREAPP3_1)
#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0)
public override RazorProjectItem GetItem(string path, string fileKind)
{
throw new System.NotImplementedException();
Expand Down
31 changes: 14 additions & 17 deletions src/RazorLight/RazorLight.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;netcoreapp3.1;net5.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -18,22 +18,6 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.CodeAnalysis.Razor" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="[2.1.0,3)" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="[2.1.0,3)" />
<PackageReference Include="System.Buffers" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="[3.0.3,3.1)" />
Expand All @@ -60,6 +44,19 @@
<PackageReference Include="System.Buffers" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Razor" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="5.0.0" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
Expand Down
14 changes: 7 additions & 7 deletions tests/RazorLight.Tests/RazorLight.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<PreserveCompilationContext>true</PreserveCompilationContext>
<DefineConstants>$(DefineConstants);SOME_TEST_DEFINE</DefineConstants>
Expand Down Expand Up @@ -40,12 +40,6 @@
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="2.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="3.0.3" />
Expand All @@ -58,6 +52,12 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.5" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\RazorLight\RazorLight.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 3b98bd7

Please sign in to comment.