简体   繁体   English

如何使用Visual Studio 2013/2015启动并运行ASP.NET MVC音乐存储?

[英]How to get ASP.NET MVC Music Store up and running with Visual Studio 2013/2015?

I want to get MVC Music Store tutorial application up and running with Visual Studio 2013/2015. 我希望使用Visual Studio 2013/2015启动并运行MVC音乐商店教程应用程序。 Here are the steps that I've taken: 以下是我采取的步骤:

  1. downloaded the latest version from Downloads page 下载页面下载了最新版本
  2. unpacked it 解开它
  3. opened it with Visual Studio 2013/2015 - got a migration report without errors but with some warnings 使用Visual Studio 2013/2015打开它 - 获得了一个没有错误但有一些警告的迁移报告
  4. tried to build the solution, but it won't build - got a plenty of errors about missing type/namespace like that: 试图构建解决方案,但它不会构建 - 有关于缺少类型/命名空间的大量错误:

The type or namespace name could not be found (are you missing a using directive or an assembly reference?) 找不到类型或命名空间名称(您是否缺少using指令或程序集引用?)

How do I build and run locally the MVC Music Store project with Visual Studio 2013/2015? 如何使用Visual Studio 2013/2015在本地构建和运行MVC音乐商店项目?

There are two ways: 有两种方法:

1) Download and install ASP.NET MVC 3 Tools from the official ASP.NET MVC 3 page or from Microsoft Download Center . 1)从官方的ASP.NET MVC 3页面或从Microsoft下载中心下载并安装ASP.NET MVC 3工具 It will install the required DLLS into the GAC. 它会将所需的DLLS安装到GAC中。

2) Install the corresponding ASP.NET MVC 3 NuGet package into MvcMusicStore project using following command in the Package Manager Console : 2)使用Package Manager控制台中的以下命令将相应的ASP.NET MVC 3 NuGet包安装到MvcMusicStore项目中:

Install-Package Microsoft.AspNet.Mvc -Version 3.0.50813.1

or 要么

Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1

After using either of the described ways you will be able to successfully build and run the MVC Music Store tutorial application. 使用上述任何一种方法后,您将能够成功构建和运行MVC Music Store教程应用程序。

Note that these ways are not conflicting with each other, so you may safely install ASP.NET MVC 3 Tools into your OS and install ASP.NET MVC 3 NuGet package into the project. 请注意,这些方式不会相互冲突,因此您可以安全地将ASP.NET MVC 3 Tools安装到您的操作系统中,并将ASP.NET MVC 3 NuGet包安装到项目中。

Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1

为我工作而不是版本3.0.50813.1

I was running into the same problem as other mentioned here, tried installing the nuget package and was still getting an error. 我遇到了与此处提到的相同的问题,尝试安装nuget包并且仍然出现错误。

My solution after following other advice here by installing the nuget package, the key to my solution was to make sure the project targeted "Microsoft Framework 4.0". 我的解决方案是在通过安装nuget软件包遵循其他建议之后,我的解决方案的关键是确保项目针对“Microsoft Framework 4.0”。 IE Right mouse on the project node in the solution explorer, select properties, and within the "Application" page for the project select ".Net Framework 4.0". IE右键单击解决方案资源管理器中的项目节点,选择属性,然后在项目的“应用程序”页面中选择“.Net Framework 4.0”。

All is working fine for me after this, seems VS was defaulting to 4.5.1. 在此之后一切正常对我来说,似乎VS默认为4.5.1。

HTH. HTH。

dan d:) 丹d :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM