2

I am using DD4T 2.0 with Asp.Net MVC 5 Application. I have created a page without component presentation and the page data are rendered properly. Then i have added a component presentation to the page and when i try to access the page i am getting below error.

Server Error in '/' Application.

The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

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.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

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:

[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. ]
   System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) +766
   System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) +151
   System.Convert.FromBase64String(String s) +60
   DD4T.Serialization.Compressor.Decompress(String s) in C:\projects\dd4t-model\source\DD4T.Serialization\Compressor.cs:27
   DD4T.Serialization.SerializerServiceFactory.FindSerializerServiceForContent(String content) in C:\projects\dd4t-model\source\DD4T.Serialization\SerializerServiceFactory.cs:59
   DD4T.Factories.AutoDetectSerializerService.Deserialize(String input) in C:\projects\dd4t-core\source\DD4T.Factories\FactoryBase.cs:85
   DD4T.Factories.ComponentPresentationFactory.TryGetComponentPresentation(IComponentPresentation& cp, String componentUri, String templateUri) in C:\projects\dd4t-core\source\DD4T.Factories\ComponentPresentationFactory.cs:188
   DD4T.Factories.ComponentPresentationFactory.GetComponentPresentation(String componentUri, String templateUri) in C:\projects\dd4t-core\source\DD4T.Factories\ComponentPresentationFactory.cs:82
   DD4T.Factories.PageFactory.LoadComponentModelsFromComponentPresentationFactory(IPage page) in C:\projects\dd4t-core\source\DD4T.Factories\PageFactory.cs:356
   DD4T.Factories.PageFactory.GetIPageObject(String pageStringContent) in C:\projects\dd4t-core\source\DD4T.Factories\PageFactory.cs:277
   DD4T.Factories.PageFactory.TryFindPage(String url, IPage& page) in C:\projects\dd4t-core\source\DD4T.Factories\PageFactory.cs:104
   DD4T.Mvc.Controllers.TridionControllerBase.Page(String url) in C:\projects\dd4t-mvc\source\dd4t.mvc\controllers\TridionControllerBase.cs:32
   lambda_method(Closure , ControllerBase , Object[] ) +130
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +238
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +112
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +32
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +231
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +892
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +1292
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1303
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +2454
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +1088

Please help me to resolve the issue. Thanks.

1

This is a general Base64 format error. Refer to the MSDN Link for more information.

I am not sure, but you can check the component once which you are attaching in the page along with the template for any invalid character which is not supported by Base64 encoding.

The base 64 digits in ascending order from zero are the uppercase characters 'A' to 'Z', lowercase characters 'a' to 'z', numerals '0' to '9', and the symbols '+' and '/'. Check this link for the supported character list.

Let me know if this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.