Die JSON-Datei konnte nicht geparst werden. .Net Core 5.0 Web-API

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Die JSON-Datei konnte nicht geparst werden. .Net Core 5.0 Web-API

by Guest » 06 Jan 2025, 22:12

Ich habe eine .Net Core-Web-API-Anwendung, die auf Version 5.0 ausgerichtet ist.
Immer wenn ich meine API veröffentliche und im IIS meines lokalen Computers bereitstelle, d. h. unter Windows 10,
Ich bin in der Lage, Rückgabedaten in Postman von meiner API abzurufen.
Aber wenn ich denselben veröffentlichten Ordner kopiere und auf IIS eines Windows-Servercomputers hoste, erhalte ich die folgende Fehlermeldung.2021-02-18T07:16:03.5549203-05:00 80000002-0004-fd00-b63f-84710c7967bb [ERR] Die JSON-Datei konnte nicht analysiert werden. (a9f4b9b9)
Meine Controller-Methode ist wie folgt:

Code: Select all

public ActionResult GetContactDetails(Guid contactId)
{
var contactDetails = _contactDetailsRepository.GetContactDetailsById(contactId);
_logger.LogInformation($"Returned contact Details from database for contact Id: {0}.",
contactId);
return Ok(contactDetails);
}
catch (Exception ex)
{
_logger.LogError($"Error in retriving contact details for contact Id: {ex.Message}");
return StatusCode(500, "Internal server error");
}
}

Top