Not able to rebuild models
dev810vm opened this issue · 10 comments
Hi @dev810vm,
If this is a brand new setup of Synthesis, I'd recommend using Leprechaun for code generation. It's built to work with Synthesis and it is a lot more efficient and easy to work with. Synthesis code generation is flagged for deprecation and will be phased out eventually.
As for how to setup Synthesis code generation, you do need to setup some configuration registrars in order to identify modules. Have you run though the I'm using modular architecture. Will Synthesis support models across projects? section of the readme? That section has a link to the Example Habitat Configuration that shows how those registrars should work (NOTE: a config registrar should NOT be an abstract
class.)
Thanks,
Ben
Hi Ben, I did add a class to our project that implements the SynthesisConfigurationRegistration class. I then added a new patch file adding our assembly to the initialize pipeline but it's still telling me that no model configurations are registered. For the 8.2 instance of Sitecore I believe this was all being controlled through the configs, are all of the steps necessary for a single dll? Thanks, Jim
If your solution is that simple, then you probably don't need a registrar.
The old way of using the <templateInputProvider>
via the Synthesis.LocalConfig.config.example file should be all you need.
Have you tried that?
Yes, that's what I tried first. I see the settings in showconfig but the synthesis.aspx page still says that there's nothing registered.
Ok, So I upgraded to the 9.1.0.2 version and now it looks like it's trying to do a sync. But i'm getting the following error.
Could not load type 'Sitecore.UsedImplicitlyAttribute' from assembly 'Sitecore.Kernel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=null'.
[TypeLoadException: Could not load type 'Sitecore.UsedImplicitlyAttribute' from assembly 'Sitecore.Kernel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=null'.]
System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +197
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +166
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +156
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +612
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +209
Synthesis.Utility.TypeCollectionUtility.WithAttribute(IEnumerable1 types) +210 Synthesis.Synchronization.SynchronizationEngine.get_ModelDictionary() +94 Synthesis.Synchronization.SynchronizationEngine.IsTemplateSynchronized(ITemplateInfo template) +61 Synthesis.Synchronization.SynchronizationEngine.AreTemplatesSynchronized() +281 Synthesis.<>c__DisplayClass1_0.<CheckSyncAll>b__0(IProviderConfiguration configuration, TemplateGenerationMetadata metadata) +62 Synthesis.SynthesisHelper.ExecMetadataWithAutoFriending(IEnumerable
1 configurations, Action`2 processAction) +523
Synthesis.SynthesisHelper.CheckSyncAll() +186
Synthesis.Pipelines.Initialize.CheckModelSynchronization.DoLogSync() +44
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +220
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +1165
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +584
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369
[HttpException (0x80004005): Could not load type 'Sitecore.UsedImplicitlyAttribute' from assembly 'Sitecore.Kernel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=null'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724
9.3 initial
Can you check your codebase for UsedImplicitly
and see if that appears anywhere? Can you also make sure that you don't have any DLLs from older versions of Sitecore in your bin directory?
Yep, There was an old Sitecore dll in the bin. Thanks for all your help! One last question, does the 9.1.0.2 version work with Sitecore 10 or are there plans to support it? Thanks again.
Synthesis 9.1.0.2 has been tested with Sitecore 10 and does work. However, I would recommend switching to Leprechaun for model generation. The model generation portion of Synthesis hasn't been tested with Sitecore 10 because that part of the code is being phased out. It should still work, however.