How to enable Visual Studio Tools Customisations for the Web Client
Have you ever written some cool Visual Studio Tools (VST) code that worked great on the desktop client, but does not work on the web client? VST code that does not use any WinForms or uses WinForms but only with supported controls and so should work?
Well, I have. A great example is the Company Login window customisations covered in the blog posts below:
- Customising the Company Login window series – Visual Studio Tools revisited – Visual C#
- Customising the Company Login window series – Visual Studio Tools revisited – Visual Basic .Net
The code worked fine on the desktop client, but had no effect in the web client. Something was missing, but I did not know what.
When I mentioned my problem to my good friend Mariano Gomez (The Dynamics GP Blogster), he knew what the issue was and sent me the link to an MSDN article.
The MSDN article below explains the details of what is required to make Visual Studio Tools customisations work on the web client.
In the code samples below you can see the added SupportedDexPlatforms attribute which is used to tell Visual Studio to make this code available for the desktop client and the web client. Without this additional attribute, the default behaviour would be to only work on the desktop client.
Visual C# code sample
namespace CSharpSample { [SupportedDexPlatforms(DexPlatforms.DesktopClient | DexPlatforms.WebClient)] public class GPAddIn : IDexterityAddIn { // IDexterityAddIn interface public void Initialize() { } } }
Visual Basic .Net code sample
<SupportedDexPlatforms(DexPlatforms.DesktopClient Or DexPlatforms.WebClient)> Public Class GPAddIn Implements IDexterityAddIn ' IDexterityAddIn interface Sub Initialize() Implements IDexterityAddIn.Initialize End Sub End Class
Hope you find this useful.
David
This article was originally posted on http://www.winthropdc.com/blog.
Filed under: Development, Dynamics, GP, Microsoft, Visual Studio Tagged: Best Practice, Development, Visual Basic .Net, Visual C#, Visual Studio

This was originally posted here.
*This post is locked for comments