Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Proper way of building VS Addins for different GP versions?

(0) ShareShare
ReportReport
Posted on by 1,584

I’m largely self-taught in many areas of development with trial and error. Do you know if one can, when creating a new Dynamics GP Addin project in VS, select which version of GP you want to create for? When installing the SDK for VS Tools it installs templates for current and past versions, but I only see one selection in the New Project dialog. I have always just created a new project and then removed the references to the GP libraries and added references to the libraries for the version I'm working on. 

*This post is locked for comments

  • chadbruels Profile Picture
    chadbruels 1,584 on at
    RE: Proper way of building VS Addins for different GP versions?

    Andrew, thank you for your help, as always. You are a wonderful member of the GP community.

    Tim, thank you for that excellent response. I cannot say I understand all the techniques you describe. I do use a Files folder in my projects where I add the DLLs I am referencing so they are stored in TFS. I have often retrieved projects from other developers where this is not done and I must hunt down references to appropriate DLLs. I wish I could sit as an apprentice of both you and Andrew. By the way, just yesterday I arrived at your blog to resolve a client's error with exporting SmartLists to Excel and I utilized your udf_ContainsNonASCIIChars function. Thank you very much!

  • Tim Wappat Profile Picture
    Tim Wappat 5,703 on at
    RE: Proper way of building VS Addins for different GP versions?

    Andrew is correct, I would add the following to help though...

    1. Try to keep references concentrated as much as possible in the main Add-in project and perhaps another library, and write all the other projects as class library projects, to be version agnostic. Using partial classes, extension methods and other object orientated techniques can help here. Effectively you are creating "an interface project" - each targeting a GP version.
    2. If you get into using version control using Team Foundation Server or Git (free) you can keep the versions on different branches within version control system and merge each set of changes between branches. Try to keep code doing complicated stuff out of these classes as much as possible to minimise the work involved in those merges. 
    3. I keep "lib" or "dependencies" folder with a copy of all the referenced dlls and reference to them in there. Reference those not the "program files" version, so that you can transfer the project to other (developer's) machine(s). This also ensures these vital dlls and resources get put into source control for later retrieval many years later when you need to fix something on that version.

    The above does not help when creating the project, and does mean you still have overhead of managing versions in source control, but keeps things tidy, comprehensible and robust.

     

  • Verified answer
    Andrew John Dean Profile Picture
    Andrew John Dean 1,337 on at
    RE: Proper way of building VS Addins for different GP versions?

    Hi Chad.

    The way you are creating new projects for different GP versions seems to be the only way it is currently possible. I tried to get tricky a couple of years back by attempting to reference the Dynamics libraries at runtime using .NET reflection (rather than referencing them in the VS project).  I was hoping that by putting a value in the application config file, I would be able to make my addin apps version independent. Unfortunately this did not work. The app compiled, the library could be loaded in at runtime, but when I called a Dynamics library method, GP would crash. 

    If anyone else has tried something similar and succeeded, would love to hear about it.

     

    Regards

    Andrew Dean 

    Outlook signature

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans