Everything Business Plan Book
Save Water Drink Wine (Bath and Body Works Scented
Seeing the Big Pucture, Business Acumen to Build Y
Question: How do you resolve,
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHeaderDictionary' while attempting to activate 'HelperRepository'
Answer: In this case, you are trying to use the IHeaderDictionary in a wrong way, do not inject IHeaderDictionary in a class Constructor instead instantiate the class that inherits from IHeaderDictionary which is Microsoft.AspNetCore.Http.HeaderDictionary(); then use the variable to add Headers to the response or request.
var _headers = new Microsoft.AspNetCore.Http.HeaderDictionary(); _headers.Add("MyAweseomHeader",ValueHere);