最近在搞的项目加载的时候出现了上述的问题,查了查,就发现原来是ASP.NET MVC 版本不兼容的问题,解决办法如下:

Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update

ASP.NET MVC 3 can be installed side by side with ASP.NET MVC 2 on the same computer, which gives you flexibility in choosing when to upgrade an ASP.NET MVC 2 application to ASP.NET MVC 3.  ASP.NET MVC 3可以与ASP.NET MVC 2同时安装在同一台电脑上,让你可以灵活地选择何时升级ASP.NET MVC 2应用程序到ASP.NET MVC 3版本。

To manually upgrade an existing ASP.NET MVC 2 application to version 3, do the following:  若要手动升级版本,执行以下操作

  1. Create a new empty ASP.NET MVC 3 project on your computer. This project will contain some files that are required for the upgrade.  在电脑上新建一个空的ASP.NET MVC 3项目。此项目包含一些升级所必须的文件。
  2. Copy the following files from the ASP.NET MVC 3 project into the corresponding location of your ASP.NET MVC 2 project. You'll need to update any references to thejQuery library to account for the new filename ( jQuery-1.5.1.js):  从 下面的ASP.NET MVC 3 项目中的文件复制到您的 ASP.NET MVC 2 项目的相应位置中。你需要更改所有对jQuery library的引用去适应新的文件名( jQuery-1.5.1.js)
    • /Views/Web.config
    • /packages.config
    • /scripts/*.js
    • /Content/themes/*.*
  3. Copy the packages folder in the root of the empty ASP.NET MVC 3 project solution into the root of your solution, which is in the directory where the solution’s .sln file is located.  复制空ASP.NET MVC 3项目的packages文件夹到你自己解决方案根目录里(.sln文件所在的目录)
  4. If your ASP.NET MVC 2 project contains any areas, copy the /Views/Web.config file to the Viewsfolder of each area.  如果你的ASP.NET MVC 2项目包含了其他区域,复制/Views/Web.config文件到所有区域的Views文件夹目录下
  5. In both Web.config files in the ASP.NET MVC 2 project, globally search and replace the ASP.NET MVC version. Find the following:  在 ASP.NET MVC 2 项目中的两个Web.config 文件内,在全局范围内搜索并替换的ASP.NET MVC 的版本号。找到以下内容:
    System.Web.Mvc, Version=2.0.0.0

    Replace it with the following:  作如下修改

    System.Web.Mvc, Version=3.0.0.0
  6. In Solution Explorer, delete the reference to System.Web.Mvc (which points to the DLL from version 2), then add a reference to System.Web.Mvc (v3.0.0.0).  在解决方案资源管理器中删除(指向版本2的动态链接库的)对System.Web.Mvc的引用,然后添加一个对System.Web.Mvc(版本3)的引用
  7. Add a reference to System.Web.WebPages.dll and System.Web.Helpers.dll. These assemblies are located in the following folders:  添加对System.Web.WebPages.dll 和 System.Web.Helpers.dll的引用。这些程序集位于下面的文件夹:
    • %ProgramFiles%\ Microsoft ASP.NET\ASP.NET MVC 3\Assemblies
    • %ProgramFiles%\ Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies
  8. In Solution Explorer, right-click the project name and select Unload Project. Then right-click the project name again and select Edit ProjectName.csproj.  在解决方案资源管理器中右击项目名选择卸载项目,再右击一次并选择编辑  项目名.csproj  这个文件
  9. Locate the ProjectTypeGuids element and replace {F85E285D-A4E0-4152-9332-AB1D724D3325} with {E53F8FEA-EAE0-44A6-8774-FFD645390401}.  找到ProjectTypeGuids标记,并将{F85E285D-A4E0-4152-9332-AB1D724D3325} 替换成 {E53F8FEA-EAE0-44A6-8774-FFD645390401}
  10. Save the changes, right-click the project, and then select Reload Project.  保存修改,再次右击项目,然后选择重载项目
  11. In the application’s root Web.config file, add the following settings to the assemblies section.  在应用程序的根目录下的Web.config文件中添加以下设定到 assemblies section
    <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /><add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
  12. If the project references any third-party libraries that are compiled using ASP.NET MVC 2, add the following highlighted bindingRedirect element to the Web.config file in the application root under the configuration section:  如果项目引用了任何在ASP.NET MVC 2框架下编译的第三方库,在上一步骤所述文件的configuration section下添加下面高亮的bindingRedirect 元素
    <runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Web.Mvc"publicKeyToken="31bf3856ad364e35"/><bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0"/></dependentAssembly></assemblyBinding>
    </runtime>

Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4

ASP.NET MVC 4 can be installed side by side with ASP.NET MVC 3 on the same computer, which gives you flexibility in choosing when to upgrade an ASP.NET MVC 3 application to ASP.NET MVC 4.

The simplest way to upgrade is to create a new ASP.NET MVC 4 project and copy all the views, controllers, code, and content files from the existing MVC 3 project to the new project and then to update the assembly references in the new project to match any non-MVC template included assembiles you are using. If you have made changes to the Web.config file in the MVC 3 project, you must also merge those changes into the Web.config file in the MVC 4 project.

To manually upgrade an existing ASP.NET MVC 3 application to version 4, do the following:

  1. In all Web.config files in the project (there is one in the root of the project, one in the Views folder, and one in the Views folder for each area in your project), replace every instance of the following text (note: System.Web.WebPages, Version=1.0.0.0 is not found in projects created with Visual Studio 2012):

    System.Web.Mvc, Version=3.0.0.0
    System.Web.WebPages, Version=1.0.0.0
    System.Web.Helpers, Version=1.0.0.0
    System.Web.WebPages.Razor, Version=1.0.0.0

    with the following corresponding text:

    System.Web.Mvc, Version=4.0.0.0
    System.Web.WebPages, Version=2.0.0.0
    System.Web.Helpers, Version=2.0.0.0
    System.Web.WebPages.Razor, Version=2.0.0.0
  2. In the root Web.config file, update the webPages:Version element to "2.0.0.0" and add a newPreserveLoginUrl key that has the value "true":
    <appSettings><add key="webpages:Version" value="2.0.0.0" /><add key="PreserveLoginUrl" value="true" />
    </appSettings>
  3. In Solution Explorer, right-click on the References and select Manage NuGet Packages. In the left pane, select Online\NuGet official package source, then update the following:
    • ASP.NET MVC 4
    • (Optional) jQuery, jQuery Validation and jQuery UI
    • (Optional) Entity Framework
    • (Optonal) Modernizr
  4. In Solution Explorer, right-click the project name and then select Unload Project. Then right-click the name again and select Edit ProjectName.csproj.
  5. Locate the ProjectTypeGuids element and replace {E53F8FEA-EAE0-44A6-8774-FFD645390401} with {E3E379DF-F4C6-4180-9B81-6769533ABE47}.
  6. Save the changes, close the project (.csproj) file you were editing, right-click the project, and then select Reload Project.
  7. If the project references any third-party libraries that are compiled using previous versions of ASP.NET MVC, open the root Web.config file and add the following three bindingRedirect elements under the configuration section:
    <configuration><!--... elements deleted for clarity ...--><runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0"/></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/></dependentAssembly></assemblyBinding></runtime>
    </configuration>

第二次升级跟第一次升级差不多,就不翻译了

关于 *.csproj: 找不到此项目类型所基于的应用程序 的解决方案相关推荐

  1. 打开一个解决方案时弹出“项目所需的应用程序未安装,确保已安装项目类型(.csproj)的应用程序”问题的解决方案

    打开一个解决方案时弹出"项目所需的应用程序未安装,确保已安装项目类型(.csproj)的应用程序"问题的解决方案 参考文章: (1)打开一个解决方案时弹出"项目所需的应用 ...

  2. 在使用Vs2013打开Vs2008的解决方案时出现了以下错误:此版本的应用程序不支持其项目类型(.csproj)...

    在使用Vs2013打开Vs2008的解决方案时出现了以下错误: 无法打开 因为此版本的应用程序不支持其项目类型(.csproj). 在网络上找到解决方案: 命令行或者Vs自带的命令提示符输入:deve ...

  3. 无法打开csproj,因为此版本的应用程序不支持其项目类型 csproj

    场景:在电脑上安装了 server_2008_r2_standard_x64 版本之后,开始里面就有了Microsoft Visual Studio 2008目录,于是我直接去打 vs2008程序的  ...

  4. 因为此版本的应用程序不支持其项目类型(.csproj)

    因为此版本的应用程序不支持其项目类型(.csproj),若要打开它,请使用支持此类型项 有的时候vs无缘无故的出现如下错误:"因为此版本的应用程序不支持其项目类型(.csproj),若要打开 ...

  5. 因为此版本的应用程序不支持其项目类型(.csproj)”之解

    有的时候vs无缘无故的出现如下错误:"因为此版本的应用程序不支持其项目类型(.csproj),若要打开它,请使用支持此类型项目的版本" 解决办法:如果是这个提示,可能是由于你安装m ...

  6. vs项目所需的应用程序未安装,确保已安装项目类型(.csproj)的应用程序的解决办法

    项目所需的应用程序未安装,确保已安装项目类型(.csproj)的应用程序的解决办法 2010-08-25 17:24:35|  分类: .net |  标签: |字号大中小 订阅 用vs打开一个解决方 ...

  7. 无法打开项目文件: .csproj,此安装不支持该项目类型,怎么解决?

    无法打开项目文件: .csproj,此安装不支持该项目类型,怎么解决? 因为没有打Vs2005没有打sp1补丁包!

  8. 找不到该项目,请确认该项目的位置的解决办法

    Xp\Windows7\Windows8 删除文件时,遇到"找不到该项目 请确认该项目的位置 然后重试"的简单解决办法 工具/原料  .txt文本文档 方法/步骤 1   出现此问 ...

  9. 找不到项目 该项不在计算机中,Win7删除文件夹找不到该项目怎么删除?“找不到该项目”强删方法...

    我们在使用电脑的过程中,尤其是办公,去创建一些文档,但是在删除的时候就删除不了了,系统提示"找不到该项目",那么Win7删除文件夹找不到该项目怎么删除?下面装机之家分享一下删除文件 ...

最新文章

  1. 一文概述2017年深度学习NLP重大进展与趋势
  2. WCF4.0进阶系列--第四章 保护企业内部的WCF服务(转)
  3. 转:对于一个字节(8bit)的变量,求其二进制表示中“1”的个数
  4. 牛客网(剑指offer) 第十二题 数值的整数次方
  5. 【数据结构与算法】之深入解析“石子游戏IX”的求解思路与算法示例
  6. 【Java多线程】Join的使用、如何使用getState()查看线程的状态
  7. python 数据离散化和面元划分
  8. Flask入门之上传文件到本地服务器
  9. Kafka/Metaq设计思想学习笔记 转
  10. kubernetes证书配置相关
  11. win10蓝屏无法进入系统_WIN10系统进“吃鸡”蓝屏
  12. dd fdisk mount相关命令的总结
  13. 量化交易系统用例图(一)
  14. 微信小程序实现获取当前系统时间
  15. oracle,通过plsql创建用户表空间和所属用户示例
  16. C++ 小白 学习记录15
  17. 对软件公司不要传智播客学生的驳斥
  18. WINDOWS7-11磁盘分区教程
  19. java 动态编译_Java动态编译
  20. 学习笔记(4):EXCEL VBA编程进阶-2.12 VBA中的数组技术

热门文章

  1. 【调剂】云南大学2021年硕士研究生招生调剂工作的说明
  2. 推荐 5 个精选公众号
  3. plotly绘制简单图形10--金字塔图
  4. 八边形Octagan类(接口) (5 分)
  5. 《白鲤助手》抖音所有功能操作说明
  6. shell脚本里的#!/bin/bash是什么意思
  7. JavaScript中常用数组方法总结
  8. openpnp - Smoothieware project build
  9. Java 过滤器Url通配符处理
  10. AVR单片机-nRF24L01发送接收程序