System.Security.Cryptography.CryptographicException while accessing Hangfire dashboard locally

Tags: #<Tag:0x00007fafea02d220> #<Tag:0x00007fafea02d158> #<Tag:0x00007fafea02cff0> #<Tag:0x00007fafea02cf28>

Hi,
I am facing strange error while accessing Handfire dashboard locally. Complete exception is below,

{
“ClassName”: “System.Security.Cryptography.CryptographicException”,
“Message”: “An error occurred while trying to encrypt the provided data. Refer to the inner exception for more information.”,
“Data”: null,
“InnerException”: {
“ClassName”: “System.Xml.XmlException”,
“Message”: “’.’, hexadecimal value 0x00, is an invalid character. Line 1, position 1.”,
“Data”: null,
“InnerException”: null,
“HelpURL”: null,
“StackTraceString”: " at System.Xml.XmlTextReaderImpl.Throw(Exception e)\r\n at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)\r\n at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos)\r\n at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()\r\n at System.Xml.XmlTextReaderImpl.ParseDocumentContent()\r\n at System.Xml.XmlTextReaderImpl.Read()\r\n at System.Xml.XmlReader.MoveToContent()\r\n at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)\r\n at System.Xml.Linq.XElement.Load(Stream stream, LoadOptions options)\r\n at System.Xml.Linq.XElement.Load(Stream stream)\r\n at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.ReadElementFromFile(String fullPath)\r\n at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.GetAllElementsCore()+MoveNext()\r\n at System.Collections.Generic.List1..ctor(IEnumerable1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.GetAllElements()\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.GetAllKeys()\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.CreateCacheableKeyRingCore(DateTimeOffset now, IKey keyJustAdded)\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.ICacheableKeyRingProvider.GetCacheableKeyRing(DateTimeOffset now)\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRingCore(DateTime utcNow, Boolean forceRefresh)\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRing()\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] plaintext)",
“RemoteStackTraceString”: null,
“RemoteStackIndex”: 0,
“ExceptionMethod”: null,
“HResult”: -2146232000,
“Source”: “System.Private.Xml”,
“WatsonBuckets”: null,
“res”: “’{0}’, hexadecimal value {1}, is an invalid character.”,
“args”: [
“.”,
“0x00”
],
“lineNumber”: 1,
“linePosition”: 1,
“sourceUri”: “”,
“version”: “2.0”
},
“HelpURL”: null,
“StackTraceString”: " at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] plaintext)\r\n at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Serialize(AntiforgeryToken token)\r\n at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.Serialize(IAntiforgeryFeature antiforgeryFeature)\r\n at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetAndStoreTokens(HttpContext httpContext)\r\n at Hangfire.Dashboard.AspNetCoreDashboardContext…ctor(JobStorage storage, DashboardOptions options, HttpContext httpContext)\r\n at Hangfire.Dashboard.AspNetCoreDashboardMiddleware.Invoke(HttpContext httpContext)\r\n at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)\r\n at OurAPI.Middleware.ExceptionHandlingMiddleware.InvokeAsync(HttpContext context) in D:\OurAPI\Middleware\ExceptionHandlingMiddleware.cs:line 43",
“RemoteStackTraceString”: null,
“RemoteStackIndex”: 0,
“ExceptionMethod”: null,
“HResult”: -2146233087,
“Source”: “Microsoft.AspNetCore.DataProtection”,
“WatsonBuckets”: null
}

Can anyone please help out whats exactly is this? It is working on other environments but not locally.