wiki‎ > ‎Documentation‎ > ‎Knowledge Base‎ > ‎

JSC Compile Errors


Software is never good enough. There are ways to break JSC and it will report an error. Sometimes the simplest solution is to simplify your code. Other times this article should be consulted.


Guideline

For each report the following components should be given:
  1. Description
  2. A single source code block (eg. your .cs file).
  3. Command line used with jsc
  4. Expected result
  5. Workaround or explanation of the origin of the problem at hand

JSC cannot find shared Common Code from Class Library project

Description:
Compile error such as Class not Found, when sharing common code from DLL Class Library project with other platforms.

Solution: 
Follow instructions here: Sharing-common-Classes-Among-Platforms 


Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'WebDev.WebHost'

Description: 
Error when building Ultra project in a 64-bit system

Error:
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'WebDev.WebHost, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Solution:
To overcome this problem follow the instructions for 64-bit systems found here: 64-bit Systems

Calling ToString on struct

The jsc compiler cannot convert this code at the moment:

TimeSpan diff = (TimeSpan) (Event - DateTime.Now);
var innerText = diff.ToString();

The compiler will convert it to this which is not supported currently:

string innerText = diff.ToString() ?? "";

As a workaround use this:

var innerText = "" + diff;