asp.net core - AspNetCore not getting POST data initially in framework 4.6.2 -


i've updated azure web app aspnetcore rc2 aspnetcore 1.0, .net framework 4.6.2 , preview 2 tooling. since change i've had issue first minute or after deploy controller not getting post data. object should contain null. after minute or code begins work expected. response time first web call seems faster now, making me suspect app being sent requests before app initialised. not happen locally, when deployed azure.

is there need ensure app initialised before starts receive requests?

if try access this.httpcontext.request.body directly throws

cannot access disposed object. object name: 'filebufferingreadstream'. 

my project.json looks in case it's relevant:

{   "version": "1.0.0-*",   "buildoptions": {     "emitentrypoint": true   },    "runtimeoptions": {     "gcserver": true   },    "dependencies": {     "microsoft.extensions.configuration.json": "1.0.0",     "microsoft.extensions.logging": "1.0.0",     "microsoft.extensions.logging.console": "1.0.0",     "microsoft.extensions.logging.debug": "1.0.0",     "microsoft.aspnetcore.hosting": "1.0.0",     "microsoft.aspnetcore.server.kestrel": "1.0.0",     "microsoft.aspnetcore.server.kestrel.https": "1.0.0",     "microsoft.aspnetcore.server.iisintegration": "1.0.0",     "newtonsoft.json": "9.0.1"   },    "tools": {     "microsoft.aspnetcore.server.iisintegration.tools": {       "version": "1.0.0-preview2-final",       "imports": "portable-net45+win8+dnxcore50"     }   },      "frameworks": {       "net462": {       }     },     "publishoptions": {       "include": [         "wwwroot",         "views",         "appsettings.json",         "web.config"       ]     },      "usersecretsid": "redacted",      "scripts": {       "postpublish": [ "dotnet publish-iis --publish-folder %publish:outputpath% --framework %publish:fulltargetframework%" ]     }   } 

the code controller pretty simple. in first minute or return badrequest, after same request return ok.

    [httppost]     [produces( "application/json" )]     public iactionresult post( [frombody] myrequestdataclass requestdata )     {         if (requestdata == null)         {             return badrequest();         }         return ok();     } 


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -