I had created this configuration application in Windows Form using reflection where I used a Windows Form having only one control (TabControl) and I was loading plugins (.dlls) in the blank application.
Below are the steps to create the Configuration App Solution.
Step 1

Add a Windows application project with the name "ConfigurationApplication" in the solution.

Add a class library project called “CommonModule.Lib".

Add a class library project called "ConnectDb.Lib".

Finally, the solution will look something like this.

- <?xml version="1.0" encoding="utf-8" ?>
- <Config>
- <Plugin key="SQLPlugin">DBConnect.LIB.dll</Plugin>
- </Config>
- namespace ConfigurationApp.COMMON
- {
- public interface IMenuPluginService
- {
- string PluginName { get; }
- TabPage ApplyMenuPlugin(TabPage tabMenuPlugin);
- UserControl UsrServiceControl { get; }
- }
- }
The next step is to add a UserControl called UserDBConnectControl where we are going to add the controls and the functionlty of the screen according to our usage. For my instance, I have created a SQL Server authentication screen. For reference, see the image below.

The next step is to add a class file called UserSQLControl.cs. In this class file, I have written the code to add the name of the Menu. Initialize the screen to the userControl and add the screen to the TabPage which will be loaded at run time by the TabControl which is there in the Configuration Application Windows project.
- using ConfigurationApp.COMMON;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace DBConnect.LIB
- {
- public class UserSQLControl : IMenuPluginService
- {
- UserControl _userDatabaseControl;
- public string PluginName
- {
- get
- {
- return "Connect SQL Server";
- }
- }
- public UserControl UsrServiceControl
- {
- get
- {
- if (_userDatabaseControl == null)
- {
- _userDatabaseControl = new UserDBConnectControl();
- }
- return _userDatabaseControl;
- }
- }
- public TabPage ApplyMenuPlugin(TabPage tabMenuPlugin)
- {
- tabMenuPlugin.Text = PluginName;
- tabMenuPlugin.Controls.Add(UsrServiceControl);
- return tabMenuPlugin;
- }
- }
- }
Join the conversation! Your thoughts help the community grow.