Posts

Invalid state. ''bad, state expected : null. in msal Angular

When you are using MSAL in angular app you encounter this error "Invalid state. ''bad, state expected : null" while calling " getCachedTokenInternal " method.  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.  Solution Pass the state as "null" as below. var  token =  super .getCachedTokenInternal(scopes,  this .getAccount(),  null ); For more refer git error explanation - Invalid state Expected: null Thanks QFLES

export 'ɵɵdefineInjectable' was not found in '@angular/core' Fixed

Error -   export 'ɵɵdefineInjectable' was not found in '@angular/core' Root Cause - when we inject the service at both places in service @Inectable({providedin:root}) and in module provider also , then we face this error. @Injectable({   providedIn:  'root' }) export   class  NgxAuthService  extends  UserAgentApplication {} and in module we are registering service in provider as below. providers: [         { provide: MSAL_CONFIG, useValue: config }, NgxAuthService,       { provide: WindowWrapper, useValue: window }       ] Solution - replace above  service class code as below. @Injectable() export   class  NgxAuthService  extends  UserAgentApplication {

System.Net.Http.HttpClient' does not contain a definition for 'PostAsJsonAsync

Error: 'System.Net.Http. HttpClient '  does not contain a definition for 'PostAsJsonAsync ' and  no  extension method ' PostAsJsonAsync ' accepting a first argument of type 'System.Net.Http. HttpClient ' could be found Solution:  You need to add a reference to System . Net . Http . Formatting . dll This can be found in the extensions assemblies area. A good way of achieving this is by adding the NuGet package  System.Net.Http.Formatting.Extension  to your project. Faced this problem in  QFLES

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 " ". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. Azure Error

I faced this problem during development of application https://www.qfles.com 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] This Error I was facing when I was deploying the Code to Azure from GitHub. Problem - Your Solution referring the dlls by HintPath like this.  <Reference Include="PageOne.PD">       <HintPath>..\PageOne.PD\bin\Debug\PageOne.PD.dll</HintPath>     </Reference>     <Reference Include="PageOne.Services">       <HintPath>..\PageOne.Services\bin\Debug\PageOne.Services.dll</HintPath>     </Reference> Solution - It should not re...

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property

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. write your action method as below [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; } angularjs Call $scope.listBackDoorCustomers = function () { $http({ method: 'GET', url: '/Customer/LoadBackDoorCustomers', dataType: 'json', }).then(function (response) { $scope.gr...

ERR_CONNECTION_RESET - when you run application from visual studio over https

This site can’t be reached The connection was reset. Try: Checking the connection Checking the proxy and the firewall Running Windows Network Diagnostics ERR_CONNECTION_RESET This error normally comes when local iis express certificate has corrupt. So please repair the IIS it will solve your Problem. How-to-enable-ssl-for-a-net-project-in-visual-studio How-do-i-restore-a-missing-iis-express-ssl-certificate

A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance

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. If you clear the list by assigning it a new List<entity>(), this exception will appear. Instead clear the list by using the .Clear() method. Error Code using( var session = _sessionManager.GetSession())         using (var transaction = session.BeginTransaction())         {             var order = repository.GetOrderEagerlyByOrderId(session, fromDb.Id);             var now = DateTime.Now;             const string user = "GNB\\Username";             var future = now.AddYears(1);             var taxType = new TaxType(0, "Code", "Alterna...