I have a C# utility which talks to MicroStation using the COM Interop layer. It has a reference to the primary interop assembly (bentley.interop.microstationdgn.dll) which resides in MicrosStation installation directory.
Now I wonder what should I do when I want to send it ver my users, which have different versions of MicroStation or PowerDraft?
Should I include my copy of the interop dll in the distribution, or it must use the version that is installed on the target computer?
Can I hope a program compiled with the dll from V8 XM would also work with V8i?
And finally does anyone know what if it legal to redistribute the interop dll? Microsoft's PIA packs have a special license attached, but I could not find anything similar for Bentley's ones.
Have I missed something?
/Elias
If you access assemblies inside MicroStation / PowerDraft from internal application such as .Net Addin, then you don't have to think about it since MicroStation registers search paths for those on load. Problems comes out, if you want use MicroStation from outside, because its assemblies are not in GAC by default, but at installtime of your application you can add them into it by placing MicroStation's Assemblies directory to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders registry key...
HTH
argh, this would be very confusing at a machine such as mine with at least 5 different versions of MicroStation/Powerdraft/View installed !!!
In worst case it might lead MicroStation to no longer work or the application crashing when trying to access the assembly registered in the GAC from a version that has another build. This is just like deploying the assemblies (just without thinking about the copyright thing).
Michael
Edit: If you ever tried to provide a Addon for MS Office you will know what late binding means. The application has different function calls between for example 2000 and 2003 you have to 'if' them out. Maybe that is a proper way to access the correct MicroStation object.
But Microsoft tells us that .NET was designed to avoid DLL hell!
Regards, Jon Summers LA Solutions
Unknown said: argh, this would be very confusing at a machine such as mine with at least 5 different versions of MicroStation/Powerdraft/View installed !!! In worst case it might lead MicroStation to no longer work or the application crashing when trying to access the assembly registered in the GAC from a version that has another build. This is just like deploying the assemblies (just without thinking about the copyright thing). Michael Edit: If you ever tried to provide a Addon for MS Office you will know what late binding means. The application has different function calls between for example 2000 and 2003 you have to 'if' them out. Maybe that is a proper way to access the correct MicroStation object.
You are right, but this is versioning good for. MicroStation knows well what assemblies it needs and loads them when it needs them. Late binding and Reflection are needed in MicroStation Addins as well if you need to handle for example .NET Dockable system by one assembly in both major versions of MicroStation that support it.