简体   繁体   中英

Service fabric upgrade failing due to change in namespace

I have a service fabric application stuck in "Upgrading" mode. The exception is:

Could not load type 'DB.IAddUser' from assembly 'DB' at WebApi.Startup.ConfigureServices(IServiceCollection services)

My change was that of renaming the name space, from 'DB' to 'DB.Interfaces'.

This class is only used as a constructor dependency, and registered as such

Startup.cs

services.AddSingleton<IAddUser, AddUser>();

UserController.cs

private IAddUser addUser;
public UserController(IAddUser addUser){
   this.addUser = addUser;
}

Why would this cause SF to get stuck?

Additionally, it only got stuck on the last upgrade domain, and not on the others.

I might be mistaken but if upgrade was successful on other upgrade domains then it is not code related issue.

Try to rollback the application upgrade and upgrade again: Start-ServiceFabricApplicationRollback -ApplicationName fabric:/MyApp

documentation

It turns out that this had nothing to do with service fabric (as expected and as @SteppingRazor said). The problem seems to be related to MSBuild/Azure devops build task, I had upgraded nuget package

Microsoft.VisualStudio.Azure.Fabric.MSBuild

from 1.6.7 to 1.6.8 and it seems that the build was still using older code (confirmed via a decompiler).

Reverting back to 1.6.7 solved the issue (albeit its just a workaround)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM