-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StepModel.LoadStep21Header() and IfcStore.Open() interaction #578
Comments
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 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: