On Windows 7 Dev machines that have Asp.net Core 2, all our API specific routes that return data (not Views) work.
A developer recently got the API setup on his new Windows 10 machine. When we run the routes in Postman or swagger, he can only get one particular GET route to work (extra tidbit - so happens this is the only route that does not call EntityFramework).
All other routes return a 404 Not Found as if the URLs don’t exist. It’s not our code returning the 404, it’s the platform itself.
None of our code is being executed since the 404 is being returned by the server, so no useful logging either.
I also deployed and tested it on a Win server 2016 machine, and getting the same exact issue.
The last thing I did on this server was install the Asp.net Core 2 SDK but had no effect.
some code:
[Produces("application/json")]
[Route("api/v1/Signatures/Request")]
public class SignatureRequestController : ControllerBase
[HttpPost]
[Route("")]
public async Task<SignatureRequestBaseResponse>
CreateSignatureRequestAsync([FromBody]SignatureRequest signatureRequest)
example POST url:
http://localhost/My.API/api/v1/signatures/request/
example json body:
{
"clientApplicationInstanceId" : "4318704B-7F90-4CAE-87A9-842F2925FE45",
"facilityId" : "PT",
"contact": "[email protected]",
"documentInstanceGuid" : "cc46c96f-cd78-448e-a376-cb4220d49a52",
"messageType" : "1",
"localeId": 1,
"field":
{
"fieldId": 45,
"signatureType": "4",
"displayName": "Short Display Name from iMed4Web",
"signerNameCaption": "signer name caption",
"signerAddressCaption": "address caption",
"signerCityStateZipCaption": "city state zip caption"
},
"documentPreviewHtml": "too long to show..."
}
Startup.csand the attribute routes in this controller). In routing the first match wins, so it is likely there is another route that is matching that you didn't intend to.