【发布时间】:2023-01-01 19:00:18
【问题描述】:
运行项目时出现此错误:
System.TypeLoadException: 'Could not load type 'Microsoft.AspNetCore.Http.Internal.FormFile' from assembly 'Microsoft.AspNetCore.Http, Version=6.0.0.0
我使用点网 6.0
这些是我的依赖项:
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="6.4.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Autofac.Extras.CommonServiceLocator" Version="6.0.1" />
<PackageReference Include="AutoMapper" Version="12.0.0" />
<PackageReference Include="FluentValidation" Version="11.4.0" />
<PackageReference Include="MediatR" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="2.2.0" />
<PackageReference Include="RestSharp" Version="108.0.3" />
<PackageReference Include="Serilog" Version="2.12.0" />
</ItemGroup>
我不知道是什么问题!
我尝试了不同版本的“Microsoft.AspNetCore.Http”和“Microsoft.AspNetCore.Http.Features”包,但问题存在,我搜索解决方案,但没有帮助!
请某人帮助我!
谢谢你。
【问题讨论】:
标签: c# .net-6.0 iformfile typeloadexception