Breaking NetServer Core changes

lock
push_pin
done
Answered
4

OK, so we just published the first v10.2.1 (1517) nuget packages, as well as updated the WebApi packages! 

There are a few things to note about NetServer core. In addition to the services.RegisterWithNetServer (shown in the example project), you need to adapt to the following DI configuration changes.

Session Mode Changes

The config file setting for Session Mode has been removed.  This has been replaced with a session handling implementation to AddNetServerCore.

services.AddNetServerCore<SuperOffice.Web.Security.HttpContextProvider>(options =>
{
  //... set options
}

The session mode is an implementation of ISoContextProvider

public static IServiceCollection AddNetServerCore<TSessionMode>(this IServiceCollection services, Action<NetServerCoreOptionsBuilder> optionsAction = null) 
 where TSessionMode : class, ISoContextProvider
{
  //...
}

There are several default implementations of ISoContextProvider located in SoCore.

  • ThreadContextProvider
  • ContextContextProvider
  • ProcessContextProvider 

Another is HttpContextProvider, located in SuperOffice.DCFWeb.

Services Mode Changes

The Setting for Services Local or Remote NetServer mode has been removed from the Config.  This has been replaced with extension methods to IServiceCollection.

For Local mode calling Services Implementation, use:

  • services.AddDCFServicesImplementation();
  • services.AddServicesImplementation();
  • services.AddMessagingServicesImplementation();

For remote mode using proxies, use: 

  • services.AddServicesProxies();

Logging Changes 

Configuration of logging has been moved from NetServer to the application using NetServer.  SuperOffice NetServer now support logging in the appsettings.json file.

{
 "Logging": {
    "LogLevel": {
      "Default": "Error",
      "Microsoft": "Error",
      "SuperOffice": "Warning"
    }
  }
}

It is configured using the AddLogging extension method.

services.AddLogging(a =>
{
   a.AddConfiguration(configuration.GetSection("Logging"));
});

That's about all for now. Checkout the API release notes for more api changes in this release!

24 Jan 2023 | 10:22 AM

All Replies (4)

Hi Tony,

It looks like the 'SuperOffice.NetServer.Core' Nuget package does not pull in the latest 'SuperOffice.ContinuousDatabase'

24 Jan 2023 | 12:46 PM
Well that's not good. :-(
25 Jan 2023 | 07:51 AM

@David, pushed new set of packages for v10.2.1.1649, should be correct now. 

26 Jan 2023 | 08:42 AM

Hi, do you have a working example that uses services.AddServicesProxies()?

I'm trying to get one of our existing .net 4.8 Azure based webapps working with the new NuGet packages, using the HttpContextProvider.

16 Jun 2023 | 08:06 AM

@Frode, I manged to get an custom API that we have built (for onPremis though) - had some issue with sessions at the beging (only one api-call simultaneously) did use/alter some session manager code that I found on this forum. And after that implementation it has been running ok. 

If you do not get it to work reach out to me and I might be able to share some of my findings.(after 21/6, on vaccation currently)

Best regards

//Anders

17 Jun 2023 | 02:48 PM

Add reply