[CONNECT C#] Cannot load dll on Windows 10

Hi all,

I have some custom tools that are developed with C#. With appropriate compiler switches and configuartion I made the code running on both: 32bit Microstation v8i SS3 and 64bit Microstation CONNECT / AECOsim.

It works perfectly on my own developer machine and on my coworkers machines (they dont have Visual Studio or stuff installed) all with WIndows 7 and all with both versions of Microstation / AECOsim.

Now we got some new PCs with Windows 10. Somehow it is not possible to load the dlls into Microstation on that Windows 10 PC. I tried both: Keyin "mdl load ..." and browsing for dll via Mdl-Dialog.
As the workspace is the same, the configuartion is the same and, well, everything else is the same except Windows version I really have no idea what kind of error that could be. Microstation is not helping very much: it just gives me the usual "... could not be loaded".

Maybe someone has an idea where to search for errors? Or even HOW to search? I have no idea. I mean as it is running on the other systems it should not be useful to install Visual Studio on that Win10 machine to try to debug with Windows 10. Or maybe that would be useful indeed?

Regards
Stephan

Parents Reply Children
  • Sure. Inside the csproj files of Visual Studio I worked with lines like the following for the references. And when switching platforms from x86 to x64 inside Visual Studio the path to references were changed.

    <Reference Include="Bentley.General.1.0">
    <HintPath>..\Libs_$(Platform)\Bentley.General.1.0.dll</HintPath>
    <Private>False</Private>
    </Reference>



    Inside the code there were some places where I had to use lines like the following to change the platfrom dependend code. For example the usings:

    #if x64
        using Bentley.MstnPlatformNET;
    #else
        using Bentley.MicroStation;
    #endif


    Or another exmaple would be the Addin class:

    #if x64
        [AddIn(MdlTaskID = "Rahma")]
    #else
        [AddIn(KeyinTree = "Deadflower.Rahma.commands.xml", MdlTaskID = "Rahma")]
    #endif
    
        internal sealed class RahmaAddIn : AddIn
        {
            public static RahmaAddIn s_addin = null;
    
            private RahmaAddIn(System.IntPtr mdlDesc) :
                base(mdlDesc)
            {
                s_addin = this;
            }
    
            protected override int Run(string[] commandLine)
            {
                return 0;
            }
        }

    As stated above everything works pretty fine on my Windows 7 machine. Both.