‘<‘ is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.


If you are getting this error message with Web API in Blazor WeAssembly application. You can troubleshoot following ways.

  1. Take the api end point and trigger with PostMan
  2. If it is not triggering, then try to see the api method attribute. So many we missed out input parameter of Web api method.

In my case, I was missed out InstanceId for Web API Method

 [HttpGet]
 [Route("[action]]
 public async Task<List<ProductModel>> GetProducts(int instanceId) => await _service.GetProducts(instanceId);

Fix: Pass the instanceId parameter to web api method.

 [HttpGet]
 [Route("[action]/{instanceId}")]
 public async Task<List<ProductModel>> GetProducts(int instanceId) => await _service.GetProducts(instanceId);

The instance of entity type ‘XXXX’ cannot be tracked because another instance with the same key value for {‘XXXX’} is already being tracked.


While working my EF core Application I was getting this exception message. I fixed this issue like this

Step 1: In Insert/update method make ensure to detach the entity.

_db.Entry(localRopFiles).State = EntityState.Detached;

Step 2: If you are loading data on page load then use AsNoTracking() method

var query = await _db.LocalRopFiles.AsNoTracking().ToListAsync();

I hope this will help some one who is getting this type of exception.