Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet package for IFormFile

I need to have access to IFormFile interface in ASP.Net Core 1. Could you please tell me which NuGet package I should install?

like image 637
Alpha Bravo Charlie ... Avatar asked Nov 16 '25 18:11

Alpha Bravo Charlie ...


1 Answers

Even though the original question is about ASP.NET Core 1, I landed here while searching for a way to reference IFormFile in a library targeting .NET 6 (should work for ASP.NET Core 3.0+). For those who are also looking for an up-to-date solution, you can add a FrameworkReference to your .csproj file like this:

<ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

This will allow you to use IFormFile and other ASP.NET Core types in your library.

References:

ASP.NET Core Fundamentals: Targeting ASP.NET Core

GitHub Issue: Reference to IFormFile in .NET 6

I hope this helps anyone who is working with a more recent version of .NET!

like image 176
JanB Avatar answered Nov 18 '25 10:11

JanB



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!