You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I found an issue when calling the StepModel.LoadStep21Header() method before the IfcStore.Open() method, the version affected is V5.1.274.
The following code throws the exception "System.InvalidOperationException: 'No service for type 'Xbim.IO.IModelProvider' has been registered.'" and is not correlated to which file is being read.
That's a reasonable workaround - and basically what we recommend in the readme / changelog.
This issue is that we have an internal IServiceProvider we try to set up for both internal configuration and 3rd party extensibility/configuration. This service provider is only designed to be built once, unfortunately what is happening is that calling StepModel.LoadStep21Header() triggers the provider in XbimServices to be constructed before IfcStore has had a chance to register things in its static initialiser.
I'm not altogether happy with the pattern we have (especially static initialisers, and the use of serviceLocator anti-pattern) but that's a bit forced on us due to some of the interfaces not being DI friendly without major breaking changes to the interface.
My thoughts are we should provide a fallback serviceProvider we use when the environment may not have been configured fully yet.
…back on when no services have been configured (either explicitly via XbimServices.ConfigureServices, or implicitly in static initialisers in IfcStore, GeometryEngine etc).
Updated Readme
Hello, I found an issue when calling the StepModel.LoadStep21Header() method before the IfcStore.Open() method, the version affected is V5.1.274.
The following code throws the exception "System.InvalidOperationException: 'No service for type 'Xbim.IO.IModelProvider' has been registered.'" and is not correlated to which file is being read.
As a workaround I found that is sufficient to add this at the start of the code:
and the exception is prevented.
Is this actually an issue or was I doing something wrong by using only the code in the first snippet?
The text was updated successfully, but these errors were encountered: