Technically can a plugin be written in VB.Net?

I am a long time MW user along side my ArcGIS install. Migrating to MW5 has been slightly (OK, very) challenging. I wrote my first Plugin for 4.8.8 in VB - VS2005 way back in the day. Served us well for years. I have examined the Sample Template plugin you wrote in C# with the aim of migrating the functionality of our old dll to MW5. I was able to convert your sampledockwindow code to VB VS2019 (Net Framework 4.6). However, I can not get the dll to be recognized by MapWindow even though it compiled fine-- It is only a Test that adds 4 dummy buttons to the MW5 menu (which I successfully did in the Template example in C#). The DockWindow code was removed in my VB version, as I didn’t need it. Since VB and C# share the same CLR, I may have assumed this should work. If there is some reason why it does not, could you please explain? I can not really change this Company using VB.

I am having trouble with this specifically in InitPlugin C#: [MapWindowPlugin(loadOnStartUp: false)] to VB conversion: <MapWindowPlugin(loadOnStartUp:=False)> . The VB code fails with ‘Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement.’

After more experimenting I have lost hope that it can work in VB-- as soon as the “=” is added (by a code converter), VB IDE acts as if a value (false) is being assigned to a read only property and throws an error. And of course commenting out the statement results in Map Window unable to load and list it. I cannot see where the line can be written differently as I am new to this type of statement in VB. C# code works fine. I like how simple Map Window 5 Plugins are but it would be nice to assign and configure plugins right in Map Window itself as long as the dll is in the plugins directory.
Still would be nice to have confirmation or comment from any MW Team member, lol.

More Experimenting… fixed it with <MapWindowPlugin(False)> …Allowed it to be recognized as a Plugin but then Init Menu failed so still not loading. Stand by.

Ok, that is resolved, the VB Plugin loaded and created My Menu and Toolbar Buttons! So Answer to the Thread is yes it can be Written in VB.Net. Not sure if fleshing out the code will bare this out but I hope so.

Thank you ME! I’ve been invaluable.

1 Like