Microsoft Dynamics GP Developing for Dynamics GP
A blog dedicated to the Microsoft Dynamics GP Developer & Consultant community
 
Welcome to MSDN Blogs Sign in | Join | Help

Developing for Dynamics GP

by David Musgrave (Australia) and the Microsoft Dynamics GP Developer Support Team (USA)

News

  • Please use the Blog Feedback? - Contact Us link at the top of the page to email questions relating to the blog itself.

    If you wish to ask a technical question, please use the links below to ask on the Newsgroups. If you ask on the Newsgroups, others in the community can respond and the answers are available for everyone in the future.

    Please do not use comments on pages and posts to ask questions unrelated to the topic on that page or post.



    Dates of Interest:

    11-Jul-2008: Blog Created by David Musgrave.
    10-Oct-2008: First Post by Scott Stephenson.
    04-Nov-2008: First Post by Dave Dusek.
    11-Nov-2008: First Post by Beth Gardner.
    28-Nov-2008: First Post by Chris Roehrich.
    30-Dec-2008: First Post by Patrick Roth.
    24-Feb-2009: First Post by Greg Willson.
    22-Apr-2009: First Post by David Clauson.
    04-May-2009: First Post by Ryan Wigestrand.
    19-Jun-2009: First Post by Dawn Langlie.
    03-Jul-2009: First Post by Emily Halvorson.
    23-Sep-2009: Created Twitter account with blog feed.
    20-Nov-2009: First Post by Alice Newsam.



    WorldMaps Statistics since
    24-Feb-2009:




    Click for WorldMaps Stumbler



    Translator Tool:




    Social Networking

    Follow David Musgrave and the blog on:

    David Musgrave on Twitter

    David Musgrave on LinkedIn


    Disclaimer

    This blog is provided "AS IS" with no warranties, and confers no rights.

    The links in this blog may lead to third-party Web sites. Microsoft provides third-party resources to help you find customer service and/or technical support resources. Information at these sites may change without notice. Microsoft is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.

Contents

Favourite Posts

Blog Links

Newsgroups Links

Resources Links

How to read your own config file with a VSTools Application

Dave DueskThis article is a result of a couple of recent support incidents where developers would like to read a config from from a Visual Studio Tools (VSTools) addin. VSTools is a special situation because for one, it is a dll, not an exe, and second it only runs if GP is running. VSTools can automatically access the dynamics.exe.config file, steps on how to do that are outlined in KB Article 933930 Secure Link.  The KB is for 9.0 and references the Dynamics.config file, but it also works for the Dynamics.exe.config on 10.0.

In this case, we don't want to use the dynamics.exe.config, we want to use our own config file. Since we are working with a dll, there is no automatic reading from config files like with an exe. Obviously, there is more than one way to handle this and there may be a better way.  This is just one way, that I know works, and it's not too difficult.

This article shows a method to use xml to read the data from a config file. The main VSTools project is called DynamicsGPAddin.dll.  

  1. The config file is named DynamicsGPAddin.dll.config and is deployed to the Addins folder in the main Microsoft Dynamics GP directory.  The config file contains the following information.  You can define this however you want, this just a sample config file.   
     
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <startup>
        <supportedRuntime version="v1.1.4444"/>
        <requiredRuntime version="v1.0.9999"/>
      </startup>
    </configuration>

     
  2. The name of the VSTools application is DynamicsGPAddin.dll and contains a form with a button and two text fields.  The button reads the config file and displays the data on the window fields.  In order for the code to execute, references to the following must be marked. 
     
    System.Configuration
    System.XML
     
  3. The button code is as follows:
C# Code Example 

Dave
MBS Dev Support 

Posted: Thursday, March 26, 2009 9:00 AM by Dave Dusek [MSFT]

Comments

David Musgrave said:

# March 29, 2009 8:49 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker