actually i tried it on another developer machine (i'm working on a desktop application) and installed the same jsreport.Local and Binary NuGet packages..
Posts made by giocarmine
-
RE: The specified executable is not a valid application for this OS platform
-
RE: The specified executable is not a valid application for this OS platform
I tried to run the same report on a machine without node.js installed and with windows defender disabled, i had the same issue.
I tried to delete the jsreport folder and run the project again several times but with the same result.. the extracted jsreport.exe is 0 bytes.Are we sure node.js is not a requirement for jsreport local?
-
RE: The specified executable is not a valid application for this OS platform
Awesome! it worked!
Anyway i had to give pemissions to node.js server when i run the project..
Now that i think about it, the first time i tried to run it before installing node.js, then i installed it and tried again.
I don't know if it is connected since you said node.js is not needed..but windows asking me to give permissions to it makes me a bit perplexed..Anyway, thank you for your advice and for the hard work on this tool!
-
RE: The specified executable is not a valid application for this OS platform
Thank you for the reply!
I double checked my Windows 10 installation is x64 :)
I found a jsreport.exe file in the temp folder located at
C:\Users\myuser\AppData\Local\Temp\jsreport\dotnet\binary-default-2.4.0.0
i'm not sure if it is the correct one.. i tried to run the exe, but i got the same error.. and then i noticed that the file size is 0!
-
The specified executable is not a valid application for this OS platform
Hello,
i'm looking for a suitable solution to generate some custom reports in a standalone desktop .NET application and jsreports seems a very nice one!
I've installed NodeJS (12.3.1) and i tried to create a sample project following this tutorial.
I think i'm missing something here, i installed the NuGet packages jsreport.Binary and jsreport.Local and i implemented the first example:
using System.IO; using System.Threading.Tasks; namespace ReportsTest { public class Program { static async Task Main(string[] args) { var rs = new LocalReporting() .UseBinary(JsReportBinary.GetBinary()) .AsUtility() .Create(); var report = await rs.RenderAsync(new RenderRequest { Template = new Template() { Recipe = Recipe.PhantomPdf, Engine = Engine.None, Content = "<style>h1 { color:red }</style><h1> Hello World! </h1>" } }); using (var fs = File.Create("out.pdf")) { report.Content.CopyTo(fs); } } } }
The project is a .NET Core 2.1 Console application.
When i try to run it i get the error "The specified executable is not a valid application for this OS platform"
NodeJs is in my Path and the exception doesn't specify which binary is it talking about, i can guess it is the jsreport executable in jsreport.Binary though..The full exception:
System.ComponentModel.Win32Exception HResult=0x80004005 Message=The specified executable is not a valid application for this OS platform. Source=System.Diagnostics.Process StackTrace: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at jsreport.Local.Internal.BinaryProcess.<InnerExecute>d__18.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at jsreport.Local.Internal.BinaryProcess.<ExecuteExe>d__17.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__10.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at ReportsTest.Program.<Main>d__0.MoveNext() in E:\Progetti\ReportsTest\ReportsTest\Program.cs:line 20 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ReportsTest.Program.<Main>(String[] args)
I tried to change the recipe to use ChromePDF but the result is the same..
I get this error if i run the project for "Any CPU" and "x64". I don't get any error if i run it for "x86", but no output file is generated..
Can anyone help me on this issue?
Thanks