0

I am using the latest version of VS2019 and created a new ASP.NET Core Web API project (net5.0). I am very new to ASP.NET Core so please bear with me.

I have created an api controller and a get method that works fine for smaller payloads (5K json objects). However, I have a few larger payloads that return 40K+ json objects; which gives this message in the browser:

This localhost page can't be found
No webpage was found for the web address: https://localhost:5001/VpmGps/1
HTTP ERROR 404

Reading through the docs/issues here I saw some suggestions for adding DisableRequestSize to the api method. I tried that (and a few other things) but get the same message in the browser.

Here is the api method:

    [HttpGet("id")]
    [DisableRequestSizeLimit]
    [RequestFormLimits(MultipartBodyLengthLimit = Int32.MaxValue)]
    public async Task<List<VPMPoint>> Get(int id)
    {
        try
        {
            var data = await _dataService.GetVPMPointsAsync(id);
            return data;
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            throw;
        }   
    }

Any suggestions as to what else I can try?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Can [the answers](https://stackoverflow.com/questions/38698350/increase-upload-file-size-in-asp-net-core) in this question help you? Could you pls take a try for each of these configuration. – Tiny Wang Sep 07 '21 at 06:52
  • And [this answer](https://stackoverflow.com/a/66944343)? – Tiny Wang Sep 07 '21 at 07:46
  • Not sure what changed, but it works fine today . However, the swagger api page locks up with large loads but I can load the data in it's own page no problem. – Douglas Marquardt Sep 10 '21 at 17:30
  • Ok sir, it's good to see the issue disappeared anyway : ) – Tiny Wang Sep 13 '21 at 01:25

0 Answers0