A quick tip for resolving this kind of issue
Symptoms:
As soon as the Cosmos build options window is dismissed after clicking the Build button, the system will pop-up a message box with the following error:
nasm: fatal: unable to open input file $CosmosDirectory$\build\Tools\asm\main.asm
(where $CosmosDirectory$ is the folder where Cosmos resides).
and in the "Warning & log" textbox like this:
System.Reflection.ReflectionTypeLoadException:Unable to load one or more of the requested type .Retrieve the LoaderExceptions property for more information.
at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at Indy.IL2CPU.Engine.LoadPlugAssembly(Assembly aAssemblyDef) in ...
at Indy.IL2CPU.Engine.InitializePlugs(IEnumeable'1 aPlugs) in ...
at Indy.Il2CPU.Engine.Execute(...) in ...
at Cosmos.Compiler.Builder.Builder.RunEngine(Object aParam) in ...
Looking into ReflectionTypeLoadException error list:
[0] System.TypeLoadException: Could not load type 'Indy.IL2CPU.VTable' from assembly 'Indy.IL2CPU Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983' because it contains an object field at offset 12 that is incorrectly alligned or overlapped by a non-object field
Causes:
By default, Visual Studio targets each project in the solution for "Any cpu" architectures. This sets the compiler target architecture in according to current CPU architecture. So, the build is hosted in a 64-bit process: currently, Cosmos is target only x86 architecture so it leads these mis-aligned errors.
Resolution:
Visual Studio must be forced to build for a x86 architecture. In order to make this possible, click on the combobox saying Any cpu and click on Configuration Manager.... In the Active solution platform combobox, select <New...> and sets on Type or select new platform: combobox as x86 and press Ok.
Enjoy!