From f6479a75cb37ee1af5b76e6b36bf67c8a3ff1387 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Fri, 23 Mar 2018 15:06:52 -0700 Subject: [PATCH] Remove workaround for old Razor tooling This isn't needed anymore to support the Blazor design-time experience. Now that it's gone, it will no longer cause conflicts with MVC's types so we can remove the other workaround (privateassets). --- .../HostedInAspNet.Client.csproj | 5 +- .../BlazorHosted.CSharp.Client.csproj | 2 +- .../BlazorStandalone.CSharp.csproj | 2 +- .../Components/RazorToolingWorkaround.cs | 58 ------------------- 4 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.Blazor/Components/RazorToolingWorkaround.cs diff --git a/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj b/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj index d947d5568a..fbec52a713 100644 --- a/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj +++ b/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj @@ -6,9 +6,8 @@ - - - + + diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Client/BlazorHosted.CSharp.Client.csproj b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Client/BlazorHosted.CSharp.Client.csproj index 77d692fc9d..abb47f68ab 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Client/BlazorHosted.CSharp.Client.csproj +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Client/BlazorHosted.CSharp.Client.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/BlazorStandalone.CSharp.csproj b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/BlazorStandalone.CSharp.csproj index 2c05a2dab0..b74335aae4 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/BlazorStandalone.CSharp.csproj +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/BlazorStandalone.CSharp.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.AspNetCore.Blazor/Components/RazorToolingWorkaround.cs b/src/Microsoft.AspNetCore.Blazor/Components/RazorToolingWorkaround.cs deleted file mode 100644 index 9d8b414c4c..0000000000 --- a/src/Microsoft.AspNetCore.Blazor/Components/RazorToolingWorkaround.cs +++ /dev/null @@ -1,58 +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. - -/* - * Currently if you have a .cshtml file in a project with , - * Visual Studio will run design-time builds for the .cshtml file that assume certain ASP.NET MVC - * APIs exist. Since those namespaces and types wouldn't normally exist for Blazor client apps, - * this leads to spurious errors in the Errors List pane, even though there aren't actually any - * errors on build. As a workaround, we define here a minimal set of namespaces/types that satisfy - * the design-time build. - * - * TODO: Track down what is triggering the unwanted design-time build and find out how to disable it. - * Then this file can be removed entirely. - * - * TODO: Once this is removed, also remove all the PrivateAssets="all" flags from the references in - * all the project templates/samples. - */ - -using Microsoft.AspNetCore.Blazor.Components; -using Microsoft.AspNetCore.Blazor.Layouts; -using System; - -namespace Microsoft.AspNetCore.Mvc -{ - public interface IUrlHelper { } - public interface IViewComponentHelper { } -} - -namespace Microsoft.AspNetCore.Mvc.Razor -{ - public class RazorPage: BlazorComponent - { - // This is temporary and exists only to support TemporaryLayoutPass. - // It will be removed when we can add Blazor-specific directives. - public object Layout() where TLayout : ILayoutComponent - => throw new NotImplementedException(); - - // Similar temporary mechanism as above - public object Implements() - => throw new NotImplementedException(); - } - - namespace Internal - { - public class RazorInjectAttributeAttribute : Attribute { } - } -} - -namespace Microsoft.AspNetCore.Mvc.Rendering -{ - public interface IJsonHelper { } - public interface IHtmlHelper { } -} - -namespace Microsoft.AspNetCore.Mvc.ViewFeatures -{ - public interface IModelExpressionProvider { } -}