Skip to content

Commit

Permalink
Merge pull request #1 from myvas/release/3.1
Browse files Browse the repository at this point in the history
Release/3.1
  • Loading branch information
huangxiangyao authored Dec 14, 2019
2 parents b1fb9a7 + d777097 commit da7c4aa
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 71 deletions.
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.505"
"version": "3.1"
}
}
51 changes: 2 additions & 49 deletions samples/Demo/Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,63 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Demo</AssemblyName>
<UserSecretsId>aspnetcore-viewdivert</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
</ItemGroup>

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

<ItemGroup>
<Content Update="Views\Device\Index.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\About.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\About.mobile.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\About.tablet.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\About.weixin.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\Index.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\Index.mobile.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\Index.tablet.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home2\Index.weixin.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home\About.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home\About.mobile.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home\About.tablet.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home\About.weixin.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Home\Index.tablet.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
</ItemGroup>

</Project>
24 changes: 14 additions & 10 deletions samples/Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;

namespace Demo
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
10 changes: 6 additions & 4 deletions samples/Demo/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Demo
{
Expand All @@ -24,7 +25,7 @@ public void ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
Expand All @@ -36,12 +37,13 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
}

app.UseStaticFiles();
app.UseRouting();

app.UseMvc(routes =>
app.UseEndpoints(endpoints =>
{
routes.MapRoute(
endpoints.MapControllerRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/ViewDivert/ViewDivert.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Myvas.AspNetCore.ViewDivert</AssemblyName>
<PackageId>Myvas.AspNetCore.ViewDivert</PackageId>
<Authors>Myvas</Authors>
<Description>A Razor ViewLocationExpander to serve dedicated views for Weixin or what-you-need browsers.</Description>
<PackageProjectUrl>https://github.com/myvas/AspNetCore.ViewDivert</PackageProjectUrl>
<Version>2.1.507</Version>
<Version>3.1.0.1</Version>
<PackageTags>Myvas, AspNetCore, ViewDivert, ViewLocationExpander, AgentResolver</PackageTags>
<RootNamespace>Myvas.AspNetCore.ViewDivert</RootNamespace>
<Product>Myvas.AspNetCore.ViewDivert</Product>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.0" />
</ItemGroup>

</Project>
5 changes: 1 addition & 4 deletions test/UnitTest/UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit da7c4aa

Please sign in to comment.