This project provides a user-friendly tool for automatically generating documentation for C# class libraries. It supports multiple output formats, including XML, HTML, and Markdown. By leveraging reflection and custom attributes, the tool extracts essential information such as method signatures, comments, summaries, and return values to create clear and informative documentation.
- Automatic Documentation Generation: Simplifies documentation creation without manual effort.
- Multiple Format Support: Choose from XML, HTML, and Markdown for the generated documentation.
- Customizable Output: Specify a custom file path for the generated documentation.
- User-Friendly Interface: Select the target assembly and save documentation with ease.
- Input Validation: Ensures valid class library (DLL) file paths.
- DocumentationAttribute Support: Enables method summaries and return values through a custom attribute.
- Error Handling: Handles invalid inputs and file operations gracefully.
- Reflection-Based Exploration: Dynamically navigates the class library structure.
- Compile the Project: Build the project using Visual Studio or .NET Framework tools.
- Run the Application: Launch the executable (.exe) file.
- Specify Assembly Path: Enter the full path to the target C# class library (DLL) file.
- Select File Format: Choose the desired file format for the generated documentation.
- Click "Generate" Button: Initiate the documentation generation process.
- Save Documentation: Choose a location and filename to save the generated Markdown file.
This project relies on a custom attribute named DocumentationAttribute
to provide summary and return value descriptions for methods. This attribute must be applied to methods in the target class library to enable documentation generation.
[AttributeUsage(AttributeTargets.Method)]
public class DocumentationAttribute : Attribute
{
public string Summary { get; set; }
public string Return { get; set; }
public DocumentationAttribute(string summary, string returnVal)
{
Summary = summary;
Return = returnVal;
}
}
public class MyClass
{
[Documentation("Calculates the sum of two numbers.", "The sum of the provided numbers.")]
public int Add(int a, int b)
{
return a + b;
}
}
- C# .NET Framework
- WinForms (Desktop Interface)
- Visual Studio (IDE)
You can also watch a demo of the Documentation Generator in action by clicking the link below: