ASP.NET 核心 Web 应用程序 (.NET Framework) TagHelper Intellisense

ASP.NET Core Web Application (.NET Framework) TagHelper Intellisense

我创建了一个 ASP.NET 核心 Web 应用程序 (.NET Framework) 项目并期望 TagHelper Intellisense 工作(就像非 .Net Framework 核心项目一样);但它不起作用。

我看不到智能感知,例如但不限于:asp-for,asp-controller。

我错过了什么?

ASP.Net Web 框架和工具扩展版本:5.2.40314.0

这是我的 project.json:

"dependencies": {
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Routing": "1.0.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "net452": { }
  },

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

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

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

有什么想法吗?

Intellisense 与您的 project.json 无关。这完全是关于在 Visual Studio 的适当版本中安装适当的工具。 ASP.Net Web Frameworks and Tools Extension 适用于 MVC 5,而不适用于 Core,因此这对您没有帮助。您需要 Visual Studio 2015 Update 3.3 (Visual Studio 2015 Update 3 must be installed first) with .NET Core 1.0.1 - VS 2015 Tooling Preview 2(在撰写本文时)。

如果您拥有所有这些,但仍然无法正常工作,那么它可能是一个错误或只是未完成。请记住,尽管已经发布了 1.0 版,但 Core 仍在进行中。特别是工具,仍然在不断变化。您可以关注 Visual Studio "15" 的开发,了解工具的进展情况。为 Visual Studio 2015(不要与“15”混淆)提供的所有工具几乎都是从预览 Visual Studio.

向后移植的