asp.net-mvc Web 项目需要使用 Razor 语法 3.0.0.0 缺少 Web 组件 ASP.NET 网页
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19769062/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Web project requires missing web component ASP.NET Web pages with Razor syntax 3.0.0.0
提问by Mohammadreza
I Migrate my project to mvc 5.0 and razor engin 3 with Microsoft Instruction
我使用Microsoft 指令将我的项目迁移到 mvc 5.0 和 razor 引擎 3
But when open my solution Get this:

但是当打开我的解决方案时得到这个:

The Web project 'ProjectName' requires missing web components to run with Visual Studio. Would you like to download and install them using the Web Platform Installer now? (Note: Some components might require restart to take effect.)
Web 项目“ProjectName”需要缺少 Web 组件才能与 Visual Studio 一起运行。您想立即使用 Web 平台安装程序下载并安装它们吗?(注意:某些组件可能需要重新启动才能生效。)
ASP.NET Web pages with Razor syntax 3.0.0.0
使用 Razor 语法 3.0.0.0 的 ASP.NET 网页
but these answer doesn't help me I appreciate for any help
但这些答案对我没有帮助 我感谢任何帮助
Update:My Project Build Very well and works without any exception with razor 3 and mvc 5 but just Intellisense doesn't sensemy Typing and coloring my Code
更新:我的项目构建非常好并且在 razor 3 和 mvc 5 中毫无例外地工作,但只有Intellisense 无法感知我的输入和着色我的代码
and also when change this line to Value="2.0.0.0"in Application web Config file above error vanish and intelisens works fine
并且当在应用程序 web 配置文件中将此行更改为Value="2.0.0.0"时,错误消失并且 intelisens 工作正常
<appSettings>
<add key="webpages:Version" **value="3.0.0.0"** />
...
</appSettings>
UpdateAfter some while, now you can user razor 3 on vs 2012. Here you can upgrade
更新一段时间后,现在您可以在 vs 2012 上使用 razor 3。在 这里您可以升级
采纳答案by Mohammadreza
I Found The Problem, vs 2012 doesn't support it(see update section of this answer)
我发现问题,vs 2012 不支持它(请参阅此答案的更新部分)
From Heresaid:
从这里说:
Unlike Razor V2 runtime and design time, VS2013 did not GAC these binaries. Instead, the binaries are installed in the project bin folder when corresponding NuGet package is installed, and in “%ProgramFiles (x86)%\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\Web\Razor\v3.0” to support design time.
与 Razor V2 运行时和设计时不同,VS2013 没有对这些二进制文件进行 GAC。而是在安装相应的 NuGet 包时将二进制文件安装在项目 bin 文件夹中,并在“%ProgramFiles (x86)%\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\Web\Razor\v3.0”中支持设计时间。
So we don't have these dlls in above path when upgrade to mvc5 /razor 3
因此,当升级到 mvc5 /razor 3 时,我们在上述路径中没有这些 dll
also read this stack question
另请阅读此堆栈问题
update: now support it, update vs from here
更新:现在支持它,从这里更新vs
回答by André Louren?o
I had this problem after installing Visual Studio 2012.
安装 Visual Studio 2012 后我遇到了这个问题。
What solved for me was installing the Visual Studio Updates:
为我解决的是安装 Visual Studio 更新:
- Tools> Extensions And Updates
- Select "Updates" in the accordion list on the left.
- Select "Product Updates".
- Update to the newest version (At the time of writing of this answer it was Update 4)
- 工具> 扩展和更新
- 在左侧的手风琴列表中选择“更新”。
- 选择“产品更新”。
- 更新到最新版本(在撰写此答案时是更新 4)
回答by BelgiumHorse
Solved: Follow the below steps, It worked for me: a)Install VS 2012 Update 4 (http://www.microsoft.com/en-gb/download/details.aspx?id=39305)
已解决:按照以下步骤操作,它对我有用:a) 安装 VS 2012 Update 4 ( http://www.microsoft.com/en-gb/download/details.aspx?id=39305)
b)ASP.NET and Web Tools 2013.1 for Visual Studio 2012 Download link Available here (http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx)
b) 适用于 Visual Studio 2012 的 ASP.NET 和 Web 工具 2013.1 下载链接可在此处获得 ( http://blogs.msdn.com/b/webdev/archive/2013/11/18/annoucing-release-of-asp-net- and-web-tools-2013-1-for-visual-studio-2012.aspx)
c) Restart your dev box
c) 重启你的开发箱
回答by developerturk
I solve this problem. VS 2012 support it.
我解决了这个问题。VS 2012 支持它。
from install setup file here upgrade for Visual Studio 2012
从这里安装安装文件升级 Visual Studio 2012
回答by user4977369
For me was installing the Visual Studio Updates:
对我来说是安装Visual Studio Updates:
Tools> Extensions And Updates
Select "Updates" in the accordion list on the left.
Select "Product Updates".
Update to the newest version
(At the time of writing of this answer it was Update 4)
(在撰写此答案时,它是Update 4)

