I am working on an old ASP.NET WebApi with .Net Framework 4.6.1
and MVC3 project. The problem is that I don't have the File return type, not the one from System.IO but the one from the controller.
In ASP.NET Core for example, this File is located in ControllerBase class. So, since my project only knows about System.IO.File
, when writing the following code I get the following error:
code:
return File(memory, mimeType, document.Name);
error:
Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of a FileStream objects.
Non-invocable member 'File' cannot be used like a method.
Method, delegate or event is expected.
So is there any way to get this 'File' in my project? Thank you guys!