Skip to main content
 首页 » 编程设计

c#之错误 "The type or namespace name ' DotNetOpenAuth' could not be found"in VS2013 but not not VS2012

2024年02月13日16Leo_wl

我有一个 ASP.NET MVC 3 项目,它使用通过 NuGet 检索的 DotNetOpenAuth。包恢复已启用。该项目使用 .NET 4(完整配置文件,而非客户端)。

在 Visual Studio 2012 中,项目可以正常编译和运行。

在 Visual Studio 2013 中,出现以下错误:

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

DLL成功还原到packages文件夹,也正确复制到网站项目的bin文件夹。添加了所有适当的 using。每次我测试一个干净的工作目录的变化。解决方案中的所有其他项目都可以正常编译。 Website.csproj 文件中的程序集引用如下所示:

<Reference Include="DotNetOpenAuth.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL"> 
  <HintPath>..\..\packages\DotNetOpenAuth.Core.4.3.1.13153\lib\net40-full\DotNetOpenAuth.Core.dll</HintPath> 
</Reference> 

我该如何解决这个问题?

请您参考如下方法:

要为 ASP.NET(网页)安装 DotNetOpenAuth 扩展,请在程序包管理器控制台中运行以下命令

PM> 安装包 DotNetOpenAuth.AspNet