微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Sitecore 9.2 Helix,如何使用栖息地基础层中存在的资产、SitecoreExtension和依赖注入

如何解决Sitecore 9.2 Helix,如何使用栖息地基础层中存在的资产、SitecoreExtension和依赖注入

我是使用 Helix 设计原则在 sitecore 中进行开发的初学者 我从空白项目开始,在要素图层中添加一个要素,在项目图层 as in this image 添加一个布局,效果很好。

当我尝试将资产模块用于我的项目的栖息地基础层中存在的样式目的时的问题,它告诉我它需要依赖注入和 Sitecore 扩展

当我尝试在我的项目中加载 DependenyInjection 并使用 gulpfile as in this image 部署它时,sitecore 给了我这个错误

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,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,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,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,PublicKeyToken=null. Could not load file or assembly 'Sitecore.JavaScriptServices.AppServices,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,Object[] activationAttributes) +186
   System.Activator.CreateInstance(Type type,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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。