asp.net-mvc 如何查看安装了哪个版本的 MVC?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2111936/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 00:05:01  来源:igfitidea点击:

How do I see which version of MVC is installed?

asp.net-mvc

提问by TonyP

How can I tell which version of MVC (i.e. MVC 2 Beta, MVC 2 RC) is installed on my machine?

我如何知道我的机器上安装了哪个版本的 MVC(即 MVC 2 Beta、MVC 2 RC)?

采纳答案by Steffen

Unless I got you wrong, checking the version displayed for System.Web.Mvc in your windows\assembly folder should help you.

除非我弄错了,否则检查 windows\assembly 文件夹中为 System.Web.Mvc 显示的版本应该对您有所帮助。

回答by Ananize Scott

C:\Program Files (x86)\Microsoft ASP.NET Inside this folder will be all versions of MVC that you have installed. This is for Win 7.

C:\Program Files (x86)\Microsoft ASP.NET 此文件夹内将包含您已安装的所有 MVC 版本。这适用于 Win 7。

回答by Dave Cowart

Look under Control Panel > Add/Remove Programs

在“控制面板”>“添加/删除程序”下查看

回答by TrailTrackers

Simply looking in the Program Files(x86) isn't enough. If you've installed MVC5 for instance via NuGet, then you won't see a MVC5 folder under that folder. In my opinion, the most effective way of knowing which version of MVC you are using is to go to your VS project and look at the references under your main web application. Then find "System.Web.Mvc", right click, then click properties. You will see the version as a property. I tried to post an image of this but it won't allow me to do that; oh well, sorry I couldn't.

仅仅查看 Program Files(x86) 是不够的。例如,如果您已经通过 NuGet 安装了 MVC5,那么您将不会在该文件夹下看到 MVC5 文件夹。在我看来,了解您使用的是哪个版本的 MVC 的最有效方法是转到您的 VS 项目并查看您的主 Web 应用程序下的引用。然后找到“System.Web.Mvc”,右键单击,然后单击属性。您将看到版本作为属性。我试图张贴这张图片,但它不允许我这样做;哦,对不起,我不能。

回答by Dr Blowhard

Try the MvcDiagnosticstool, which is available as a nuget package

试试MvcDiagnostics工具,它作为 nuget 包提供

As pointed out in this answerit is useful if you want to know what version of MVC your site is running.

如此答案中所指出的,如果您想知道您的站点正在运行的 MVC 版本,它会很有用。

回答by Radu Bartan

You may have several versionsof .NET installed on your machine. If you are using Windows 10this is how to find versions 1 through 4:

您的机器上可能安装了多个版本的 .NET。如果您使用的Windows 10是如何查找版本 1 到 4:

From the Startmenu > choose Run> enter Regedit> select Ok. You must have administrativecredentials to run Regedit.

从“开始”菜单 > 选择“运行”> 输入Regedit> 选择“确定”。您必须具有管理凭据才能运行Regedit

In the Registry Editoropen the following subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

注册表编辑器中打开以下子项:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

enter image description here

在此处输入图片说明

Find more info hereand here. Also if you were wondering what the latest versionof .Netis - hereis a handy list.

在此处此处查找更多信息。此外,如果你想知道什么是最新版本.NetIS -这里是一个方便的名单。

回答by Deleted because of negativity

Ananize Scott, already give one version of the answer, I found folders MVC2 and MVC3 in folder

Ananize Scott,已经给出了一个版本的答案,我在文件夹中找到了文件夹 MVC2 和 MVC3

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web

"don't forget to set properties of mvc.dll to 'copy local true' if you are using older version of MVC than latest installed or it will not work.

“如果您使用的 MVC 版本比最新安装的旧版本,请不要忘记将 mvc.dll 的属性设置为 'copy local true',否则它将无法工作。

回答by Travis J

The ASP.NET programs folder is the best place to look as it will show the versions in folders. To note though, if you installed Visual Studio 2012, then it installed both versions MVC3 and MVC4.

ASP.NET 程序文件夹是最佳查看位置,因为它将显示文件夹中的版本。但请注意,如果您安装了 Visual Studio 2012,则它同时安装了 MVC3 和 MVC4 版本。