Sitecore 8.2 MVC를 설정하고 MVC 번들을 사용하여 모든 스크립트와 스타일을 기본 레이아웃으로 가져 오려고했습니다. 글로벌 파일이 더 이상 사용되지 않고 파이프 라인을 사용하여 불도저를 초기화해야하는 모범 사례 때문에 문제가 발생했습니다.Sitecore 8.2 MVC에서 MVC 번들을 사용할 수 없습니다.
BundleConfig.cs
using System.Web;
using System.Web.Optimization;
using Sitecore;
using Sitecore.Pipelines;
namespace MySite.Web.Pipelines
{
public class RegisterPlatformBundles
{
[UsedImplicitly]
public virtual void Process(PipelineArgs args)
{
RegisterBundles(BundleTable.Bundles);
}
private void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/bundles/styles").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
나는 설정 파일을 다음 따르며, 파이프 라인에 추가했습니다.
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<initialize>
<processor patch:before="processor[@type='Sitecore.Mvc.Pipelines.Loader.InitializeGlobalFilters, Sitecore.Mvc']"
type="MySite.Web.Pipelines.RegisterPlatformBundles, MySite" />
</initialize>
</pipelines>
</sitecore>
</configuration>
사이트를 실행하려고하면 다음과 같은 오류가 발생합니다. 이것을 설정하는 데 도움이되는 조언이나 올바른 경로만으로도 좋습니다. 감사.
Could not resolve type name: MySite.Web.Pipelines.RegisterPlatformBundles, MySite (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)). 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.Exception: Could not resolve type name: MySite.Web.Pipelines.RegisterPlatformBundles, MySite (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Exception: Could not resolve type name: MySite.Web.Pipelines.RegisterPlatformBundles, MySite (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).]
Sitecore.Diagnostics.Error.Raise(String error, String method) +137
Sitecore.Configuration.DefaultFactory.CreateType(XmlNode configNode, String[] parameters, Boolean assert) +308
Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +71
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +165
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) +68
Sitecore.Pipelines.CorePipelineFactory.GetObjectFromType(XmlNode processorNode) +91
Sitecore.Pipelines.CorePipelineFactory.GetProcessorObject(XmlNode processorNode) +145
Sitecore.Pipelines.CoreProcessor.GetMethod(Object[] parameters) +144
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +470
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +262
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343[HttpException (0x80004005): Could not resolve type name: MySite.Web.Pipelines.RegisterPlatformBundles, MySite (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731
이 [LINK (https://sitecore.stackexchange.com/questions/3434/is-there-something-in-sitecore-8-2-that-breaks을 참조하시기 바랍니다 -bundling) – Thennarasan