How can I tell which version of MV开发者_StackOverflowC (i.e. MVC 2 Beta, MVC 2 RC) is installed on my machine?
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.
Look under Control Panel > Add/Remove Programs
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.
Unless I got you wrong, checking the version displayed for System.Web.Mvc in your windows\assembly folder should help you.
Try the MvcDiagnostics tool, which is available as a nuget package
As pointed out in this answer it is useful if you want to know what version of MVC your site is running.
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.
You may have several versions of .NET installed on your machine. If you are using Windows 10
this is how to find versions 1 through 4:
From the Start menu > choose Run > enter Regedit > select Ok. You must have administrative credentials to run Regedit.
In the Registry Editor open the following subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
Find more info here and here. Also if you were wondering what the latest version of .Net
is - here is a handy list.
Ananize Scott, already give one version of the answer, I found folders MVC2 and MVC3 in folder
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.
精彩评论