- Code: Select all
ppt.SaveToFile(request.Profile.ProfileName + "_Profile_Export.pptx", FileFormat.Pptx2013);
then I receive a System.NullReferenceException
This error is bubbled up from within Spire package. Please note that when I look in to the directory location, I can see the PPT created. Yet the exception is thrown.
The stack trace is as follows:
- Code: Select all
System.NullReferenceException:
at spr⚯..ctor (Spire.Pdf, Version=7.8.9.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr⚯..ctor (Spire.Pdf, Version=7.8.9.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᬊ..ctor (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᬊ..ctor (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr᪼.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝇ.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝇ.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝇ.ᜁ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝇ.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝇ.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝇ.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝇ..ctor (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝧ.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝎ.ᜌ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at Spire.Presentation.Collections.ShapeList.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at Spire.Presentation.GroupShape.PptxPrepareForSaving (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at Spire.Presentation.ActiveSlide.PresentationBeforeSave (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at sprᝠ.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr.ᜀ (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at Spire.Presentation.Presentation.SaveToFile (Spire.Presentation, Version=6.8.5.0, Culture=neutral, PublicKeyToken=663f351905198cb3)
at xxxExport.Controllers.ExportController.ExportxxxProfile (xxxExport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
at lambda_method (Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+SyncActionResultExecutor.Execute (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeActionMethodAsync>g__Logged|12_1>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeNextActionFilterAsync>g__Awaited|10_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeFilterPipelineAsync>g__Awaited|19_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeAsync>g__Logged|17_1>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Routing.EndpointMiddleware+<<Invoke>g__AwaitRequestTask|6_0>d.MoveNext (Microsoft.AspNetCore.Routing, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware+<Invoke>d__5.MoveNext (Microsoft.AspNetCore.Authorization.Policy, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1+<ProcessRequestAsync>d__2.MoveNext (Microsoft.AspNetCore.Server.IIS, Version=3.1.26.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)