降级ASP.NET MVC 5从.NET 4.5到4.0 [英] Downgrading ASP.NET MVC 5 from .NET 4.5 to 4.0

查看:1728
本文介绍了降级ASP.NET MVC 5从.NET 4.5到4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个有趣的问题坐着。 .NET 4.5不支持在服务器上(客户端并没有提到这一点)

Sitting with an interesting problem. .NET 4.5 is not supported on the server (client didn't mention this)

但应用程序使用ASP.NET MVC 5(只在.NET 4.5中运行)写的。

BUT the app is written using ASP.NET MVC 5 (which only runs on .NET 4.5).

所以降级点网手段降级ASP.NET MVC版本。

So downgrading the dot net means to downgrade the ASP.NET MVC version.

一个我们得到了很多错误的是

One of the many errors we are getting is

类型或命名空间名称'的mvc'不命名空间中存在'System.Web程序

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web'

我只能假设这是由于所有的Owin中间件在ASP.NET MVC 5的实现。

I can only assume this is due to the implementation of all the Owin middleware in ASP.NET MVC 5.

有没有人有任何经验,除去这些引用,并成为ASP.NET MVC 4能干?

Has anyone had any experience with removing these references and being ASP.NET MVC 4 capable?

继格雷格的建议之下,我跑这些删除V5中的NuGet,并在V4补充说,但现在所有的东西Owin是一个问题。

Following Greg's suggestion below I ran the nuget which removed v5, and added in v4, but now all the Owin stuff is an issue

推荐答案

请尝试以下步骤:


  1. 右键单击在Solution Explorer中的项目(在Visual Studio),并选择属性。

  2. 更改目标框架下拉到任何框架您现在希望的目标。

  3. 执行相同的解决方案中的任何其他项目或测试项目,你也想改变目标框架。

  4. 手动编辑在文本编辑器中的.csproj文件,并全部替换net45字符串net40

  5. 在Visual Studio中,单击工具菜单,然后选择库软件包管理器>管理的NuGet软件包的解决方案

  6. 单击上更新

  7. 更新所有的微软软件包

  8. 点击立即重新启动。

  9. 重建项目。

这篇关于降级ASP.NET MVC 5从.NET 4.5到4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆