【问题标题】:ASP.NET Core Web Application (.NET Framework) TagHelper IntellisenseASP.NET Core Web 应用程序 (.NET Framework) TagHelper Intellisense
【发布时间】:2018-02-12 19:22:48
【问题描述】:

我创建了一个 ASP.NET Core 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%" ]
  }

有什么想法吗?

【问题讨论】:

    标签: c# asp.net-core asp.net-core-tag-helpers


    【解决方案1】:

    Intellisense 与您的 project.json 无关。这完全是关于在适当版本的 Visual Studio 中安装适当的工具。 ASP.Net Web 框架和工具扩展适用于 MVC 5,而不是核心,因此对您没有帮助。您需要Visual Studio 2015 Update 3.3(必须先安装Visual Studio 2015 Update 3)和.NET Core 1.0.1 - VS 2015 Tooling Preview 2(在撰写本文时)。

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

    【讨论】:

    • 感谢您的回复。我确认我有 Update 3 和 Tooling Preview 2 ......所以我想我将不得不等到 15 发布或 2015 年工具的新版本被向后移植。无赖。
    • 我在 GitHub 上为此打开了一个问题:github.com/aspnet/Tooling/issues/846
    • @ChrisPratt 我已经安装了最新的更新(你提到的)有同样的问题。
    • 我想我会用构建项目的解决方案来更新未来的访问者。在您构建项目之前,标签助手的智能感知将无法工作。
    • 我无法让它与更新和构建一起使用。
    猜你喜欢
    • 2017-08-15
    • 2018-08-03
    • 2016-10-04
    • 1970-01-01
    • 2022-12-05
    • 1970-01-01
    • 1970-01-01
    • 2019-07-17
    • 1970-01-01
    相关资源
    最近更新 更多