搭建Asp.Net MVC4

启动vs2012,开始创建一个新的web应用程序。使用菜单:“文件”>“新建项目”

 请在左侧选择 Visual C#,然后选择ASP.NET MVC 4 Web 应用程序。命名您的工程为"MvcMovie",然后单击确定.

clip_image004

新的 ASP.NET MVC 4 项目对话框中,选择互联网应用程序。使用Razor作为默认视图引擎。

clip_image005

单击确定。Visual Studio 刚刚创建的 ASP.NET MVC 项目使用了默认的模板,所以在当前的工程中您不需要做任何事情!这是一个简单的"Hello World !"工程,并且这也是您开始“MvcMovie”工程的好地方。

clip_image006

调试菜单中,选择启动调试.(您也可以使用键盘的快捷键F5来启动调试。)

clip_image007

Visual Studio会启动浏览器并打开应用程序的主页面。

clip_image008

issue 1:

Install-Package Microsoft.AspNet.WebApi

issue 2:

Install-Package Microsoft.AspNet.WebApi.Tracing -Version 5.0.0

http://stackoverflow.com/questions/20071073/how-to-obtain-system-web-http-tracing-dll

issue 3:

{"Message":"An error has occurred.","ExceptionMessage":"The object has not yet b
een initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in
the application's startup code after all other initialization code.","ExceptionT
ype":"System.InvalidOperationException","StackTrace":" at System.Web.Http.Rout
ing.RouteCollectionRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage
request) at System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(Htt
pContextBase httpContext)"}
Press any key to continue . . .

http://stackoverflow.com/questions/19969228/ensure-that-httpconfiguration-ensureinitialized

原文地址:https://www.cnblogs.com/viviancc/p/4112287.html