Update from .NET 3.1 to .NET 5,app not working as before

moris27 51 Reputation points
2021-12-02T16:26:28.71+00:00

I recently migrated an Angular 12 +.NET Core 3.1 app to Net 5, I've changed target framework from 3.1 to 5, updated all packages to v5, no changes in code (front or back).

On Vps I've uninstalled net core hosting bundle 3.1 and installed v5+restart.

Since the upgrade some users complain that they can't use the app in Chrome browser: app is loaded bun when moving from a route to another it remains in loading screen. I can't access user phone to debug the problem, I made some test on 2 phones and seems fine. Users updated browser to latest version, clear cache/data, etc., no fix. One user installed a new browser (Petal) and seems the problem gone. In my desktop computer (Opera browser) I found couple times when app remains in load on first start with no error in console, I reloaded it with Shift+F5 and worked.

I don't know how to fix: to revert back to Net 3.1 or it is a browser problem?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,158 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,686 Reputation points
    2021-12-02T21:22:25.307+00:00

    as any hangs would be bugs in the angular code, not the webapi, it may be a timing issue of .net 5 having different performance characteristics.

    0 comments No comments

  2. moris27 51 Reputation points
    2021-12-04T10:20:10.507+00:00

    very hard to debug that problem as long there is no error on console,not occurs on develpment,only in production.for couple day I've reverted to .Net 3.1 and everything works fine
    If there is an angular code bug,why it works fine on 3.1?I used for both Angular 12.2.3

    There is nothing special in my code: I show a modal(ngx-modal) with fields for editing data

    <div class="modal-body">
      <div *ngIf="isLoading" class="d-flex justify-content-center p-5 m-5">  <!-- a loading spinner is shown wile got data from the server  -->
        <i class="fa fa-spinner fa-pulse fa-3x fa-fw ms-4"></i>
      </div>
    
    <div class="container-fluid" [hidden]="isLoading">
    .................
    
    
      constructor(private gService: GeneralService,....) { }
    
      ngOnInit() {
     this.gService.get('/api/operatins/' + this.op.ID).subscribe(o => {
              this.op = o.OP;
              this.isLoading = false;
               }
    ............
    }
    ....
    
    @Injectable()
    export class GeneralService {
      constructor(private _http: HttpClient, ....) { }
    
      get(url: string): Observable<any> {
        return this._http.get(url, this.getHeaders());
      }
    ......
      getHeaders(): any {
        return {
          headers: new HttpHeaders({
            'Content-Type': 'application/json'
          })
        };
    
      }
    

    the problem occurs often on Chrome browser(for Android),also, rarely, on my Win 10 home+Opera(v81)
    I'll delay the update, I will test soon on angular 13 too

    thanks

    0 comments No comments

  3. moris27 51 Reputation points
    2022-05-24T06:24:55.87+00:00

    today I've upgraded from .net 3.1 to .Net 6,but the same isuus: very often,on start,app remains in loading screen with no error in console,no request in network tab, If I reloaded it the works and I see requests in network tab.

    0 comments No comments