Please Login to Continue

Everything Business Plan Book

Everything Business Plan Book

$10.00

Save Water Drink Wine (Bath and Body Works Scented

Save Water Drink Wine (Bath and Body Works Scented

$25.00

Seeing the Big Pucture, Business Acumen to Build Y

Seeing the Big Pucture, Business Acumen to Build Y

$10.00

InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHeaderDictionary' while attempting to activate

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);
IHeaderDictionary Technology published

Was this page helpful?

Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful..



© 2020 - ErnesTech - Privacy