I've installed Newsletter Studio on an Umbraco 7.4.1 site and I'm getting an error when accessing the Newsletter Studio section and the tree is not rendering.
The error I'm getting is as follows:
I've checked trees.config and everything seems just fine there.
Does anyone know of a fix for this? Every other section are rendering just fine :-)
Yes, I'm 100% sure the config files are as they should be. I'm using the very latest version of Newsletter Studio.
Meanwhile, I've made a finding: in separate project, I'm hooking into the OnApplicationStarted event of Umbraco to register some custom controllers (my solution is all strongly typed) Now, if I remove that code, it works just fine, so it seems that AutoFac is disturbing the tree from rendering, somehow.
My OnApplicationStarted event looks like this:
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
// Using AutoFac nuget package for dependency injection
// Create a new containter builder
var builder = new ContainerBuilder();
// Register umbraco context, mvc controllers and api controllers
builder.Register(c => UmbracoContext.Current).AsSelf();
builder.RegisterControllers(Assembly.GetExecutingAssembly());
builder.RegisterApiControllers(typeof(UmbracoApplication).Assembly);
// Register MVC conrollers
builder.RegisterControllers(typeof(PortalController).Assembly);
builder.RegisterType(typeof(CycloneEntities)).InstancePerLifetimeScope(); // inject one Cyclone domain context per http request
// Build container
var container = builder.Build();
// Set resolver
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
// Custom MVC model binders
ModelBinders.Binders.Add(typeof(DateTime), new DateTimeModelBinder());
// Frontend bundling
#if !DEBUG
RegisterJavaScript(BundleTable.Bundles);
#endif
}
Are you using AutoFac aswell in your Newsletter Studio solution? :-) Seems like there's some kind of mismatch going on along the lines..
Tree is not rendering
Hi all,
First off: thanks for a great package! :-)
I've installed Newsletter Studio on an Umbraco 7.4.1 site and I'm getting an error when accessing the Newsletter Studio section and the tree is not rendering.
The error I'm getting is as follows:
I've checked trees.config and everything seems just fine there.
Does anyone know of a fix for this? Every other section are rendering just fine :-)
Thanks in advance.
Hi Bo!
Thanks for using the package! =D
What version of the package are you running?
Are you sure that there is no duplicates in the tree/application.config-files? I've seen some installs where this happens.
Cheers!
/ m
Hiya Markus,
Thanks a lot for the fast response :-)
Yes, I'm 100% sure the config files are as they should be. I'm using the very latest version of Newsletter Studio.
Meanwhile, I've made a finding: in separate project, I'm hooking into the OnApplicationStarted event of Umbraco to register some custom controllers (my solution is all strongly typed) Now, if I remove that code, it works just fine, so it seems that AutoFac is disturbing the tree from rendering, somehow.
My OnApplicationStarted event looks like this:
Are you using AutoFac aswell in your Newsletter Studio solution? :-) Seems like there's some kind of mismatch going on along the lines..
Thanks again!
.. and diggin' in further, this is the line that makes it not render the tree:
However, removing the line breaks all of my controllers since they're taking the
CycloneEntities
object as parameter in the constructor.Alright, found a solution!
I simply added this to the
OnApplicationStarted
event of Umbraco:Made it work right away :-)
Thanks for sharing! I also had some issues with DI after upgrading to 7.4.1 on a site without the newsletter-package.
// m
is working on a reply...