[Solved] Unable to start - Castle.Windsor Error

Topics: Developer Forum, User Forum
Jun 27, 2008 at 9:32 AM
Hi,
   I am trying to start the TemplateSite example from either VS2008 for IIS7 (Vista Ultimate). I has it running for a while and then tried to play with the Layout Templates and screwed it.
So, I deleted everything and re-downloaded the release 1.4 and extracted it to try again. This time I got an error. If I refresh page I get a different error.

I cleared the Temporary Files / Temporary ASP.NET Files, rebooted, rubbed my tummy with one hand whilst patting my head with the other...on one leg...with my eyes shut and nothing seems to work!
I have the Castle Project installed...could it be a conflict?

The next two posts are the first and second error messages I received...

I'd appreciate a nudge in the right direction!

Thanks,
Gareth

Jun 27, 2008 at 9:33 AM
Edited Jun 27, 2008 at 9:35 AM
First Error - On Start...

[MissingMethodException: Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddFacility(System.String, Castle.MicroKernel.IFacility)'.]
   N2.Engine.ContentEngine.AddFacility(String key, Object facility) +0
   N2.Edit.Settings.SettingsInitializer.Initialize(IEngine engine) +78
   N2.Plugin.InitializerCreatingAttribute.Initialize(IEngine engine) +156
   N2.Plugin.PluginBootstrapper.InitializePlugins(IEngine engine, IEnumerable`1 plugins) +179

[PluginInitializationException: While initializing 10 plugin(s) threw an exception. Please review the stack trace to find out what went wrong.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddFacility(System.String, Castle.MicroKernel.IFacility)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type)'.

- Method not found: 'Castle.Windsor.IWindsorContainer Castle.Windsor.IWindsorContainer.AddComponent(System.String, System.Type)'.]
   N2.Plugin.PluginBootstrapper.InitializePlugins(IEngine engine, IEnumerable`1 plugins) +939
   N2.Engine.ContentEngine.Initialize() +138
   N2.Context.Initialize(Boolean forceRecreate) +149
   N2.Installation.InstallerModule.Init(HttpApplication application) +261
   System.Web.HttpApplication.InitModulesCommon() +65
   System.Web.HttpApplication.InitModules() +43
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289
Jun 27, 2008 at 9:33 AM
Edited Jun 27, 2008 at 9:36 AM

On refresh, after first error...

[ComponentNotFoundException: No component for supporting the service N2.Templates.Web.IPageModifierContainer was found]
   Castle.MicroKernel.DefaultKernel.get_Item(Type service) +138
   Castle.Windsor.WindsorContainer.Resolve(Type service) +40
   Castle.Windsor.WindsorContainer.Resolve() +84
   N2.Engine.ContentEngine.Resolve() +143
   N2.Templates.Web.UI.TemplatePage`1.OnPreInit(EventArgs e) +77
   System.Web.UI.Page.PerformPreInit() +31
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
Jun 27, 2008 at 11:53 AM
I have finally managed to fix this. I downloaded the Source release 1.4 and rebuilt the solution. I then copied the DLLs from N2.Templates.UI bin directory into the TemplateSite bin directory.
There were a few discrepancies with the file sizes.

It works perfectly now. I maybe mistaken, but I think the TemplateSite package needs republishing with the correct DLLs?

Kind Regards,
Gareth
Coordinator
Jun 29, 2008 at 10:06 AM
Do you remember which files didn't match?
Do you have the castle stack in the GAC (e.g. using CastleProject...msi)?
Jun 30, 2008 at 11:35 AM
Hi,
   I can't remember which files they were...I will try again later today if I get the time.
I did have CastleProject installed via the msi installer. It was version 1.0 RC3.

Incidentally, kudos for the development work on N2. It is simply fantastic. I have written a new layout and am now about to start tackling a Classified Ads module.

Kind Regards,
Gareth
Aug 9, 2008 at 5:17 PM
Hello!

I have the same problem as qbradley and I also have the Castle Project 1.0 RC3 installed from MSI.

I solved it the same way as qbradley for the TemplateSite package, but failed to solve the MVC package the same way..

Libardo, do you have any news regarding this..?

Thanks!

::m
Coordinator
Aug 9, 2008 at 6:07 PM
Hi, if I remember the castle.windsor.dll is copied into /bin from GAC during compilation or is loaded instead of the one in /bin.

Could you compare the the version numbers?

I think one solution would be removing it from the gac (gacutil /u ...) and overwriting the file with the one from the lib folder.