tag:blogger.com,1999:blog-54879338160189568512024-03-05T06:41:58.097-08:00Solution for your Errors and ExceptionsBhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-5487933816018956851.post-23241001347047424772020-07-24T23:17:00.001-07:002020-07-24T23:17:47.324-07:00Web Deploy detected insufficient space on disk in Azure<b>Error: </b>Web Deploy detected insufficient space on disk.<div><br /></div><div><b>Explanation: </b>In Azure Portal, When you run release pipeline using Web Deploy method and you have subscription that is free or provide less storage then you can face this error.</div><div><br /></div><div><b>Solution: </b>To overcome this issue either you need to reduce the size of your project if you want to use free subscription or update your plan either to shared or some other plan that has required configuration.</div><div><br /></div><div><br /></div><div>Thanks!</div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-60491822767922002492020-07-20T02:29:00.004-07:002020-07-25T22:53:42.048-07:00Azure - Failed to deploy web package to App Service. Internal Server Error (CODE: 500)- Fixed<b>Error: </b>Failed to deploy web package to App Service. Internal Server Error (CODE: 500)<div><br /></div><div class="separator" style="clear: both; text-align: center;"><img border="0" data-original-height="471" data-original-width="1874" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaWu3cBYtOzuO97K43rHSMGvIKLP8TTpgI-wMyQwsgJlylLEI4RQ19dYkP3s1fN1WbFUOynpNPftR-6_Uh-aR93W49ZyKtboa2WXd4z8fVDU2WklYCXE6Px7D61wkoYRkh8FepIzdiyFM/w625-h156/deploy-error.png" width="625" /></div><div><br /></div><div><b>Explanation: </b>I was getting this error when trying to deploy azure functions with release pipeline. I got this and there was no additional information logs with this. I wasted my one day on this issue.</div><div><br /></div><div><b>Find Error: </b>You can see the actual error by changing <span style="background-color: white; color: #24292e; font-size: 14px;">deploy method for </span><b><span style="background-color: white; box-sizing: border-box; color: #24292e; font-size: 14px;">web deploy</span> </b>by editing your pipeline.</div><div><br /></div><div><b>My Root Cause: "Web Deploy detected insufficient space on disk." </b>So this was the issue for me, it may be because of my subscription. </div><div><br /></div><div>For different persons root cause might be vary but you can see actual error using this deploy method and can apply your fixes accordingly.</div><div><br /></div><div>Thanks!!!</div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-29013640391941476862020-07-16T23:57:00.001-07:002020-07-16T23:57:54.900-07:00Swagger for Azure functions: Undocumented TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body. Fixed.<b>Error - </b>Undocumented TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body. <div><br /></div><div><b>Root Cause: </b>I have my Azure functions Project for which I am configuring swagger documentation using Nuget Package "<span style="background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px;">AzureExtensions.Swashbuckle</span>". When I am opening swagger url in browser and I try one get method then I face this error because 'Get' method has body that should not.</div><div><br /></div><div>My function code is:</div><div><br /></div><div><div> public async Task<IActionResult> Test(</div><div> [HttpTrigger(AuthorizationLevel.Anonymous, Http.Methods.Get, Route = Version + "/test")] HttpRequest request,</div><div> ExecutionContext context, IBinder binder)</div><div> {</div></div><div><br /></div><div>}</div><div><br /></div><div><b>Solution: </b>To remove the body from 'Get' method, I need to specify some ignore attribute to function parameters as below.</div><div><br /></div><div><div> public async Task<IActionResult> GetTest(</div><div> [HttpTrigger(AuthorizationLevel.Anonymous, Http.Methods.Get, Route = Version + "/test")] HttpRequest request,</div><div> [SwaggerIgnore]ExecutionContext context, [SwaggerIgnore]IBinder binder)</div><div> {</div></div><div>}</div><div><br /></div><div>Enjoy!!!</div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-42171297568189945042020-05-27T22:37:00.007-07:002020-05-27T22:39:44.126-07:00npm ERR! Unable to authenticate, need: Bearer authorization_uri=https://login.windows.net/*********, Basic realm="https://pkgsprodcus1.pkgs.visualstudio.com/", TFS-Federated Fixed<b>Error - </b><font face="arial" size="2"><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">npm ERR</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">!</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"> </span><span class="typ" style="border: 0px; box-sizing: inherit; color: #2b91af; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">Unable</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"> to authenticate</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">,</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"> need</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">:</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"> </span><span class="typ" style="border: 0px; box-sizing: inherit; color: #2b91af; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">Bearer</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"> authorization_uri</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">=</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">https</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">:</span><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">//login.windows.net/*********, Basic realm="https://pkgsprodcus1.pkgs.visualstudio.com/", TFS-Federated</span></font><div><font face="arial" size="2"><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><br /></span></font></div><div><font face="arial" size="2"><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><b>Root Cause - </b>When you have configured your package registry in .npmrc file as below.</span></font></div><div><font face="arial" size="2"><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><br /></span></font></div><font color="#3367d6">registry</font>=https://<your-organization-cloud>.pkgs.visualstudio.com/_packaging/bdcNpmFeed/npm/registry/<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><br /></div>And your credentials are not updated or has expired then you can face the authentication<br />issue.<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><br /></div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><b>Solution - </b>run below command in visual studio code to get authenticated.</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><br /></div><div style="font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><span style="background-color: #f7cb4d;"><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">vsts</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">-</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">npm</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">-</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">auth </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">-</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">config </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">npmrc</span> </span></div><div style="font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><span style="background-color: #f7cb4d;"><br /></span></div><div style="font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><span style="background-color: #f7cb4d;"><br /></span></div>ThanksBhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-72206874800266663742020-05-25T05:11:00.000-07:002020-05-25T05:11:39.386-07:00Unexpected token T in JSON at position 0 in Angular CLI 6 - Fixed<b>Error - </b>Unexpected token T in JSON at position 0 <div><div><br /></div><div><b>Root Cause - </b>When upgrading to Angular CLI 6 and then you run build or install command then you can face this error.</div><div><br /></div><div><b>Solution - </b>Make sure correct version of Angular CLI is installed. For me Angular CLI 6 did not work so finally I upgraded directly to Angular 7 instead of Angular 6 first as per <a href="https://www.qfles.com/interview-question/angular-interview-questions">angular upgrade guide</a>.</div></div><div><br /></div><div>Thanks</div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-51408509948428119612020-05-25T05:01:00.000-07:002020-05-25T05:01:40.114-07:00The serve command requires to be run in an Angular project, but a project definition could not be found - Fixed<b>Error - </b>The serve command requires to be run in an Angular project, but a project definition could not be found<div><br /></div><div><b>Root Cause - </b>When there is no project definition file in your project then you will see this error when you will run ng-serve or ng-build commands.</div><div><br /></div><div><b>Project definition file - </b>In Angular project definition file is generated when you create new application or upgrade existing application. In Angular versions lesser than 6 this file name is <span style="background-color: #f7cb4d;">.angulat-cli.json </span>and in Angular version 6 and above it's name is angular.json .</div><div><br /></div><div><b>Solution - </b> So while running the angular build or run commands make sure you have correct project definition file. If you are upgrading your application from Angular 5 or lesser versions to <a href="https://www.qfles.com/interview-question/angular-interview-questions">Angular 6 and greater versions</a> then you need to run below command to generate new project definition and other related files.</div><div><span style="background-color: #9e9e9e;"><br /></span></div><div><span style="background-color: #9e9e9e; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px;"><font color="#ffffff">ng update @angular/cli </font></span><span style="background-color: white; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px;"> // run it twice,</span></div><div><span style="background-color: white; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px;"><br /></span></div><div><span style="background-color: white; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px;">If it's not generating then again try to run below commands in same sequence.</span></div><div><span style="background-color: #9e9e9e; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px;"><font color="#eeeeee"><br /></font></span></div><span style="background-color: #9e9e9e;"><font color="#eeeeee">npm install -g @angular-devkit/core</font></span><div><span style="background-color: #9e9e9e;"><font color="#eeeeee"><br />npm install -g @angular/cli</font></span></div><div><span style="background-color: #9e9e9e;"><font color="#eeeeee"><br />npm install @angular/cli</font></span></div><div><span style="background-color: #9e9e9e;"><font color="#eeeeee"><br />ng update @angular/cli</font></span><br /><div><span style="background-color: white; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px;"><br /></span></div><div><span style="background-color: white; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px;">Thanks</span></div></div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-91450709750395533472020-05-25T04:27:00.002-07:002020-05-25T04:27:48.621-07:00Your global Angular CLI version (8.3.3) is greater than your local version (1.6.5). The local Angular CLI version is used.<b>Warning - </b>Your global Angular CLI version (8.3.3) is greater than your local<div>version (1.6.5). The local Angular CLI version is used.</div><div><br /></div><div><b>Explanation - </b>When you run an angular application and you have different versions of <a href="https://www.qfles.com/interview-question/angular-interview-questions">Angular CLI</a> installed globally and in local project then you can see this warning or error.</div><div><br /></div><div><b>Solution - </b>There are 3 things here.</div><div><ol style="text-align: left;"><li>Either you can continue with this warning</li><li>You can install matching version of angular CLI to global in local project by using below command.</li></ol><div><span> </span><span> </span><span style="background-color: black; font-family: "Roboto Mono", monospace; font-size: 14px;"><font color="#ffffff">npm install @angular/cli@version</font></span></div></div><div><span style="background-color: black; font-family: "Roboto Mono", monospace; font-size: 14px;"><font color="#ffffff"><br /></font></span></div><span> </span><span> </span>3. Install Latest version of Angular CLI globally and in project as well.<div><br /><div><span> </span><span> To install latest angular CLI globally use below command.</span><br /><div><span> </span><span> </span><span style="background-color: #1e1e1e; color: white; font-family: "Source Code Pro", monospace; font-size: 15px;">npm install -g @angular/cli</span></div><div><span style="background-color: #1e1e1e; color: white; font-family: "Source Code Pro", monospace; font-size: 15px;"><br /></span></div><span> </span><span> To install latest angular CLI in project use below command.</span></div><div><span> </span><span> </span><span style="background-color: #1e1e1e; color: white; font-family: "Source Code Pro", monospace; font-size: 15px;">npm install @angular/cli</span><br /><div><font color="#ffffff" face="Source Code Pro, monospace"><span style="font-size: 15px;"><br /></span></font><div><br /></div></div></div></div><div>Thanks</div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-2664870473648439572020-05-22T06:55:00.002-07:002020-05-22T06:57:48.415-07:00Cannot find module 'rxjs-compat' in Angular 9<b>Error - </b>Cannot find module 'rxjs-compat'. Complete error look like this.<div><br /></div><div><h1 class="grid--cell fs-headline1 fl1 ow-break-word mb8" itemprop="name" style="background-color: white; border: 0px; box-sizing: inherit; color: #242729; flex: 1 1 auto !important; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-weight: inherit; line-height: 1.3; margin-bottom: 8px !important; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word !important; padding: 0px; vertical-align: baseline;"><a class="question-hyperlink" href="https://www.qfles.com/interview-question/angular-interview-questions" style="border: 0px; box-sizing: inherit; cursor: pointer; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: 1.35; margin: 0px; padding: 0px; text-decoration-line: none; vertical-align: baseline;"><font size="2">ERROR in node_modules/rxjs/Rx.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat'</font></a></h1><div><br /></div><div><b>Root Cause - </b>When you update your angular application from Angular 2/4/5 to Greater versions of Angular then some times you face this error.</div><div><br /></div><div>Angular CLI does not add <a href="https://www.qfles.com/interview-question/angular-interview-questions">'rxjs-compat'</a> package automatically or some issue in the package.</div><div><br /></div><div><b>Solution - </b>To get rid of this error install this package in the application.</div><div><br /></div><div><span style="background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px;">npm install rxjs-compat</span></div><div><span style="background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px;"><br /></span></div><div><span style="background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px;">Thanks</span></div></div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-24005518485688860082020-05-22T06:45:00.001-07:002020-07-20T02:36:54.123-07:00Property 'map' does not exist on type 'Observable' while upgrade to Angular 6/7/8/9 from Angular 5/4/2<b>Error - </b>Property 'map' does not exist on type 'Observable<Response>'<div><br /></div><div><b>Root Cause - </b>When you upgrade your application from Angular 2/4/5 to <a href="https://www.qfles.com/interview-question/angular-interview-questions">Angular 6/7/8/9</a> then there are some functions that can not support in major versions. </div><div><br /></div><div><b>Solution - </b>To get rid of this error change your import statements as below.</div><div><br /></div><div><div style="line-height: 19px;"><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;"><span style="color: blue;">import</span> { Observable } <span style="color: blue;">from</span> <span style="color: #a31515;">'rxjs'</span>;</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;"><span style="color: blue;">import</span> { catchError, map } <span style="color: blue;">from</span> <span style="color: #a31515;">'rxjs/operators'</span>;</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;"><br /></div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;">And change your implementation for map function as below using '<a href="https://www.qfles.com/interview-question/angular-interview-questions">Pipe</a>' function.</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;"><br /></div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;"><div style="line-height: 19px;"><div>delete(url: string, options?: any): Observable<any> {</div><div> <span style="color: blue;">return</span> <span style="color: blue;">this</span>._http.delete(<span style="color: #a31515;">`</span><span style="color: blue;">${</span><span style="color: blue;">this</span>._baseUrl<span style="color: blue;">}${</span>url<span style="color: blue;">}</span><span style="color: #a31515;">`</span>, options)</div><div> .pipe(</div><div> map(result <span style="color: blue;">=></span> {</div><div> <span style="color: blue;">return</span> result;</div><div> }),</div><div> catchError((e: any) <span style="color: blue;">=></span> Observable.throw(<span style="color: blue;">this</span>.errorHandler(e)))</div><div> );</div><div> }</div></div></div><br />Thanks!!!</div></div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-59308600520590119822020-05-22T06:34:00.001-07:002020-05-22T06:34:41.147-07:00Property 'catch' does not exist on type 'Observable' in angular 6/7/8/9 Fixed<b>Error </b>- Property 'catch' does not exist on type 'Observable<any>' in Angular.<div><br /></div><div><b>Root Cause - </b>When you upgrade your angular application from Angular 2 or Angular 4 to Angular 6 or <a href="https://www.qfles.com/interview-question/angular-interview-questions">greater versions</a> then you can face this error. </div><div><br /></div><div>As From Angular 5 onwards there were many changes in rxjs. I</div><div><br /></div><div><b>Solution - </b>To fix this error change your import syntax as below. change 'catch' to 'catchError'.</div><div><br /></div><div><div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div><span style="color: blue;">import</span> { Observable } <span style="color: blue;">from</span> <span style="color: #a31515;">'rxjs'</span>;</div><div><span style="color: blue;">import</span> { catchError, map } <span style="color: blue;">from</span> <span style="color: #a31515;">'rxjs/operators'</span>;</div><div><br /></div><div>Thanks</div></div></div><div><br /></div><div><br /></div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-29987357414194906802020-04-16T07:01:00.000-07:002020-04-16T07:02:46.289-07:00Fixed: The required column was not present in the results of a 'FromSql' operation in asp.net core EF core<div dir="ltr" style="text-align: left;" trbidi="on">
In EF core you will face this error many times.<br />
<div>
<br /></div>
<div>
Error: The required column was not present in the results of a 'FromSql' operation.</div>
<div>
<br /></div>
<div>
To fix this error either remove the column from mapped model or add UnMapped attribute.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
public class Customer</div>
<div>
{</div>
<div>
/// <summary></div>
<div>
/// Gets or sets the ID for the customer</div>
<div>
/// </summary></div>
<div>
[UnMapped]</div>
<div>
public int CustomerName { get; set; }</div>
<div>
}<br />
<br />
<br />
<a href="https://www.qfles.com/interview-question" target="_blank"><b>Some Essential Interview Questions</b></a></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-87676364528943475932020-04-15T03:22:00.001-07:002020-05-21T05:55:25.610-07:00Fixed: Unable to get MSI token from local Visual StudioThere are many scenarios where you need to use Managed Identity Services for authentication. You setup all the things correctly but in local setup you may encounter this below error.<br /><br /><b>Error </b>- "Unable to get MSI token from local Visual Studio"<br /><br /><b>Solution </b>- To fix this use below steps.<br /><br /><ol style="text-align: left;"><li>Go to Visual Studio Tools </li><li>Go to Options </li><li>Go to Azure Service Authentication. </li></ol> <br /> Now Make sure, your account is there or not. if its there try to add same account again so it will override your credentials if these has expired or changed.<br /><br /><br />It will solve your error.
<div><br /></div><div>Thanks</div>Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-44978619297941656412020-02-17T01:43:00.003-08:002020-05-21T05:59:07.863-07:00Solved: RangeError: Maximum call stack size exceeded when using valueChanges.subscribe<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
RangeError: Maximum call stack size exceeded when using valueChanges.subscribe</h2>
<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<span style="color: blue;">public</span> tokenAcquired: BehaviorSubject<any> = <span style="color: blue;">new</span> BehaviorSubject<any>(<span style="color: #a31515;">''</span>);</div>
<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><br /></div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">//from where you want to trigger the subscription </div>
<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div style="line-height: 19px;">
<span style="color: blue;">this</span>.appService.tokenAcquired.next(tokenStored.accessToken);</div><div style="line-height: 19px;"><br /></div><div style="line-height: 19px;"><br /></div><div style="line-height: 19px;">//where you are subscribing
</div><div style="line-height: 19px;"><span style="color: blue;"><br /></span></div><div style="line-height: 19px;"><span style="color: blue;">this</span>.appService.tokenAcquired.pipe(
</div><div style="line-height: 19px;"><div style="line-height: 19px;">
<div>
distinctUntilChanged()) <span style="color: green;">// it will emit if value is different then last</span></div><div>
.subscribe((token) <span style="color: blue;">=></span> {</div><div> <span style="color: blue;">if</span> (<span style="color: blue;">this</span>.debugMode) {</div><div> console.log(<span style="color: #a31515;">"token acquired and calling getApps."</span>);</div><div> }</div><div> <span style="color: blue;">this</span>.getApps();</div><div> })</div></div></div>
</div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-5083633039433728402020-01-31T08:29:00.000-08:002020-01-31T08:29:18.609-08:00Azure - website publish fail due to path long<div dir="ltr" style="text-align: left;" trbidi="on">
Add below code to PropertiesGroup in .csproj file.<br />
<br />
<pre class="lang-xml prettyprint prettyprinted" style="background-color: #eff0f1; border-radius: 3px; border: 0px; box-sizing: inherit; color: #393318; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; width: auto;"><code style="border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="tag" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><IntermediateOutputPath></span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">..\Temp</span><span class="tag" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"></IntermediateOutputPath></span></code></pre>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-84665998881663250452020-01-23T01:08:00.004-08:002020-05-21T05:57:42.635-07:00Solved: MSAL with Angular2 : Refused to display in a frame because it set 'X-Frame-Options' to 'deny'<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span style="color: #3d85c6;">MSAL with Angular2 : Refused to display in a frame because it set 'X-Frame-Options' to 'deny'</span></h2>
<br />
we get this error when you are not setting redirectUri in your loginRedirect or acquireTokenRedirect methods in your angular or js code.<br />
<br />
<h3 style="text-align: left;">
<span style="color: #3d85c6;">Solution</span>:</h3>
<div style="text-align: left;">
<span style="font-weight: normal;">Add redirectUri in (loginRedirect or acquireTokenRedirect) methods or at msal configuration level.</span></div>
<div style="background-color: white; color: #292929; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
editProfile() {</div>
<div style="background-color: white; color: #292929; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div>
<span style="color: blue;">var</span> authority = <span style="color: #a31515;">`https://</span><span style="color: blue;">${</span>Domain<span style="color: blue;">}</span><span style="color: #a31515;">/tfp/</span><span style="color: blue;">${</span>tenant<span style="color: blue;">}</span><span style="color: #a31515;">/</span><span style="color: blue;">${</span>profileEditPolicy<span style="color: blue;">}</span><span style="color: #a31515;">`</span>;</div><div>
<span style="color: green;">/* just calling acquiretokenRedirect with different policy and authority </span></div><div><span style="color: green;"><span> </span><span> </span>to edit profile,</span></div><div><span style="color: green;"><span> </span><span> </span>no need to pass redirectUri as authority will decide */</span></div><div>
<span style="color: blue;">this</span>.authService.acquireTokenRedirect({</div><div> scopes: [Scopes],</div><div><span style="color: green;">// https://yourApp.b2clogin.com/yourApp.onmicrosoft.com/profile_edit_policy</span>
authority: authority ,</div>redirectUri: "your App url",
<div>
});</div><div>
}</div><div><br /></div><div>Thanks</div></div><br /></div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-50658000111880238702020-01-23T01:00:00.002-08:002020-05-21T06:00:23.967-07:00Solved: redirect_uri_mismatch Azure AD B2C with angular using MSAL || MSAL Profile Edit <div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span style="color: #3d85c6;">Profile Edit in MSAL</span></h2>
if you are using msal in Angular Application and trying to edit profile then follow below steps.<br />
<br />
1. Set the Profile edit policy and prepare authority.<br />
2. Set redirectUri at the configuration level or here in below code. if you do not set the redirectUri you will get this error :<br />
<div>
<br /></div>
"MSAL with Angular2 : Refused to display in a frame because it set 'X-Frame-Options' to 'deny'"<br />
<br />
2. Call acquireTokenRedirect as below.<br />
<br />
<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
editProfile() {</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div>
<span style="color: blue;">var</span> authority = <span style="color: #a31515;">`https://</span><span style="color: blue;">${</span>Domain<span style="color: blue;">}</span><span style="color: #a31515;">/tfp/</span><span style="color: blue;">${</span>tenant<span style="color: blue;">}</span><span style="color: #a31515;">/</span><span style="color: blue;">${</span>profileEditPolicy<span style="color: blue;">}</span><span style="color: #a31515;">`</span>;</div><div>
<span style="color: green;">/* just calling acquiretokenRedirect with different policy and authority </span></div><div><span style="color: green;"><span> </span>to edit profile,</span></div>
<div><span style="color: green;"><span> </span>no need to pass redirectUri as authority will decide */</span></div><div>
<span style="color: blue;">this</span>.authService.acquireTokenRedirect({</div><div> scopes: [Scopes],</div><div><span style="color: green;">// https://yourApp.b2clogin.com/yourApp.onmicrosoft.com/profile_edit_policy</span></div><div> authority: authority </div><div> });</div><div>}</div>
</div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-9835062786698444722020-01-08T21:28:00.003-08:002020-05-21T06:02:32.939-07:00cannot read property 'subscribe' of undefined in Angular<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span style="color: #0b5394;">cannot read property 'subscribe' of undefined in Angular</span></h2>
You will get this error when you initialize the subject as below.<br />
<br />
<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<span style="color: blue;">public</span> tokenAcquired: Subject<any>;</div>
<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">and calling subscribe method over it as below.</div>
<div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div style="line-height: 19px;"><div><span style="color: blue;">this</span>.appService.tokenAcquired.subscribe((token) <span style="color: blue;">=></span> {</div><div> <span style="color: blue;">this</span>.getApps();</div><div>
})</div>
</div></div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><b>Solution - </b>To fix this error declare and initialize the subject as below.</div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><br /></div><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div style="line-height: 19px;"><span style="color: blue;">public</span> tokenAcquired: Subject<any> = <span style="color: blue;">new</span> Subject<any>();</div><div style="line-height: 19px;"><br /></div><div style="line-height: 19px;">Thanks</div>
<div style="line-height: 19px;"><b><a href="http://qfles.com/" target="_blank">QFLES</a></b></div></div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-80542709142995658802019-12-27T01:14:00.003-08:002019-12-27T01:14:44.127-08:00Invalid state. ''bad, state expected : null. in msal Angular<div dir="ltr" style="text-align: left;" trbidi="on">
When you are using MSAL in angular app you encounter this error "Invalid state. ''bad, state expected : null" while calling "<span style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; white-space: pre;">getCachedTokenInternal</span>" method. <div>
<br /></div>
<div>
Typescript shows pass string in intelligence and if you are now aware about state then you will pass blank string like "" but it gives above error. </div>
<div>
<br /></div>
<div>
<h3 style="text-align: left;">
<span style="color: #0b5394;">Solution</span></h3>
<div>
Pass the state as "null" as below.</div>
<div>
<div>
<br /></div>
<div>
<div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<span style="color: blue;">var</span> token = <span style="color: blue;">super</span>.getCachedTokenInternal(scopes, <span style="color: blue;">this</span>.getAccount(), <span style="color: blue;">null</span>);</div>
</div>
</div>
</div>
<div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<br /></div>
<div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
For more refer git error explanation - <a class="js-issue-title css-truncate css-truncate-target link-gray-dark width-fit" href="https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/960#" rel="nofollow" style="background-color: initial; box-sizing: border-box; color: rgb(3, 102, 214) !important; display: inline !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; max-width: 150px; outline-width: 0px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; white-space: nowrap;" target="_blank">Invalid state Expected: null</a></div>
<div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<br /></div>
<div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<br /></div>
<div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
Thanks</div>
<div style="background-color: white; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<a href="https://www.qfles.com/" target="_blank"><b>QFLES</b></a></div>
<h1 class="d-flex text-bold f5" style="background-color: white; box-sizing: border-box; color: #24292e; display: flex !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px !important; margin: 0px;">
<div>
<br /></div>
</h1>
<div>
<br /></div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-91883967484099435642019-12-18T01:17:00.003-08:002020-05-21T08:30:37.298-07:00export 'ɵɵdefineInjectable' was not found in '@angular/core' Fixed<div dir="ltr" style="text-align: left;" trbidi="on"><b>
Error </b>- <span style="background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: large;">export 'ɵɵdefineInjectable' was not found in '@angular/core'</span><br />
<br /><b>
Root Cause</b> - when we inject the service at both places in service @Inectable({providedin:root}) and in module provider also , then we face this error.<br /><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div>
@Injectable({</div><div> providedIn: <span style="color: #a31515;">'root'</span></div><div>})</div><div>
<span style="color: blue;">export</span> <span style="color: blue;">class</span> NgxAuthService <span style="color: blue;">extends</span> UserAgentApplication {}</div><div><br /></div><div>and in module we are registering service in provider as below.</div><div><br /></div><div>providers: [</div><div style="line-height: 19px;"><div> { provide: MSAL_CONFIG, useValue: config }, NgxAuthService, </div><div><span> </span>{ provide: WindowWrapper, useValue: window }</div><div> ]</div></div></div><div dir="ltr" style="text-align: left;" trbidi="on"><br /></div><br /><b>
Solution </b>- replace above service class code as below.<br /><div style="background-color: white; font-family: consolas, "courier new", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div>
@Injectable()</div><div><span style="color: blue;">export</span> <span style="color: blue;">class</span> NgxAuthService <span style="color: blue;">extends</span> UserAgentApplication {</div>
</div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-42509023206034209182019-01-22T22:09:00.001-08:002019-01-22T22:09:47.812-08:00System.Net.Http.HttpClient' does not contain a definition for 'PostAsJsonAsync<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;">Error: 'System.Net.Http.</span><span style="background-color: white; color: #6a6a6a; font-family: "arial" , sans-serif; font-size: x-small; font-weight: bold;">HttpClient</span><span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;">' </span><span style="background-color: white; color: #6a6a6a; font-family: "arial" , sans-serif; font-size: x-small; font-weight: bold;">does not contain a definition for 'PostAsJsonAsync</span><span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;">' and </span><span style="background-color: white; color: #6a6a6a; font-family: "arial" , sans-serif; font-size: x-small; font-weight: bold;">no</span><span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;"> extension method '</span><span style="background-color: white; color: #6a6a6a; font-family: "arial" , sans-serif; font-size: x-small; font-weight: bold;">PostAsJsonAsync</span><span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;">' accepting a first argument of type 'System.Net.Http.</span><span style="background-color: white; color: #6a6a6a; font-family: "arial" , sans-serif; font-size: x-small; font-weight: bold;">HttpClient</span><span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;">' could be found</span><br />
<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;"><br /></span>
<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;"><br /></span>
<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;"><br /></span>
<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;">Solution: </span><br />
<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small;"><br /></span>
<br />
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
You need to add a reference to</div>
<pre class="lang-cs prettyprint prettyprinted" style="background-color: #eff0f1; border: 0px; box-sizing: inherit; color: #393318; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;"><code style="border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="typ" style="border: 0px; box-sizing: inherit; color: #2b91af; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">System</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="typ" style="border: 0px; box-sizing: inherit; color: #2b91af; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Net</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="typ" style="border: 0px; box-sizing: inherit; color: #2b91af; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Http</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="typ" style="border: 0px; box-sizing: inherit; color: #2b91af; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Formatting</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">dll</span></code></pre>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
This can be found in the extensions assemblies area.</div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
A good way of achieving this is by adding the NuGet package <code style="background-color: #eff0f1; border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 1px 5px; vertical-align: baseline; white-space: pre-wrap;">System.Net.Http.Formatting.Extension</code> to your project.<br />
<br />
<br />
Faced this problem in <a href="http://www.qfles.com/" target="_blank">QFLES</a></div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-74434327849893795532018-09-13T23:17:00.004-07:002018-09-13T23:17:50.275-07:00Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly " ". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. Azure Error<div dir="ltr" style="text-align: left;" trbidi="on">
I faced this problem during development of application <a href="https://www.qfles.com/">https://www.qfles.com</a><br />
<br />
Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "PageOne.Dependency". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\home\site\repository\QflesAdmin\QflesAdmin.csproj]<br />
<br />
<br />
<br />
This Error I was facing when I was deploying the Code to Azure from GitHub.<br />
<br />
Problem - Your Solution referring the dlls by HintPath like this.<br />
<br />
<Reference Include="PageOne.PD"><br />
<HintPath>..\PageOne.PD\bin\Debug\PageOne.PD.dll</HintPath><br />
</Reference><br />
<Reference Include="PageOne.Services"><br />
<HintPath>..\PageOne.Services\bin\Debug\PageOne.Services.dll</HintPath><br />
</Reference><br />
<br />
<br />
Solution - It should not refer the dlls by hint Path. It should be like this.<br />
<br />
<ItemGroup><br />
<ProjectReference Include="..\PageOne.Core\PageOne.Core.csproj"><br />
<Project>{8DA1814E-3E51-4A88-A5F7-80345A7A7841}</Project><br />
<Name>PageOne.Core</Name><br />
</ProjectReference><br />
<ProjectReference Include="..\PageOne.PD\PageOne.PD.csproj"><br />
<Project>{197492FB-2E97-4DB1-BCDB-83B6EBED3CE3}</Project><br />
<Name>PageOne.PD</Name><br />
</ProjectReference><br />
<ProjectReference Include="..\PageOne.Services\PageOne.Services.csproj"><br />
<Project>{BC08A2FB-F043-4CA9-8146-1647D7AECFFE}</Project><br />
<Name>PageOne.Services</Name><br />
</ProjectReference><br />
</ItemGroup><br />
<br />
Visual Studio do all these things automatically, do not add dlls manually to references. Use Auto resolve .<br />
<br />
<br />
Thanks</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-42941516419064986272018-09-03T01:02:00.003-07:002018-09-03T01:02:52.162-07:00Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property<div dir="ltr" style="text-align: left;" trbidi="on">
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property in DotNet with jquery or AngularJS.<br />
<br />
write your action method as below<br />
<br />
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>[HttpGet]
public ContentResult LoadBackDoorCustomers()
{
var data = adminService.ListBackDoorCustomers();
var json = JsonConvert.SerializeObject(data);
//return Json(new { success = true, data = json }, JsonRequestBehavior.AllowGet);
var result = new ContentResult
{
Content = json,
ContentType = "application/json"
};
return result;
}</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>
</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>
</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>
</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>angularjs Call</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>
</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>$scope.listBackDoorCustomers = function () {
$http({
method: 'GET',
url: '/Customer/LoadBackDoorCustomers',
dataType: 'json',
}).then(function (response) {
$scope.gridOptions.data = response.data;
}, function (error) {
});
}</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>
</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>
</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>web.config changes</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b>
</b></span></pre>
<pre class="csharp" style="background-color: white;"><span style="color: #0600ff; font-size: x-small;"><b> <system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647"/>
</webServices>
</scripting>
</system.web.extensions></b></span></pre>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-20248814191868400602018-07-12T02:43:00.003-07:002018-07-12T02:43:25.360-07:00ERR_CONNECTION_RESET - when you run application from visual studio over https<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 jsselect="heading" jstcache="5" jsvalues=".innerHTML:msg" style="background-color: #f7f7f7; color: #333333; font-family: "Segoe UI", Tahoma, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.25em; margin: 0px 0px 15px; word-wrap: break-word;">
This site can’t be reached</h1>
<div jsselect="summary" jstcache="2" jsvalues=".innerHTML:msg" style="background-color: #f7f7f7; color: #646464; display: inline; font-family: "Segoe UI", Tahoma, sans-serif; font-size: 15px;">
The connection was reset.</div>
<div id="suggestions-list" jsdisplay="(suggestionsSummaryList && suggestionsSummaryList.length)" jstcache="6" style="background-color: #f7f7f7; color: #646464; font-family: "Segoe UI", Tahoma, sans-serif; font-size: 15px;">
<div jstcache="13" jsvalues=".innerHTML:suggestionsSummaryListHeader" style="-webkit-margin-after: 0px;">
Try:</div>
<ul class="" jstcache="14" jsvalues=".className:suggestionsSummaryList.length == 1 ? 'single-suggestion' : ''" style="margin-top: 0px;">
<li jsinstance="0" jsselect="suggestionsSummaryList" jstcache="15" jsvalues=".innerHTML:summary">Checking the connection</li>
<li jsinstance="1" jsselect="suggestionsSummaryList" jstcache="15" jsvalues=".innerHTML:summary"><a href="chrome-error://chromewebdata/#buttons" jstcache="0" style="color: #1155cc; text-decoration-line: none;">Checking the proxy and the firewall</a></li>
<li jsinstance="*2" jsselect="suggestionsSummaryList" jstcache="15" jsvalues=".innerHTML:summary"><a href="https://www.blogger.com/u/2/null" id="diagnose-link" jstcache="0" style="color: #1155cc;">Running Windows Network Diagnostics</a></li>
</ul>
</div>
<span style="background-color: #f7f7f7; color: #646464; font-family: "Segoe UI", Tahoma, sans-serif; font-size: 15px;"></span><br />
<div class="error-code" jscontent="errorCode" jstcache="7" style="background-color: #f7f7f7; color: #646464; font-family: "Segoe UI", Tahoma, sans-serif; font-size: 0.8em; margin-top: 10px; text-transform: uppercase;">
ERR_CONNECTION_RESET</div>
<br /><br /><br />This error normally comes when local iis express certificate has corrupt. So please repair the IIS it will solve your Problem.<div>
<br /></div>
<div>
<a href="https://dotnetcodr.com/2015/09/18/how-to-enable-ssl-for-a-net-project-in-visual-studio/comment-page-1/#comment-106478" target="_blank">How-to-enable-ssl-for-a-net-project-in-visual-studio</a><br /><div>
<br /></div>
<div>
<a href="https://stackoverflow.com/questions/20036984/how-do-i-restore-a-missing-iis-express-ssl-certificate" target="_blank">How-do-i-restore-a-missing-iis-express-ssl-certificate</a></div>
</div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-41249891226192856322017-11-21T01:28:00.003-08:002021-04-09T17:57:58.326-07:00A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance<div dir="ltr" style="text-align: left;" trbidi="on">
Ok, this exception "A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance" can happen with NHibernate if you have an entity with a list of other entities with the .Cascade.AllDeleteOrphan() mapping.<br />
<br />
If you clear the list by assigning it a new List<entity>(), this exception will appear.<br />
<br />
Instead clear the list by using the .Clear() method.<br />
<br />
<br />
<br />
<br />
Error Code<br />
<br />
using( var session = _sessionManager.GetSession())<br />
using (var transaction = session.BeginTransaction())<br />
{<br />
<br />
var order = repository.GetOrderEagerlyByOrderId(session, fromDb.Id);<br />
var now = DateTime.Now;<br />
const string user = "GNB\\Username";<br />
var future = now.AddYears(1);<br />
var taxType = new TaxType(0, "Code", "AlternateNameE", "AlternateNameF", "NameE", "NameF", "DescriptionE", "DescriptionF", 13, now, future, user, now, user, now);<br />
var _serviceCatRep = new ServiceCatalogueRepository();<br />
<br />
var serviceCatalogueItem = _serviceCatRep.GetServiceCatalogueItemByCode(session, "VR-PASS");<br />
var orderLineItem1 = new OrderLineItem(0, null, "DescriptionE", "DescriptionF", 1, 10, null, null, 5, false, serviceCatalogueItem, null, user, now, user, future);<br />
<br />
order.OrderItems.Clear();<br />
<br />
order.OrderItems = order.OrderItems == null ? new List<IOrderLineItem> { orderLineItem1 } : new List<IOrderLineItem>(order.OrderItems) { orderLineItem1 };<br />
<br />
_repository.SaveOrUpdate(session, order);<br />
transaction.Commit();<br />
}<br />
<br />
Solution Code<br />
<br />
order.OrderItems.Clear();<br />
<br />
order.OrderItems = order.OrderItems == null<br />
? new List<IOrderLineItem> { orderLineItem1 }<br />
: new List<IOrderLineItem>(order.OrderItems) { orderLineItem1 };<br />
firstly if order.OrderItems is null then the order.OrderItems.Clear() will throw a NullReferenceException, secondly the problem is arising because you're assigning a new List to order.OrderItems so NHibernate doesn't know what to cascade the delete for. To get it to work, just change the second line to:<br />
<br />
order.OrderItems.Add(orderLineItem1);</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0tag:blogger.com,1999:blog-5487933816018956851.post-48917915501363187042017-06-20T01:00:00.002-07:002017-06-20T01:00:50.990-07:00Drop Down width increases automatically in IE 11<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="border: 0px; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Add the onmousedown attribute and have it focus on the select dropdown so that it loses focus from the input box. For some reason focus on the input before accessing that select causes this error.</div>
<div style="border: 0px; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; padding: 0px; vertical-align: baseline;">
<code style="background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 1px 5px; vertical-align: baseline; white-space: pre-wrap;"><select onmousedown="$(this).focus()"></code></div>
</div>
Bhanu Prataphttp://www.blogger.com/profile/17529341083467033319noreply@blogger.com0