好吧,讓我們來看看它。我使用Visual Studio 2015和ASP.NET核心標籤助手已經完全停止工作,不知道爲什麼我沒有改變任何東西。我有一天在工作,他們工作得很好,然後我在第二天進來,現在沒有ASP.NET核心Web項目顯示任何標籤助手!?!我已經嘗試創建一個新的ASP.NET核心mvc項目,他們不在那裏工作!我完全被困住了,是否有一些設置可以在Visual Studio中完全關閉它們?Visual Studio .net核心標記幫助程序不工作
請注意,我已根據大多數其他帖子檢查了通常會導致此問題的所有內容。我_ViewImports有行: -
@addTagHelper *,Microsoft.AspNetCore.Mvc.TagHelpers
,這裏是從我剛剛創建和進行任何更改在所有新項目的完整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%" ]
}
}
此外,所有的_Layout視圖和其他視圖已完全失去了他們的突出顯示,曾經出現。迄今爲止,我在互聯網上找不到的其他人似乎有這個問題,不要以爲任何人有任何想法?
編輯:
一個答案低於新的解決方案解決了這個新的項目,但我仍然有現有的解決方案/項目的問題。下面是從現有的這些項目中的一個項目文件內容,希望有人能夠發現的東西在這裏...
{
"dependencies": {
"BundlerMinifier.Core": "2.2.306",
"Configuration.Web": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "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"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"net452": {
"dependencies": {
"Aristotle.Service": {
"target": "project"
},
"Infrastructure": {
"target": "project"
}
}
}
},
"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%" ]
}
}
我一直在使用的NuGet到最新版本更新的包......
我發現當我遇到類似的問題.net核心更新我的軟件包的幫助。看起來你有幾個軟件包,即使對於版本爲1.1的版本,也是如此。也許在你創建的測試程序中升級它們,看看它是否有幫助。 – Woot
將您的項目依賴項更新爲最新的穩定版本。 – Ahmar
嗨,感謝您的迴應,我已經嘗試更新所有軟件包到最新版本,並且不幸的是沒有效果。但是,如果我將標記助手引用放入(請參閱下面的其他答案),現在可以從頭開始創建新項目。這不適用於我所有的現有項目,但是... – padigan