From d3bdb987b0f5879bbb570ea712bc295b09c219b5 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Fri, 6 Apr 2018 14:25:35 -0700 Subject: [PATCH] Add a new feed dotnet-core This is the *new* and most correct feed for our developer builds. Leaving the old ones there for now because the other ASP.NET Repos also left them there. --- build/sources.props | 1 + .../BlazorConfiguration.cs | 16 ---------- .../BlazorExtensionInitializer.cs | 31 +++++-------------- 3 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorConfiguration.cs diff --git a/build/sources.props b/build/sources.props index c9c480c8d4..8c5d2ada6e 100644 --- a/build/sources.props +++ b/build/sources.props @@ -5,6 +5,7 @@ $(DotNetRestoreSources) $(RestoreSources); + 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 diff --git a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorConfiguration.cs b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorConfiguration.cs deleted file mode 100644 index 4fcab4fcd0..0000000000 --- a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorConfiguration.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Microsoft.AspNetCore.Razor.Language; - -namespace Microsoft.AspNetCore.Blazor.Razor -{ - public static class BlazorConfiguration - { - public static readonly RazorConfiguration Default = new RazorConfiguration( - RazorLanguageVersion.Version_2_1, - "Blazor-0.1", - Array.Empty()); - } -} diff --git a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs index cfb2e3fe0b..d596f33446 100644 --- a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs +++ b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs @@ -17,30 +17,15 @@ namespace Microsoft.AspNetCore.Blazor.Razor static BlazorExtensionInitializer() { - // RazorConfiguration is changing between 15.7 and preview2 builds of Razor, this is a reflection-based - // workaround. - DeclarationConfiguration = Create("BlazorDeclaration-0.1"); - DefaultConfiguration = Create("Blazor-0.1"); + DeclarationConfiguration = RazorConfiguration.Create( + RazorLanguageVersion.Version_2_1, // Cannot use experimental until 15.7p4 + "BlazorDeclaration-0.1", + Array.Empty()); - RazorConfiguration Create(string configurationName) - { - var args = new object[] { RazorLanguageVersion.Version_2_1, configurationName, Array.Empty(), }; - - MethodInfo method; - ConstructorInfo constructor; - if ((method = typeof(RazorConfiguration).GetMethod("Create", BindingFlags.Public | BindingFlags.Static)) != null) - { - return (RazorConfiguration)method.Invoke(null, args); - } - else if ((constructor = typeof(RazorConfiguration).GetConstructors().FirstOrDefault()) != null) - { - return (RazorConfiguration)constructor.Invoke(args); - } - else - { - throw new InvalidOperationException("Can't create a configuration. This is bad."); - } - } + DefaultConfiguration = RazorConfiguration.Create( + RazorLanguageVersion.Version_2_1, + "Blazor-0.1", + Array.Empty()); } public static void Register(RazorProjectEngineBuilder builder)