Asp.net mvc 4 安装VS 2012 Ultimate后ASP.NET Web API冲突

Asp.net mvc 4 安装VS 2012 Ultimate后ASP.NET Web API冲突,asp.net-mvc-4,asp.net-web-api,visual-studio-2012,Asp.net Mvc 4,Asp.net Web Api,Visual Studio 2012,我不久前安装了asp.NETMVC-4Beta来托管我们的api。在我刚刚在我的机器上安装vs2012 ultimate之前,它工作得很好。该项目既不是在vs2010中编译,也不是在vs2012中编译。我可以做些什么来解决这一冲突。此外,我在服务器上部署了asp.net web api程序集。要在服务器上运行最新的构建(一旦前一个问题得到解决),我必须做什么 编辑: 在vs2012中打开时的编译错误如下 'System.Net.Http.HttpRequestMessage' does not

我不久前安装了asp.NETMVC-4Beta来托管我们的api。在我刚刚在我的机器上安装vs2012 ultimate之前,它工作得很好。该项目既不是在vs2010中编译,也不是在vs2012中编译。我可以做些什么来解决这一冲突。此外,我在服务器上部署了asp.net web api程序集。要在服务器上运行最新的构建(一旦前一个问题得到解决),我必须做什么

编辑:
在vs2012中打开时的编译错误如下

'System.Net.Http.HttpRequestMessage' does not contain a definition for 'GetUserPrincipal' and no extension method 'GetUserPrincipal'...

'System.Web.Http.Hosting.HttpPropertyKeys' does not contain a definition for 'UserPrincipalKey'
另一方面,在VS2010中,它拒绝接受DelegatingHandler等类型。一些错误如下

The type or namespace name 'DelegatingHandler' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'HttpResponseMessage' could not be found (are you missing a using directive or an assembly reference?)
我还安装了最新版本的asp.net mvc 4,它显示的版本是4.0.20713.0。之前,我使用nuget添加了WebAPI测试版。我已经将它们全部删除,并从nuget安装了最新版本的web api。我不知道有什么问题。有一件事,我不明白:为什么我需要单独安装web api程序集,而它们应该是mvc框架的一部分?
感谢

使用System.ServiceModel.Channel添加;到你的档案。此命名空间中存在HttpRequestMessage的扩展方法,请参见。

add

using System.Net.Http;
您可能已经有了引用,所以只需添加扩展方法的using。

否则,请添加相同名称的程序集。

编译器错误将非常有用。要更新web api容器,只需使用nuget并用RTM版本或夜间版本替换当前容器。第一个错误是找不到类型或命名空间
FormatterContext
HttpRepsonseMessage
HttpRequestMessage
的情况也是如此,我的邮件没有编译问题,但Intellisense一直强调它不存在。不确定是怎么回事。使用System.ServiceModel.Channels在
周围打勾您可以这样标记代码片段。