Hello dear Rhino forum.
I am trying to create a simple console app (before I’ll jump to excel), where I will learn how to use RhinoInside. I creata a project according to the sample files on GIT HUB but I get exception error. Unfortunatelly, I am not able to find out where is the problem.
My code is very simple (see below) and I get this exception (in czech):
System.TypeInitializationException: 'Inicializační metoda typu ConsoleApp1.Program vyvolala výjimku.'
Inner Exception:
BadImageFormatException: Nelze načíst soubor nebo sestavení RhinoInside, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null nebo jeden z jejich závislých prvků. Byl učiněn pokus načíst program v nesprávném formátu.
I also found out that all referenced libraries and packages are marked with processorArchitercuture = MSIL but RhinoInside is AMD64. RhinoInside was installed via NuGet package.
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
using System.Text;
using System.Threading;
using Rhino.Runtime.InProcess;
namespace ConsoleApp1
{
class Program
{
static Program()
{
RhinoInside.Resolver.Initialize();
}
static void Main(string[] args)
{
System.IO.Directory.SetCurrentDirectory(RhinoInside.Resolver.RhinoSystemDirectory);
Rhino.Runtime.InProcess.RhinoCore m_rhino_core = new Rhino.Runtime.InProcess.RhinoCore(new[] {"/NOSPLASH" }, WindowStyle.Hidden);
}
}
}
Thank you for your reply.
Ondřej