Continuing the discussion from Unit testing plug-in code with NUnit:
Hi Menno (and other rhino developers),
I am writing a Grasshpper plugin and am trying to use MS test (since i am useing VS express 2013 i’m pretty sure this is only integratable option). At first I was running tests and geting a “System.DLLNotFoundException” on rhcommon_c.dll. Following the instructions here i copyied over the files to the output folder of my unit test dll but now i get:
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
http://msdn.microsoft.com/en-us/library/k7137bfe(v=vs.90).aspx says that it could be a couple of things:
- a 32bit - 64 bit thing. I checked and all my .dlls are compling to “any cpu” so i think that is ok.
- “Make sure that you are not using a component that was created with a different version of the .NET Framework.” I am using .net 4.5.1 but the test .gha components i have created seem to work fine in Grasshopper itself so that doesn’t make sense to me.
- “Make sure that the file image is a valid managed assembly or module.” I know rhcommon_c is vaild becuase rhino won’t run without it. If it is becuase i’m not allowed to use unmanaged stuff in the environment i’m in then dosen’t RhinoCommon.dll insulate me from that?
Any suggestions would be greatly appreciated.