【问题标题】:taghelpers Intellisense missing with in beta 5 Asp.net 5 MVC 6在 beta 5 Asp.net 5 MVC 6 中缺少 taghelpers Intellisense
【发布时间】:2015-09-22 02:25:28
【问题描述】:

在 beta 5 中,VS2015 中的智能感知不适用于 taghelpers。 我通过将此存根添加到我的项目中修复了缺少的属性错误消息

我该如何解决这个问题?

using System;

namespace Microsoft.AspNet.Mvc
{
    /// <summary>
    /// Specifies that a property or parameter value should be initialized via the dependency injection
    /// container for activated types.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)]
    public sealed class ActivateAttribute : Attribute
    {
    }
}

【问题讨论】:

    标签: asp.net-core asp.net-core-mvc tag-helpers


    【解决方案1】:

    找到它。我暂时使用了 beta 6。但忘记将 _ViewImports 重命名为 _GlobalImport

    【讨论】:

    • 我很困惑。在 beta5 中,它必须命名为 _ViewImports.cshtml。我提到这一点是因为我使用的是 beta5,而且我也无法在 taghelpers 上获得智能感知。如果将 _ViewImports.cshtml 重命名回 _GlobalImport.cshtml 可以修复智能感知,我猜这是 VS 仍然需要 _GlobalImport.cshtml 的工具问题,但在 beta5 中,如果 _ViewImports.cshtml 不存在,则会出现其他错误。
    • 你的存根看起来像一个 hack 与 breaking change 相比,ActivateAttribute 已被删除,而你试图假装它仍然存在
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-02
    • 2016-01-15
    • 1970-01-01
    • 1970-01-01
    • 2016-04-06
    • 1970-01-01
    相关资源
    最近更新 更多