
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
[code language=”csharp”]namespace CSharpSample
{
[SupportedDexPlatforms(DexPlatforms.DesktopClient | DexPlatforms.WebClient)]
public class GPAddIn : IDexterityAddIn
{
// IDexterityAddIn interface
public void Initialize()
{
}
}
}
[/code]
Visual Basic .Net code sample
[code language=”vb”]<SupportedDexPlatforms(DexPlatforms.DesktopClient Or DexPlatforms.WebClient)>
Public Class GPAddIn
Implements IDexterityAddIn
‘ IDexterityAddIn interface
Sub Initialize() Implements IDexterityAddIn.Initialize
End Sub
End Class
[/code]
Hope you find this useful.
David
This article was originally posted on http://www.winthropdc.com/blog.
This starts to look interesting and make me thing of taping back into coding, which is where I started my IT career many years ago when learning Cobol 🙂