Update Razor Components and Blazor templates (#6682)
This commit is contained in:
parent
f072523780
commit
864f76b2c0
|
|
@ -4,14 +4,16 @@
|
|||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RestoreAdditionalProjectSources Condition="'$(IncludeCustomRestoreSourcesSymbol)'=='true'">
|
||||
https://dotnet.myget.org/f/blazor-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
||||
</RestoreAdditionalProjectSources>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="$(TemplateBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Build" Version="$(TemplateBlazorPackageVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="$(TemplateBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="$(TemplateBlazorPackageVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Razor" Version="$(MicrosoftNETSdkRazorPackageVersion)" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Microsoft.AspNetCore.Components.Hosting;
|
||||
using Microsoft.AspNetCore.Blazor.Hosting;
|
||||
|
||||
namespace BlazorHosted_CSharp.Client
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<RestoreAdditionalProjectSources Condition="'$(IncludeCustomRestoreSourcesSymbol)'=='true'">
|
||||
https://dotnet.myget.org/f/blazor-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
||||
</RestoreAdditionalProjectSources>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Server" Version="$(TemplateBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="$(TemplateRazorDesignPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="$(TemplateBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Server" Version="$(TemplateComponentsPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
using Microsoft.AspNetCore.Components.Server;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.ResponseCompression;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Linq;
|
||||
using System.Net.Mime;
|
||||
|
||||
namespace BlazorHosted_CSharp.Server
|
||||
{
|
||||
|
|
@ -16,15 +14,7 @@ namespace BlazorHosted_CSharp.Server
|
|||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddMvc();
|
||||
|
||||
services.AddResponseCompression(options =>
|
||||
{
|
||||
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[]
|
||||
{
|
||||
MediaTypeNames.Application.Octet,
|
||||
WasmMediaTypeNames.Application.Wasm,
|
||||
});
|
||||
});
|
||||
services.AddResponseCompression();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
|
@ -43,6 +33,7 @@ namespace BlazorHosted_CSharp.Server
|
|||
});
|
||||
|
||||
app.UseBlazor<Client.Startup>();
|
||||
app.UseBlazorDebugging();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<IsPackable>true</IsPackable>
|
||||
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
|
||||
<RestoreAdditionalProjectSources Condition="'$(IncludeCustomRestoreSourcesSymbol)'=='true'">
|
||||
https://dotnet.myget.org/f/blazor-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
||||
</RestoreAdditionalProjectSources>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
|
@ -19,8 +18,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="$(TemplateBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Build" Version="$(TemplateBlazorPackageVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="$(TemplateComponentsPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Build" Version="$(TemplateComponentsPackageVersion)" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -5,14 +5,16 @@
|
|||
<RunCommand>dotnet</RunCommand>
|
||||
<RunArguments>blazor serve</RunArguments>
|
||||
<RestoreAdditionalProjectSources Condition="'$(IncludeCustomRestoreSourcesSymbol)'=='true'">
|
||||
https://dotnet.myget.org/f/blazor-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
||||
</RestoreAdditionalProjectSources>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="$(TemplateBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Build" Version="$(TemplateBlazorPackageVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="$(TemplateBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="$(TemplateBlazorPackageVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Razor" Version="$(MicrosoftNETSdkRazorPackageVersion)" PrivateAssets="All" />
|
||||
|
||||
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="$(TemplateBlazorPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Microsoft.AspNetCore.Components.Hosting;
|
||||
using Microsoft.AspNetCore.Blazor.Hosting;
|
||||
|
||||
namespace BlazorStandalone_CSharp
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,4 +2,8 @@
|
|||
<Project>
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\..\build\dependencies.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\..\build\sources.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<IncludeCustomRestoreSourcesSymbol>true</IncludeCustomRestoreSourcesSymbol>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -12,14 +12,15 @@
|
|||
<MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>3.0.0-alpha1-10605</MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>
|
||||
<MicrosoftAspNetCoreRazorDesignPackageVersion>3.0.0-alpha1-10605</MicrosoftAspNetCoreRazorDesignPackageVersion>
|
||||
<MicrosoftExtensionsDependencyInjectionPackageVersion>3.0.0-alpha1-10605</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
||||
<MicrosoftNETSdkRazorPackageVersion>3.0.0-preview-19057-06</MicrosoftNETSdkRazorPackageVersion>
|
||||
<MonoCecilPackageVersion>0.10.1</MonoCecilPackageVersion>
|
||||
<SignalRPackageVersion>3.0.0-alpha1-10605</SignalRPackageVersion>
|
||||
<TemplateBlazorPackageVersion>0.8.0-preview1-20181122.3</TemplateBlazorPackageVersion>
|
||||
<TemplateBlazorPackageVersion>0.8.0-preview-19064-0339</TemplateBlazorPackageVersion>
|
||||
<TemplateComponentsPackageVersion>3.0.0-preview-19064-0339</TemplateComponentsPackageVersion>
|
||||
<TemplateRazorDesignPackageVersion>2.1.2</TemplateRazorDesignPackageVersion>
|
||||
<RazorPackageVersion>3.0.0-alpha1-10605</RazorPackageVersion>
|
||||
<MicrosoftAspNetCoreBlazorMonoPackageVersion>0.8.0-preview1-20181126.1</MicrosoftAspNetCoreBlazorMonoPackageVersion>
|
||||
|
||||
<!-- When updating this, ensure you also update Browser.JS/package.json to reference the corresponding version of @dotnet/jsinterop -->
|
||||
<JSInteropPackageVersion>0.8.0-preview1-20181126.1</JSInteropPackageVersion>
|
||||
<JSInteropPackageVersion>0.8.0-preview1-20181126.4</JSInteropPackageVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
|
||||
https://dotnet.myget.org/f/blazor-dev/api/v3/index.json;
|
||||
</RestoreSources>
|
||||
<RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'">
|
||||
$(RestoreSources);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<MicrosoftAspNetCoreAppPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreAppPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationAzureADB2CUIPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreAuthenticationAzureADB2CUIPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationAzureADUIPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreAuthenticationAzureADUIPackageVersion>
|
||||
<MicrosoftAspNetCoreComponentsPackageVersion>3.0.0-preview-18606-0103</MicrosoftAspNetCoreComponentsPackageVersion>
|
||||
<MicrosoftAspNetCoreComponentsPackageVersion>3.0.0-preview-19064-0342</MicrosoftAspNetCoreComponentsPackageVersion>
|
||||
<MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>
|
||||
<MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>
|
||||
<MicrosoftAspNetCoreIdentityUIPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreIdentityUIPackageVersion>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<MicrosoftEntityFrameworkCoreToolsPackageVersion>3.0.0-preview-181109-02</MicrosoftEntityFrameworkCoreToolsPackageVersion>
|
||||
<MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>3.0.0-preview-181113-11</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
|
||||
<MicrosoftNETCoreAppPackageVersion>3.0.0-preview1-26907-05</MicrosoftNETCoreAppPackageVersion>
|
||||
<MicrosoftNETSdkRazorPackageVersion>3.0.0-preview-18579-0056</MicrosoftNETSdkRazorPackageVersion>
|
||||
<MicrosoftNETSdkRazorPackageVersion>3.0.0-preview-19057-06</MicrosoftNETSdkRazorPackageVersion>
|
||||
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
|
||||
<SeleniumSupportPackageVersion>3.12.1</SeleniumSupportPackageVersion>
|
||||
<SeleniumWebDriverMicrosoftDriverPackageVersion>17.17134.0</SeleniumWebDriverMicrosoftDriverPackageVersion>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
MicrosoftEntityFrameworkCoreToolsDotNetPackageVersion=$(MicrosoftEntityFrameworkCoreToolsDotNetPackageVersion);
|
||||
MicrosoftEntityFrameworkCoreToolsPackageVersion=$(MicrosoftEntityFrameworkCoreToolsPackageVersion);
|
||||
MicrosoftNETCoreAppPackageVersion=$(MicrosoftNETCoreAppPackageVersion);
|
||||
MicrosoftNETSdkRazorPackageVersion=$(MicrosoftNETSdkRazorPackageVersion);
|
||||
</GeneratedContentProperties>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">RazorComponentsWeb_CSharp.App</RootNamespace>
|
||||
|
||||
<!-- The linker is not beneficial for server-side execution. Re-enable this if you switch to WebAssembly execution. -->
|
||||
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- TODO: Remove this once it's included in the shared framework -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="${MicrosoftAspNetCoreComponentsPackageVersion}" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Build" Version="${MicrosoftAspNetCoreComponentsPackageVersion}" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Razor" Version="${MicrosoftNETSdkRazorPackageVersion}" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -14,9 +14,6 @@
|
|||
|
||||
<!-- TODO: Remove this block once it's included in the shared framework -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCoreComponentsPackageVersion}" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="${MicrosoftAspNetCoreComponentsPackageVersion}" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="${MicrosoftAspNetCoreComponentsPackageVersion}" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Server" Version="${MicrosoftAspNetCoreComponentsPackageVersion}" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
Configuring this here is temporary. Later we'll move the app config
|
||||
into Program.cs, and it won't be necessary to specify AppAssembly.
|
||||
-->
|
||||
<Router AppAssembly=typeof(Program).Assembly />
|
||||
<Router AppAssembly=typeof(Startup).Assembly />
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
using Microsoft.AspNetCore.Components.Hosting;
|
||||
|
||||
namespace RazorComponentsWeb_CSharp.App
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) =>
|
||||
BlazorWebAssemblyHost.CreateDefaultBuilder()
|
||||
.UseBlazorStartup<Startup>();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Mime;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Components.Server;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.ResponseCompression;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace RazorComponentsWeb_CSharp.Server
|
||||
|
|
@ -18,17 +15,7 @@ namespace RazorComponentsWeb_CSharp.Server
|
|||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Adds the Server-Side Blazor services, and those registered by the app project's startup.
|
||||
services.AddServerSideBlazor<App.Startup>();
|
||||
|
||||
services.AddResponseCompression(options =>
|
||||
{
|
||||
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[]
|
||||
{
|
||||
MediaTypeNames.Application.Octet,
|
||||
WasmMediaTypeNames.Application.Wasm,
|
||||
});
|
||||
});
|
||||
services.AddRazorComponents<App.Startup>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
|
@ -39,8 +26,8 @@ namespace RazorComponentsWeb_CSharp.Server
|
|||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
// Use component registrations and static files from the app project.
|
||||
app.UseServerSideBlazor<App.Startup>();
|
||||
app.UseStaticFiles();
|
||||
app.UseRazorComponents<App.Startup>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
|
@ -11,6 +11,6 @@
|
|||
<body>
|
||||
<app>Loading...</app>
|
||||
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
<script src="_framework/components.server.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue