I am trying to load an example from the MicroStation SDK examples; DimensionsExample. When I try to load the addin, I get the following error:
System.BadImageFormatException: Could not load file or assembly 'dimensionsexample' or one of its dependencies. The module was expected to contain an assembly manifest.
Does anyone know what is causing this error?
When I compile the code, I do get this message:
mt.exe -manifest C:\Users\LARRY~1.SMA\AppData\Local\Temp\Bentley\MicroStationSDK\objects\DimensionsExample.dll.Manifest -outputresource:"C:\PROGRA~1\Bentley\MICROS~1\MICROS~1\mdlapps\DimensionsExample.dll";2'mt.exe' is not recognized as an internal or external command,operable program or batch file.
I am running MicroStation Connect Edition Update 11 - Version 10.11.00.36, Windows 10 and MicroStation SDK version 10.11.0042.
Larry Smart said:When I compile the code
Do you build the example from the SDK shell?
Whenever there's a new release of the SDK, I build all the examples to check that everything is OK. I don't recall any problem with Update 11. You can use BuildAllExamples.bat in the SDK\examples folder.
Regards, Jon Summers LA Solutions
Jon, yes I did build the example from the SDK shell. This is the output from the build:
From your developer shell, you should be able to type: where mt.exe; and it should provide a path similar to:
e.g. C:\Program Files (x86)\Windows Kits\10\bin\x86\mt.exeAs my path above indicates, Microsoft Windows Kits 10 is where it is being resolved from. Can you confirm to see if the following Microsoft Visual Studio install options have been installed and let us know if this resolves the issue?
MicroStation CONNECT Edition Update 5 SDK (and later) based on Visual Studio 2015 has a couple additional Visual Studio installer features that are not enabled by default for C++ developers. :(
When installing or modifying your Microsoft Visual Studio 2015 install, make sure you have the following items checked/enabled for install:
Answer Verified By: Robert Hook
I had Visual C++ loaded but not the Windows 10 SDK. Now that it is loaded, the example program is working correctly.
Thanks for your help,
Glad to hear you are up and running.
In our next release announcement I will make sure to mention this development requirement introduced circa Update 5.
Also, we will be adding support for Microsoft Visual Studio 2017 (possibly as a default compiler) in the very near future possibly even as soon as the next SDK update release.