从ASP.NET Core 1.0升级到1.1后,Tag Helper Intellisense无法正常工作 [英] Tag Helper Intellisense not working after upgrading from ASP.NET Core 1.0 to 1.1

查看:79
本文介绍了从ASP.NET Core 1.0升级到1.1后,Tag Helper Intellisense无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASP.NET Core 1.0到1.1 .但是 Tag Helper Intellisense 不起作用.可能缺少什么?:

After upgrading from ASP.NET Core 1.0 to 1.1. But the Tag Helper Intellisense does not work. What may be missing?:

project.json

{
  "userSecretsId": "aspnet-ABCTest-6af8ade3-87ff-4468-a9ce-8bb69c696ab8",

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.AspNetCore.Mvc.Core": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Identity": "1.1.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final",
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-preview4-final"  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238"
  },

  "frameworks": {
    "netcoreapp1.1": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "Areas/**/Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

更新:

_ViewImports.cshtml :

@using myProj
@using myProj.Models
@using myProj.Models.AccountViewModels
@using myProj.Models.ManageViewModels
@using myProj.AspNetCore.Identity
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

构建正常.标签助手也可以工作,但是我必须对诸如 asp-controller asp-action asp-for asp-items 等.在我移到ASP.NET Core 1.1之前,它一直在工作

The build works fine. The tag helpers also work but I have to hard code the attributes such as asp-controller, asp-action, asp-for, asp-items etc. It was working before I moved to ASP.NET Core 1.1

在埃里克·安德森(Eric Anderson)的文章的包装"部分之前也有一条注释,此处关于智能感知相关问题.不确定在这里是否相关.

There is also a note just before the Wrapping Section of Eric Anderson's article here about intellisense related issue. Not sure if that is relevant here.

推荐答案

Microsoft.AspNetCore.Razor.Tools的问题.

Problem with Microsoft.AspNetCore.Razor.Tools.

您具有依赖项,但还需要将其添加到工具中

You have it in dependencies, but you need to add it to tools also:

 "tools": {
    "BundlerMinifier.Core": "2.0.238",
    "Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final"
  },

这篇关于从ASP.NET Core 1.0升级到1.1后,Tag Helper Intellisense无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆