gpt4 book ai didi

c# - 将 HttpConfigurationExtensions 添加到 ASP.NET 项目

转载 作者:行者123 更新时间:2023-11-30 17:39:36 24 4
gpt4 key购买 nike

我正在从事的项目之一具有来自 System.Web.Http 5.2.2 的扩展类 HttpConfigurationExtensions

为了将它添加到另一个项目,我安装了 nuget

PM> Install-Package Microsoft.AspNet.WebApi -Version 5.2.2

但是,它似乎没有添加 HttpConfigurationExtensions,尽管程序集是相同的。

我想我在这里做错了什么。它可能是什么?您将如何着手将 HttpConfigurationExtensions 添加到您的项目中?

附言:

这是反汇编程序为两个项目的 System.Web.Http.cs 显示的内容

using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;

// Assembly System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 214E5BA0-B5E8-43DD-B986-3648DF7435EE
// References: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// References: System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// References: System.Net.Http.Formatting, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// References: System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// References: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// References: System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// References: Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
// References: System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// References: System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyConfiguration("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyProduct("Microsoft ASP.NET MVC")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Extension]
[assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
[assembly: SatelliteContractVersion("5.2.2.0")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("5.2.20826.0")]
[assembly: AssemblyInformationalVersion("5.2.2-20826 (66298100f4e349d3812b1aad32c5278c256a2cdd)")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("System.Web.Http")]
[assembly: Guid("70cecdcd-46f5-492b-9e1f-1d9a947f1fd1")]
[assembly: InternalsVisibleTo("System.Web.Http.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo("System.Web.Http.Integration.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: AssemblyVersion("5.2.2.0")]

但是,当我通过 Assembly Explorer(来自 Resharper)浏览程序集时,它没有在我添加了 nuget 的项目中的 System.Web.Http 中显示任何类(其中有 HttpConfigurationExtensions 缺失)。

enter image description here

但是另一个项目有所有相关的类 enter image description here

最佳答案

我尝试在 Web API 上手动执行的项目遇到了同样的问题。

尝试通过 Nuget 重新安装它:

更新包 microsoft.aspnet.webapi -reinstall

关于c# - 将 HttpConfigurationExtensions 添加到 ASP.NET 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35303989/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com