Hi Everybody,
I tried to following the online instruction (of the following link) to build a simple add-in using Visual Studio, but cannot it seems cannot be followed. Can you advice whether there is updated document? or whether I have made any mistake?communities.bentley.com/.../building-a-simple-add-in-application
I am trying in a Windows 11 system, I have these software packages installed: Microstation 2023, Microstation CONNECT 10.17.2.6.1, Microstation CONNECT Edition SDK 10.17.02.009, Visual Studio Enterprise 2017/2019/2022.
I first tried Visual Studio 2017. When following step 1 of the aforementioned page, after selecting File> New> Project, I couldn't find any Bentley/Microstation related options from the left hand side of the popup window (Screenshot added below). Hence, I couldn't follow the instruction to select Bentley > MicroStation > Connect Edition > MDL Command.
I then tried Visual Studio 2019 and 2022. In these newer versions of Visual Studio, the Create a New Project popup windows do not have the left panel for user to select C# on left hand side as instructed. I attempted to search for templates related to Bentley or Microstation, but still found nothing.
Can you help to check whether the aforementioned document has newer version somewhere for newer Microstation SDK package? or whether I have made any mistake when following it?
Thank you!
Hi,
my general advice is "Do not use Visual Studio wizards". I am aware it is in conflict with general recommendations (automate process using tools and wizards) and that it makes learning process a bit more complicated, but I think the wizards causes more troubles than are their benefits.
Because you mentioned "addin", I guess you are interested in C# (NET Framework in general) code. In such case, my recommendations are:
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
Thank you for your advice. Yes you are right, I am interested in using C# code.
For using the examples delivered with MicroStation CONNECT SDK, I found them at C:\Program Files\Bentley\MicroStationCONNECTSDK\examples
I have some questions:
1. If I find a Visual Studio solution inside (such as the WPFDemo solution), do I just need to open it by double clicking the *.sln file in Windows? Or I need to open the SDK Developer Shell first and run devenv command as the Youtube tutorial https://youtu.be/gjROBS4T1oo ?
2. I am studying to migrate a set of old MDL files that worked in V8i SS10 to the newer version of Microstation. The MDLs have a lot of UI in popup forms. Is WPF the only option to implement the popup forms if I use C#?
Sui
Answer Verified By: Sui Huang
Sui Huang said:do I just need to open it by double clicking the *.sln file in Windows? Or I need to open the SDK Developer Shell first and run devenv command
The second option is right: You should always start VS from development shell (and build own projects in the same way), because the shell defines useful variables, that are used in VS (and bmake) projects. In the case of C#, MS variable is typically used in referencing assemblies.
Sui Huang said:The MDLs have a lot of UI in popup forms. Is WPF the only option to implement the popup forms if I use C#?
When you want to stay with C# only,. WPF is the best way. WinForms can be used too, but it is old and obsolete technology.
Thank you Jan!