【问题标题】:The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft'命名空间“Microsoft”中不存在类型或命名空间名称“TeamFoundation”
【发布时间】:2014-11-17 20:14:54
【问题描述】:

我使用 .net 4.0 向我的 ASP.NET MVC 4 应用程序添加了以下引用。

我还在我的应用程序中包含了命名空间,但我仍然看到以下错误:

 Reference : Microsoft.TeamFoundation.Client.dll
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Client.dll

   "The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' "

我有另一个控制台应用程序,但在该应用程序中使用引用时没有看到此错误。我需要为 Web/MVC 应用程序做些什么不同的事情吗? 请告诉我。

我也看到了这个警告:

Warning 1   The primary reference "Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0". 

【问题讨论】:

  • 阿米尔·波波维奇是对的。但我不明白,为什么你需要参考 Microsoft.TeamFoundation.Client.dll ?它与 MVC4 无关!
  • 哈哈.. 我正在使用 TFS API 并开发 Web 应用程序。为此,我需要该程序集。

标签: c# asp.net-mvc visual-studio asp.net-mvc-4


【解决方案1】:

您正试图在低版本项目 (.net 4.0) 中引用高版本 dll(.net 4.5)。

将您的项目升级到.net 4.5 或引用.net 4.0 版本的dll。

【讨论】:

  • 是的,这是合乎逻辑的。我们不能使用 Microsoft.TeamFoundation.Build.Client" version:12.0.0.0 , runtime version :v4.0.xxxx with .Net 4.0. See the link. 问题是运行时版本没有明确指出那个。
猜你喜欢
  • 2018-05-09
  • 2018-06-14
  • 2021-07-28
  • 2013-05-04
  • 2015-01-05
  • 2017-12-29
  • 2014-04-12
  • 1970-01-01
相关资源
最近更新 更多