使用aspnetboilerplate找不到System.Web.HttpPostedFileBase

问题描述 投票:0回答:1

我正在使用样板开发asp .net核心Web应用程序并尝试使用ODATA。在线开始申请

//Initializes ABP framework.
app.UseAbp(options => { options.UseCastleLoggerFactory = false; });

我得到一个例外:

Abp.dll中出现“System.TypeLoadException”类型的异常,但未在用户代码中处理

无法从程序集'System.Web,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'加载类型'System.Web.HttpPostedFileBase'。

当我添加AbpWebApiODataModule的引用时会引发此异常:

[DependsOn(
        typeof(MyApplicationModule),
        typeof(IdentityModule),
        typeof(MyEntityFrameworkCoreModule),
        typeof(AbpAspNetCoreModule),
        typeof(AbpAspNetCoreSignalRModule),
        typeof(AbpWebApiODataModule)        
            )
    ]
    public class MyWebModule : AbpModule
    {

如何修复它并添加AbpOdata?

附:

dotnet --version == 2.1.401

包:

    <PackageReference Include="Abp.AspNetCore.SignalR" Version="3.8.2" />
    <PackageReference Include="Abp.Web" Version="3.8.2" />
    <PackageReference Include="Abp.Web.Api" Version="3.8.2" />
    <PackageReference Include="Abp.Web.Api.OData" Version="3.8.2" />
    <PackageReference Include="Microsoft.AspNet.OData" Version="7.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.3" />
    <PackageReference Include="BuildBundlerMinifier" Version="2.8.391" />    
    <PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
    <PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="2.1.1" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.1.1" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.3" />
    <PackageReference Include="Castle.Core" Version="4.3.1" />
    <PackageReference Include="Abp.AspNetCore" Version="3.8.2" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="2.1.1" PrivateAssets="All" />   
asp.net-core .net-core odata aspnetboilerplate typeloadexception
1个回答
2
投票

对于ASP.NET Core,它是Abp.AspNetCore.OData NuGet包。

© www.soinside.com 2019 - 2024. All rights reserved.