无法决定使用哪种ASP.NET网页版 [英] Could not determine which version of ASP.NET Web Pages to use

查看:826
本文介绍了无法决定使用哪种ASP.NET网页版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的VS2013项目奇怪探班。我最近升级我的项目分支中的一个,从.NET 4.0到4.5.1和使用的NuGet包管理器安装MVC 5剃刀,这样我可以有一个的WebForms / MVC的混合体。到目前为止,它的正常工作,我能够同时使用WebForms和MVC。

Weird goings on with my VS2013 projects. I recently upgraded one of my project branches from .NET 4.0 to 4.5.1 and used NuGet package manager to install MVC 5 with Razor so that I could have a WebForms/MVC hybrid. So far, it's working fine and I am able to use both WebForms and MVC.

不过,我所有的同一个项目(生产分公司为例)的其他分支出现时,他们并没有改变被打破。当我运行其他的项目之一,我得到:

However, all of my other branches of the same project (the production branch for example) appear to be broken when they have not changed. When I run one of the other projects, I get:

无法确定使用哪种ASP.NET网页版本。

一些环顾四周后,我看到有人建议把这个在web.config中的appSettings:

After some looking around, I saw someone recommend putting this in the web.config appSettings:

<添加键=网页:版本值=2.0.0.0/>

现在,当我运行该项目,我得到这样的:

Now when I run the project, I get this:

HTTP错误404.0 - 找不到

还有什么奇怪的是,该URL指向这样的:

What else is odd is that the URL is pointing to this:

的http://本地主机:53305 /帐号/登录RETURNURL =%2findex.aspx

我不知道如何使在不同的code分公司变化MVC 5可能会影响我目前仍在使用的4.0框架平直的WebForms等项目。

I have no idea how making the change to MVC 5 in a different code branch could impact my other projects which are still straight WebForms using the 4.0 framework.

修改:这也许值得注意的是,我的其他完全不同的WebForms项目仍然有效。这是唯一出现被打破这个特定项目的其他分支。这几乎就像如果有这些分支已被修改从而结束了仅容纳分公司已升级到MVC 5间共享一些常见的配置文件。

Edit: It's probably worth noting that my other completely separate WebForms projects still work. It's only the other branches of this particular project that appear to be broken. It's almost as if there's some common configuration file shared between all of these branches that has been modified which ends up accommodating only the branch that was upgraded to MVC 5.

修改:在我怎么安装的NuGet包是有问题的情况下,这里就是我所做的:

Edit: In case how I installed the NuGet package is in question, here's what I did:


  • 右键点击我的项目,选择管理的NuGet包

  • 点击了在线在左窗格中选择与微软ASP.NET MVC和点击安装

  • 它没有什么它做并安装它该项目。

我没有这个包安装在我的其他分支。这只是一个分支。不知何故,它影响到所有的分支,我不知道为什么。

I do not have this package installed in my other branches. It's only a single branch. Somehow, it affected all branches and I do not know why.

推荐答案

我的猜测是,你现在有.NET 2.0的项目和一个.NET V4.5.1的项目很多在同一个解决方案。无论你的IIS的前preSS配置或IIS配置现在使用应用程序池V4.5.1

My guess is that you now have alot of .net v2.0 projects and one .net v4.5.1 project in the same solution. Either your IIS express config or IIS configuration is now using an app pool v4.5.1

这篇关于无法决定使用哪种ASP.NET网页版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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