Wednesday, 20 May 2015

Install MVC and Check current MVC version in application

Here we will teach how to create first Asp.Net MVC application.Before that we will learn how to install MVC in our window
 Install asp.net mvc
Before install any version of MVC first we will see which version exist in our window for getting this go to control panel and when we will click on "Programs and Features" initially  here MVC2 will be installed by default.


Now we want to install MVC3 and MVC4 for that go to following link and download then install.
After Successfully installation it will show all MVC installation.


 Get which MVC version we are using in application.
There 2 type of ways for getting this thing. We can achieve this by design and with runtime using coding.
Design Time :- Go to your application , solution explorer expand your reference folder and see System.Web.Mvc assembly  and then right click on this reference  and select Properties and in property window at last you will see current version.

At Runtime using code: - Go to your application and you will see there home controller there you write following code  in ”index method” 
typeof(Controller).Assembly.GetName().Version.ToString() 

Now run your application and then on browser you will see your current MVC version



No comments:

Post a Comment

C# program Selection Sorting

Selection sort is a straightforward sorting algorithm. This algorithm search for the smallest number in the elements array and then swap i...