• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

从ASP.NET Core 1.0升级到1.1后,Tag Helper智能感应不起作用

visual-studio-2015 来源:nam 3次浏览

从ASP.NET Core 1.0 to 1.1升级后。但Tag Helper Intellisense不起作用。什么可能会丢失?:从ASP.NET Core 1.0升级到1.1后,Tag Helper智能感应不起作用

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%" ] 
    } 
} 

UPDATE

_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-controllerasp-actionasp-forasp-items等。这是工作之前,我搬到了ASP.NET 1.1的核心

还有一张纸条就在包装前节Eric Anderson关于智能感知相关问题的文章here。不知道这是否与此有关。


===========解决方案如下:

问题与Microsoft.AspNetCore.Razor.Tools。

你拥有了它的相关性,但是你需要把它添加到工具也:

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

版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)