.net 我如何获得 System.Web.Http.Owin?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21690845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 12:38:55  来源:igfitidea点击:

How do I get System.Web.Http.Owin?

.netowin

提问by spiderplant0

I had a version number problem with system.web.http.owin.

我有一个 system.web.http.owin 的版本号问题。

So I removed it from my projects package references, with the idea that I would re-added it to see if it fixed the problem. However it has disappeared completely. I.e. in visual studio if I go:

所以我从我的项目包引用中删除了它,我的想法是重新添加它以查看它是否解决了问题。然而它已经完全消失了。如果我去,即在视觉工作室:

solution explorer > myProject > references > RMC > add reference >

解决方案资源管理器 > myProject > 参考 > RMC > 添加参考 >

and then search for system.web.http.owinit doesn't appear.

然后搜索system.web.http.owin它没有出现。

Any ideas what has gone wrong or what package I need to install to make it re-appear.

任何想法出了什么问题,或者我需要安装什么包才能让它重新出现。

My original error message...

我原来的错误信息...

Error 7 Assembly 'System.Web.Http.Owin, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Web.Http, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' e:\user\project1\src\packages\Microsoft.AspNet.WebApi.Owin.5.1.1\lib\net45\System.Web.Http.Owin.dll Smots.Core

错误 7 程序集“System.Web.Http.Owin,Version=5.1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”使用“System.Web.Http,Version=5.1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”比引用的程序集 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' e:\user\project1\src\packages\Microsoft.AspNet.WebApi.Owin.5.1.1\ 更高的版本lib\net45\System.Web.Http.Owin.dll Smots.Core

回答by Wallace Kelly

The NuGet package Microsoft.AspNet.WebApi.Owincontains that DLL.

NuGet 包Microsoft.AspNet.WebApi.Owin包含该 DLL。

You can install it by right-clicking on the References folder of your project and selecting "Manage NuGet Packages..." and searching for "Microsoft.AspNet.WebApi.Owin". Or you can use the Package Manager Console and type the following:

您可以通过右键单击项目的 References 文件夹并选择“Manage NuGet Packages...”并搜索“Microsoft.AspNet.WebApi.Owin”来安装它。或者您可以使用包管理器控制台并键入以下内容:

Install-Package Microsoft.AspNet.WebApi.Owin

If you use the Package Manager Console within Visual Studio, be sure you have the intended project selected in the drop down labeled "Default project:" That is easy to overlook.

如果您在 Visual Studio 中使用包管理器控制台,请确保在标有“默认项目:”的下拉菜单中选择了预期的项目,这很容易被忽视。