[{"data":1,"prerenderedAt":495},["ShallowReactive",2],{"article-synchronous-operations-are-disallowed-call-readasync-or-set-allowsynchronousio-to-true-instead":3},{"article":4,"tags":158,"previous":172,"next":392},{"id":5,"title":6,"author":7,"body":8,"createdAt":147,"description":148,"extension":149,"img":7,"meta":150,"navigation":151,"path":152,"seo":153,"stem":154,"tags":155,"updatedAt":147,"__hash__":157},"articles\u002Farticles\u002Fsynchronous-operations-are-disallowed-call-readasync-or-set-allowsynchronousio-to-true-instead.md","Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead.",null,{"type":9,"value":10,"toc":145},"minimark",[11,15,20,27,37,45,48,141],[12,13,14],"p",{},"Using JetBrains Rider using IIS Express to run asp.net core 3.1 web application, my httpcontext was null and had issues getting request bodies etc.  The exception message was",[12,16,17],{},[18,19,6],"em",{},[12,21,22,23,26],{},"I could run the application with Visual Studio 2019 without any issue (on IIS Express), definitely confusing.",[24,25],"br",{},"\nThe issue was related to the following..",[12,28,29,33],{},[30,31],"a",{"href":32},"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Faspnetcore\u002Fissues\u002F8302",[30,34,32],{"href":32,"rel":35},[36],"nofollow",[12,38,39,42],{},[30,40],{"href":41},"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Faspnetcore\u002Fissues\u002F7644",[30,43,41],{"href":41,"rel":44},[36],[12,46,47],{},"The solution",[49,50,55],"pre",{"className":51,"code":52,"language":53,"meta":54,"style":54},"language-cs shiki shiki-themes github-light github-dark","public void ConfigureServices(IServiceCollection services)  \n{  \n    \u002F\u002F If using Kestrel:  \n    services.Configure\u003CKestrelServerOptions>(options =>  \n    {  \n        options.AllowSynchronousIO = true;  \n    });  \n  \n    \u002F\u002F If using IIS:  \n    services.Configure\u003CIISServerOptions>(options =>  \n    {  \n        options.AllowSynchronousIO = true;  \n    });  \n}\n","cs","",[56,57,58,66,72,78,84,90,96,102,108,114,120,125,130,135],"code",{"__ignoreMap":54},[59,60,63],"span",{"class":61,"line":62},"line",1,[59,64,65],{},"public void ConfigureServices(IServiceCollection services)  \n",[59,67,69],{"class":61,"line":68},2,[59,70,71],{},"{  \n",[59,73,75],{"class":61,"line":74},3,[59,76,77],{},"    \u002F\u002F If using Kestrel:  \n",[59,79,81],{"class":61,"line":80},4,[59,82,83],{},"    services.Configure\u003CKestrelServerOptions>(options =>  \n",[59,85,87],{"class":61,"line":86},5,[59,88,89],{},"    {  \n",[59,91,93],{"class":61,"line":92},6,[59,94,95],{},"        options.AllowSynchronousIO = true;  \n",[59,97,99],{"class":61,"line":98},7,[59,100,101],{},"    });  \n",[59,103,105],{"class":61,"line":104},8,[59,106,107],{},"  \n",[59,109,111],{"class":61,"line":110},9,[59,112,113],{},"    \u002F\u002F If using IIS:  \n",[59,115,117],{"class":61,"line":116},10,[59,118,119],{},"    services.Configure\u003CIISServerOptions>(options =>  \n",[59,121,123],{"class":61,"line":122},11,[59,124,89],{},[59,126,128],{"class":61,"line":127},12,[59,129,95],{},[59,131,133],{"class":61,"line":132},13,[59,134,101],{},[59,136,138],{"class":61,"line":137},14,[59,139,140],{},"}\n",[142,143,144],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":54,"searchDepth":68,"depth":68,"links":146},[],"2020-04-22T18:48:09.024Z","Recently, I have been using Rider much more often and thought I would document recent issue (only noticed in Rider) not Visual Studio with IIS Express.","md",{},true,"\u002Farticles\u002Fsynchronous-operations-are-disallowed-call-readasync-or-set-allowsynchronousio-to-true-instead",{"title":6,"description":148},"articles\u002Fsynchronous-operations-are-disallowed-call-readasync-or-set-allowsynchronousio-to-true-instead",[156],"jetbrains","W9-zObQ1vw40leeRRBiFH70kjEGIop5PQSL-8S2-UYM",[159],{"id":160,"title":161,"body":162,"description":156,"extension":149,"img":166,"meta":167,"name":156,"navigation":151,"path":168,"seo":169,"stem":170,"__hash__":171},"tags\u002Ftags\u002Fjetbrains.md","Jetbrains",{"type":9,"value":163,"toc":164},[],{"title":54,"searchDepth":68,"depth":68,"links":165},[],"https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fjetbrains",{"description":156},"tags\u002Fjetbrains","VQo0-2191Z0vfDLqdLcpQeoie072asyvQ5I92OHyd5c",{"id":173,"title":174,"author":7,"body":175,"createdAt":382,"description":179,"extension":149,"img":383,"meta":384,"navigation":151,"path":385,"seo":386,"stem":387,"tags":388,"updatedAt":382,"__hash__":391},"articles\u002Farticles\u002Fwindowscryptographicexception-the-system-cannot-find-the-file-specified.md","WindowsCryptographicException The system cannot find the file specified.",{"type":9,"value":176,"toc":380},[177,180,183,203,206,220,377],[12,178,179],{},"Azure – while trying to read pfx (certificate) from disk I came across a number of issues, but thought this might help some out.",[12,181,182],{},"The fix was adding the final parameter X509KeyStorageFlags",[49,184,186],{"className":51,"code":185,"language":53,"meta":54,"style":54},"var cert = new X509Certificate2(\n    $\"{Environment.ContentRootPath}\u002FApp_Data\u002Fmycert.pfx\",\"{password}\",\n    X509KeyStorageFlags.MachineKeySet); \n",[56,187,188,193,198],{"__ignoreMap":54},[59,189,190],{"class":61,"line":62},[59,191,192],{},"var cert = new X509Certificate2(\n",[59,194,195],{"class":61,"line":68},[59,196,197],{},"    $\"{Environment.ContentRootPath}\u002FApp_Data\u002Fmycert.pfx\",\"{password}\",\n",[59,199,200],{"class":61,"line":74},[59,201,202],{},"    X509KeyStorageFlags.MachineKeySet);\n",[12,204,205],{},"Other references:",[12,207,208,211,214,217],{},[30,209],{"href":210},"https:\u002F\u002Fsupport.microsoft.com\u002Fen-us\u002Fhelp\u002F950090\u002Finstalling-a-pfx-file-using-x509certificate-from-a-standard-net-applic",[30,212,210],{"href":210,"rel":213},[36],[30,215],{"href":216},"https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002F52750160\u002Fwhat-is-the-rationale-for-all-the-different-x509keystorageflags",[30,218,216],{"href":216,"rel":219},[36],[49,221,225],{"className":222,"code":223,"language":224,"meta":54,"style":54},"language-html shiki shiki-themes github-light github-dark","An unhandled exception occurred while processing the request.\nWindowsCryptographicException: The system cannot find the file specified. System.Security.Cryptography.CngKey.Open(string keyName, CngProvider provider, CngKeyOpenOptions openOptions)  \nException: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler\u003CTOptions>.HandleRequestAsync()  \nStack Query Cookies Headers Routing \nWindowsCryptographicException: The system cannot find the file specified. System.Security.Cryptography.CngKey.Open(string keyName, \n    CngProvider provider, CngKeyOpenOptions openOptions) \nSystem.Security.Cryptography.CngKey.Open(string keyName, CngProvider provider) \nInternal.Cryptography.Pal.CertificatePal.GetPrivateKey\u003CT>(Func\u003CCspParameters, T> createCsp, Func\u003CCngKey, T> createCng) \nInternal.Cryptography.Pal.CertificatePal.GetRSAPrivateKey() \nSystem.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey() \nMicrosoft.IdentityModel.Tokens.X509SecurityKey.get_PrivateKey() \nMicrosoft.IdentityModel.Tokens.X509SecurityKey.get_PrivateKeyStatus() \nMicrosoft.IdentityModel.Tokens.AsymmetricSignatureProvider.FoundPrivateKey(SecurityKey key) \nMicrosoft.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(SecurityKey key, string algorithm, bool willCreateSignatures) \nMicrosoft.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(SecurityKey key, string algorithm, bool willCreateSignatures, \n        CryptoProviderFactory cryptoProviderFactory) \nMicrosoft.IdentityModel.Tokens.CryptoProviderFactory.CreateSignatureProvider(SecurityKey key, string algorithm, bool willCreateSignatures) \nMicrosoft.IdentityModel.Tokens.CryptoProviderFactory.CreateForSigning(SecurityKey key, string algorithm)  Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.CreateEncodedSignature(string input, SigningCredentials signingCredentials) System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.WriteToken(SecurityToken token)  Sample.Idp.Startup+\u003C>c__DisplayClass7_0.\u003CConfigureServices>b__8(AuthorizationCodeReceivedContext context) in Startup.cs\nMicrosoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectEvents.AuthorizationCodeReceived(AuthorizationCodeReceivedContext context) Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.RunAuthorizationCodeReceivedEventAsync(OpenIdConnectMessage authorizationResponse, ClaimsPrincipal user, AuthenticationProperties properties, JwtSecurityToken jwt) \nMicrosoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleRemoteAuthenticateAsync() \n","html",[56,226,227,233,238,250,255,260,265,270,299,304,309,314,319,324,329,335,341,347,365,371],{"__ignoreMap":54},[59,228,229],{"class":61,"line":62},[59,230,232],{"class":231},"sVt8B","An unhandled exception occurred while processing the request.\n",[59,234,235],{"class":61,"line":68},[59,236,237],{"class":231},"WindowsCryptographicException: The system cannot find the file specified. System.Security.Cryptography.CngKey.Open(string keyName, CngProvider provider, CngKeyOpenOptions openOptions)  \n",[59,239,240,243,247],{"class":61,"line":74},[59,241,242],{"class":231},"Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler\u003C",[59,244,246],{"class":245},"s7hpK","TOptions",[59,248,249],{"class":231},">.HandleRequestAsync()  \n",[59,251,252],{"class":61,"line":80},[59,253,254],{"class":231},"Stack Query Cookies Headers Routing \n",[59,256,257],{"class":61,"line":86},[59,258,259],{"class":231},"WindowsCryptographicException: The system cannot find the file specified. System.Security.Cryptography.CngKey.Open(string keyName, \n",[59,261,262],{"class":61,"line":92},[59,263,264],{"class":231},"    CngProvider provider, CngKeyOpenOptions openOptions) \n",[59,266,267],{"class":61,"line":98},[59,268,269],{"class":231},"System.Security.Cryptography.CngKey.Open(string keyName, CngProvider provider) \n",[59,271,272,275,278,281,284,288,291,294,296],{"class":61,"line":104},[59,273,274],{"class":231},"Internal.Cryptography.Pal.CertificatePal.GetPrivateKey\u003C",[59,276,277],{"class":245},"T",[59,279,280],{"class":231},">(Func\u003C",[59,282,283],{"class":245},"CspParameters,",[59,285,287],{"class":286},"sScJk"," T",[59,289,290],{"class":231},"> createCsp, Func\u003C",[59,292,293],{"class":245},"CngKey,",[59,295,287],{"class":286},[59,297,298],{"class":231},"> createCng) \n",[59,300,301],{"class":61,"line":110},[59,302,303],{"class":231},"Internal.Cryptography.Pal.CertificatePal.GetRSAPrivateKey() \n",[59,305,306],{"class":61,"line":116},[59,307,308],{"class":231},"System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey() \n",[59,310,311],{"class":61,"line":122},[59,312,313],{"class":231},"Microsoft.IdentityModel.Tokens.X509SecurityKey.get_PrivateKey() \n",[59,315,316],{"class":61,"line":127},[59,317,318],{"class":231},"Microsoft.IdentityModel.Tokens.X509SecurityKey.get_PrivateKeyStatus() \n",[59,320,321],{"class":61,"line":132},[59,322,323],{"class":231},"Microsoft.IdentityModel.Tokens.AsymmetricSignatureProvider.FoundPrivateKey(SecurityKey key) \n",[59,325,326],{"class":61,"line":137},[59,327,328],{"class":231},"Microsoft.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(SecurityKey key, string algorithm, bool willCreateSignatures) \n",[59,330,332],{"class":61,"line":331},15,[59,333,334],{"class":231},"Microsoft.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(SecurityKey key, string algorithm, bool willCreateSignatures, \n",[59,336,338],{"class":61,"line":337},16,[59,339,340],{"class":231},"        CryptoProviderFactory cryptoProviderFactory) \n",[59,342,344],{"class":61,"line":343},17,[59,345,346],{"class":231},"Microsoft.IdentityModel.Tokens.CryptoProviderFactory.CreateSignatureProvider(SecurityKey key, string algorithm, bool willCreateSignatures) \n",[59,348,350,353,356,359,362],{"class":61,"line":349},18,[59,351,352],{"class":231},"Microsoft.IdentityModel.Tokens.CryptoProviderFactory.CreateForSigning(SecurityKey key, string algorithm)  Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.CreateEncodedSignature(string input, SigningCredentials signingCredentials) System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.WriteToken(SecurityToken token)  Sample.Idp.Startup+",[59,354,355],{"class":245},"\u003C",[59,357,358],{"class":231},">c__DisplayClass7_0.\u003C",[59,360,361],{"class":245},"ConfigureServices",[59,363,364],{"class":231},">b__8(AuthorizationCodeReceivedContext context) in Startup.cs\n",[59,366,368],{"class":61,"line":367},19,[59,369,370],{"class":231},"Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectEvents.AuthorizationCodeReceived(AuthorizationCodeReceivedContext context) Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.RunAuthorizationCodeReceivedEventAsync(OpenIdConnectMessage authorizationResponse, ClaimsPrincipal user, AuthenticationProperties properties, JwtSecurityToken jwt) \n",[59,372,374],{"class":61,"line":373},20,[59,375,376],{"class":231},"Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleRemoteAuthenticateAsync()\n",[142,378,379],{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s7hpK, html code.shiki .s7hpK{--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}",{"title":54,"searchDepth":68,"depth":68,"links":381},[],"2020-05-08T18:24:50.164Z","\u002Farticles\u002Fimages\u002Fimage_thumb_637245590899400228.png",{},"\u002Farticles\u002Fwindowscryptographicexception-the-system-cannot-find-the-file-specified",{"title":174,"description":179},"articles\u002Fwindowscryptographicexception-the-system-cannot-find-the-file-specified",[389,390],"azure","javascript","gbbOXSewTUn-I9zN11i80mm77-02qjY2Sj3AUb7gbjM",{"id":393,"title":394,"author":7,"body":395,"createdAt":486,"description":487,"extension":149,"img":456,"meta":488,"navigation":151,"path":489,"seo":490,"stem":491,"tags":492,"updatedAt":486,"__hash__":494},"articles\u002Farticles\u002Fgithub-desktop–‘husky’--pre-commit-exception.md","GitHub Desktop ‘husky’ pre commit Exception",{"type":9,"value":396,"toc":484},[397,400,404,412,452,466,469,472,475,478,481],[12,398,399],{},"After adding a solution to my local GIT repository, and comitting to local master I received the following exception…",[401,402,403],"strong",{},"Commit failed - exit code 1 received, with output: 'husky > pre-commit (node v12.16.2)",[12,405,406,409,411],{},[59,407,408],{},"npm run lint",[59,410,408],{}," >\nvuesion@3.7.2 lint D:_Projects\\GitHub\\GitHub\\Yardy\\VueEParent\\VueE\\VueE\\PWA\\vuesion-master",[12,413,414,416,417,419,422,424,425,427,428,430,433,434,436,437,439,440,442,443,445,446,448,449,451],{},[59,415,408],{}," > vuesion lint\n",[59,418,408],{},[59,420,421],{},"npm run test",[59,423,421],{}," > vuesion@3.7.2 test D:_Projects\\GitHub\\GitHub\\Yardy\\VueEParent\\VueE\\VueE\\PWA\\vuesion-master\n",[59,426,421],{}," > vuesion test --coverage\n",[59,429,421],{},[59,431,432],{},"vuesion prettier --staged","   Finding changed files since git revision 5f8e91e.\n",[59,435,432],{},"   Found 334 changed files.\n",[59,438,421],{}," PASS src\u002Fapp\u002Fshared\u002Fcomponents\u002FVueDropdownMenu\u002FVueDropdownMenu.spec.ts\n",[59,441,421],{}," PASS src\u002Fapp\u002Fshared\u002Fcomponents\u002FVueButton\u002FVueButton.spec.ts\n",[59,444,421],{}," PASS src\u002Fapp\u002Fshared\u002Fcomponents\u002FVueSlider\u002FVueSlider.spec.ts\n",[59,447,421],{}," PASS src\u002Fapp\u002Fshared\u002Fcomponents\u002FVueAutocomplete\u002FVueAutocomplete.spec.ts (5.11s)\n",[59,450,421],{}," PASS src\u002Fapp\u002Fshared\u002Fcomponents\u002FVueStarRating\u002FVueStarRating.spe",[12,453,454],{},[30,455,457],{"href":456},"\u002Farticles\u002Fimages\u002FFSMlV0tu1N_637229069433438891.png",[458,459],"img",{"style":460,"title":461,"src":462,"alt":461,"width":463,"height":464,"border":465},"border: 0px currentcolor; display: inline; background-image: none;","FSMlV0tu1N","\u002Farticles\u002Fimages\u002FFSMlV0tu1N_thumb_637229069434485862.png",417,360,0,[12,467,468],{},"Attempts & Solution:",[12,470,471],{},"*Tried adding C:\\Program Files\\Git\\bin to PATH – no change (tried a commit and still have the issue)\n*Tried adding C:\\Program Files\\nodejs to PATH – no change (tried a commit and still have the issue)\n*Got it (worked)",[12,473,474],{},"npm rebuild\nremoved the node_modules",[12,476,477],{},"performed my commit",[12,479,480],{},"npm install",[12,482,483],{},"All good for now",{"title":54,"searchDepth":68,"depth":68,"links":485},[],"2020-04-19T15:29:03.532Z","GitHub Desktop issue with pre-commit package and related hooks? Struggled with this one this morning and tried a few things.  I thought I would document so it may help others struggling with the same issue.",{},"\u002Farticles\u002Fgithub-desktop-'husky'-pre-commit-exception",{"title":394,"description":487},"articles\u002Fgithub-desktop–‘husky’--pre-commit-exception",[493],"git","t0XlubouJE4FtSJ9GeIA8Xwjdns6LCNLcGxCMFZjgA0",1781574765014]