Skip to content
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

NRules Autofac integration package does not support Autofac 5.2.0 #238

Closed
wangadeketan opened this issue Sep 22, 2020 · 2 comments
Closed
Assignees
Milestone

Comments

@wangadeketan
Copy link

wangadeketan commented Sep 22, 2020

I am getting exception with the following code
var builder = new ContainerBuilder(); var types = builder.RegisterRules(x => x.AssemblyOf(typeof(DslExtensions))); builder.RegisterRepository(r => r.Load(x => x.From(types))); builder.RegisterSessionFactory() .OnActivating(e => new RulesEngineLogger(e.Instance)) .AutoActivate();
System.MissingMethodException: Method not found: 'Autofac.Builder.IRegistrationBuilder3<!0,!1,!2> Autofac.Builder.IRegistrationBuilder3.PropertiesAutowired(Autofac.PropertyWiringOptions)'.
at NRules.Integration.Autofac.RegistrationExtensions.RegisterSessionFactory(ContainerBuilder builder, Func`2 compileFunc)
at NRules.Integration.Autofac.RegistrationExtensions.RegisterSessionFactory(ContainerBuilder builder)

Packages:
Autofac = 5.2.0
NRules.Integration.Autofac = 0.9.0

@snikolayev
Copy link
Member

The latest build was integrated against Autofac 3.3.1. There were breaking changes in Autofac since then, that's why it breaks at run time. You can recompile NRules.Autofac.Integration against Autofac 5.2.0 from sources yourself as a workaround.
For the next NRules release I'll integrate against the latest Autofac.

@snikolayev snikolayev added this to the 0.9.1 milestone Sep 23, 2020
@snikolayev snikolayev reopened this Dec 1, 2020
@snikolayev snikolayev self-assigned this Dec 1, 2020
@snikolayev
Copy link
Member

Targeting netstandard 2.0 now in the integration package.
Upgraded to Autofac 4.0.0+ (tested with 4, 5 and 6).
Simplified rules and repository registration. The minimal registration example becomes:

var builder = new ContainerBuilder();
builder.RegisterRuleRepository(x => x.AssemblyOf<Program>());
builder.RegisterSessionFactory();

larrybehaviorlanguage added a commit to larrybehaviorlanguage/NRules that referenced this issue Jan 4, 2021
* bl-develop: (39 commits)
  Update year
  Update year
  Expression comparison to check parameter positions. Fixes NRules#246
  Code cleanup
  Improve quality of integration test assertions
  Use https in project URL
  Increment version
  Upgrade Sandcastle and fix docs build
  Add missing xml doc
  Revert "Remove msbuild from build tooling"
  Cleanup the sample
  Code cleanup
  Cleanup rules compilation method signatures
  Minor code cleanup
  Upgrade Moq and xunit
  Code cleanup - activation methods naming
  Convert default parameters to method overloads
  Fix Autofac integration. Closes NRules#238
  Cleanup samples
  Expose IMatch on the agenda-related events
  ...

# Conflicts:
#	src/NRules/NRules/Rete/JoinNode.cs. Caused by BoolObj addition to JoinNode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants