Hi, my code looks like this:
The error happens at _rasterizer.Open(ms).
This happens only when I'm using .net 4.5.
Both ghostscript and windows is x64.
The whole error :
MemoryStream ms = new MemoryStream(bytes);
if (_rasterizer != null)
{
_rasterizer.Dispose();
}
_rasterizer = new GhostscriptRasterizer();
_rasterizer.Open(ms);
Pretty much like the sample codeThe error happens at _rasterizer.Open(ms).
This happens only when I'm using .net 4.5.
Both ghostscript and windows is x64.
The whole error :
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Ghostscript.NET
StackTrace:
at Ghostscript.NET.Interpreter.GhostscriptInterpreter.InitArgs(String[] args)
at Ghostscript.NET.Viewer.GhostscriptViewer.Open()
at Ghostscript.NET.Viewer.GhostscriptViewer.Open(String path, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
at Ghostscript.NET.Viewer.GhostscriptViewer.Open(Stream stream, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
at Ghostscript.NET.Rasterizer.GhostscriptRasterizer.Open(MemoryStream stream, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
at LightSwitchApplication.ApplicationDataService.BøgerSet_Updated(Bøger entity)
at LightSwitchApplication.ApplicationDataService.DetailsClass.__BøgerSet_Updated(ApplicationDataService d, Bøger e)
at Microsoft.LightSwitch.Details.Framework.Server.EntitySetEntry`2.Microsoft.LightSwitch.Details.Framework.Server.IEntitySetEntry.InvokeUpdated(IDataService dataService, IEntityObject entity)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.<>c__DisplayClass61.<PerformPostEvent>b__5c(IEntitySetEntry entitySetEntry)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.<>c__DisplayClass43.<CallPrePostUserCode>b__42()
at Microsoft.LightSwitch.Utilities.Internal.UserCodeHelper.CallUserCode(Type sourceType, String methodName, String instance, String operation, ILoggingContext context, Action action, String additionalText, Func`1 getCompletedMessage, Boolean tryHandleException, Boolean swallowException, Exception& exception)
InnerException: