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).
This commit is contained in:
parent
d7d0c617ce
commit
f6479a75cb
|
|
@ -6,9 +6,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- TODO: Remove the "PrivateAssets=all" once we no longer have RazorToolingWorkaround.cs -->
|
||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Blazor.Browser\Microsoft.AspNetCore.Blazor.Browser.csproj" PrivateAssets="all" />
|
||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Blazor\Microsoft.AspNetCore.Blazor.csproj" PrivateAssets="all" />
|
||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Blazor.Browser\Microsoft.AspNetCore.Blazor.Browser.csproj"/>
|
||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Blazor\Microsoft.AspNetCore.Blazor.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Local alternative to <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" /> -->
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.0-preview2-30230" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.1.0-rc1-10117" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.1.0-rc1-10117" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.1.0-rc1-10117" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.0-preview2-30230" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.1.0-rc1-10117" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.1.0-rc1-10117" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.1.0-rc1-10117" />
|
||||
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="0.1.0-rc1-10117" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -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 <Project Sdk="Microsoft.NET.Sdk.Web">,
|
||||
* 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<T>: BlazorComponent
|
||||
{
|
||||
// This is temporary and exists only to support TemporaryLayoutPass.
|
||||
// It will be removed when we can add Blazor-specific directives.
|
||||
public object Layout<TLayout>() where TLayout : ILayoutComponent
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
// Similar temporary mechanism as above
|
||||
public object Implements<TInterface>()
|
||||
=> throw new NotImplementedException();
|
||||
}
|
||||
|
||||
namespace Internal
|
||||
{
|
||||
public class RazorInjectAttributeAttribute : Attribute { }
|
||||
}
|
||||
}
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Rendering
|
||||
{
|
||||
public interface IJsonHelper { }
|
||||
public interface IHtmlHelper<T> { }
|
||||
}
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
{
|
||||
public interface IModelExpressionProvider { }
|
||||
}
|
||||
Loading…
Reference in New Issue