Sitecore 9.2 Helix ,How to use Assets, SitecoreExtension and Dependency Injection that exist in foundation layer of habitat

0

I am beginner to development in sitecore using Helix Design Principle i started with blank project and added one feature in feature layer and one layout in project layer as in this image and it works fine.

my issue when i tried to use asset module for styling purpose that exists in foundation layer of habitat to my project, it told me that it needs Dependency Injection and Sitecore Extension

and when i try to load DependenyInjection inside my project , and deploy it with gulpfile as in this image,the sitecore gave me that error

Server Error in '/' Application.
Could not load file or assembly 'Sitecore.JavaScriptServices.AppServices, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Sitecore.JavaScriptServices.AppServices, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 187:            try
Line 188:            {
Line 189:                return assembly.GetExportedTypes();
Line 190:            }
Line 191:            catch (NotSupportedException)

Source File: D:\Ejada Files\NewsEjada - Copy - Copy\src\Foundation\DependencyInjection\code\ServiceCollectionExtensions.cs    Line: 189

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Sitecore.JavaScriptServices.AppServices, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:


[FileNotFoundException: Could not load file or assembly 'Sitecore.JavaScriptServices.AppServices, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
   System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) +0
   System.Reflection.RuntimeAssembly.GetExportedTypes() +32
   Sitecore.Foundation.DependencyInjection.ServiceCollectionExtensions.GetExportedTypes(Assembly assembly) in D:\Ejada Files\NewsEjada - Copy - Copy\src\Foundation\DependencyInjection\code\ServiceCollectionExtensions.cs:189

[InvalidOperationException: Unable to load types from assembly Sitecore.XA.JSS.Foundation.Integration, Version=5.9.0.0, Culture=neutral, PublicKeyToken=null. Could not load file or assembly 'Sitecore.JavaScriptServices.AppServices, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
   Sitecore.Foundation.DependencyInjection.ServiceCollectionExtensions.GetExportedTypes(Assembly assembly) in D:\Ejada Files\NewsEjada - Copy - Copy\src\Foundation\DependencyInjection\code\ServiceCollectionExtensions.cs:210
   System.Linq.<SelectManyIterator>d__17`2.MoveNext() +265
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +287
   System.Linq.WhereEnumerableIterator`1.MoveNext() +255
   Sitecore.Foundation.DependencyInjection.ServiceCollectionExtensions.AddClassesWithServiceAttribute(IServiceCollection serviceCollection, Assembly[] assemblies) in D:\Ejada Files\NewsEjada - Copy - Copy\src\Foundation\DependencyInjection\code\ServiceCollectionExtensions.cs:39
   Sitecore.Foundation.DependencyInjection.ServiceCollectionExtensions.AddClassesWithServiceAttribute(IServiceCollection serviceCollection, String[] assemblyFilters) in D:\Ejada Files\NewsEjada - Copy - Copy\src\Foundation\DependencyInjection\code\ServiceCollectionExtensions.cs:27
   Sitecore.Foundation.DependencyInjection.Infrastructure.MvcControllerServicesConfigurator.Configure(IServiceCollection serviceCollection) in D:\Ejada Files\NewsEjada - Copy - Copy\src\Foundation\DependencyInjection\code\Infrastructure\MvcControllerServicesConfigurator.cs:12
   Sitecore.DependencyInjection.BaseServicesConfiguratorFactory.Configure(IServiceCollection serviceCollection) +171
   Sitecore.DependencyInjection.BaseServicesConfiguratorFactory.Configure(IServiceCollection serviceCollection) +171
   Sitecore.DependencyInjection.BaseServiceProviderBuilder.ConfigureServiceCollection() +142
   Sitecore.DependencyInjection.ServiceLocator.ConfigureServiceProvider() +225
   Sitecore.DependencyInjection.ServiceLocator.get_ServiceProvider() +513
   Sitecore.DependencyInjection.SitecorePerRequestScopeModule..ctor() +13

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +142
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +107
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1476
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +186
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +234
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1153
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +139
   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): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724
sitecore
helix
sitecore-habitat
asked on Stack Overflow May 18, 2021 by mark youssef shohdy • edited May 18, 2021 by mark youssef shohdy

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0