.NET The specified executable is not a valid application for this OS platform



  • Currently the library works as expected in my development mahcine (Windows 10 64 bits), but tried to move the project to a Windows 2008 R2 and i get : The specified executable is not a valid application for this OS platform

    Im using it as a utility in a .net 4.6.1 project



  • Hm. Not sure we can help with this.

    Is the windows server 64bit? The jsreport binary is compiled only for 64bits.
    Does node.js runs on that server? The jsreport binary is just differently compiled node.js



  • Yes, the server is 64 bits.
    Yes, node.js is intalled on the server

    I was trying to remove Crystal reports dependencies from a project via nuget and when i deploy it it seems that it cannot create the jsreport binary for some reason.
    If i deployed it without removing the crystal dependencies everything worked as expected (weird i know...)

    Anyway, i just manually removed the dependencies and just to be sure, changed the default TempDirectory to point to:
    Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "jsreport", "temp");
    and it seems to be working fine

    Just for the record:
    When render async is called (and you do not specify a TempDirectory in the configuration of the reporting service) it tries to create a jsreport folder inside the Windows/Temp folder (if the apppool identity in iss is the default one) or inside Users/XXXX/AppData/Temp and Windows/Temp (if the apppool identity is not the default one),
    this jsreport temp folder contains the binary, so if this problem happens be sure to check the size, it should be ~35mb AND NOT 0kb

    Note: other reason why this error could happen, is because one of its the depencies is not correctly set in a <dependentAssembly> tag. For example, jsreport.Client v2.0.2 uses System.Net.Http >= 4.3.2. If you have something like:
    <dependentAssembly>
    <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
    </dependentAssembly>

    inside your web.config or app.config, this error may arise. So, be sure to check that the dependencies are updated


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.