Skip to content

barrersoftware/AMP-Visual-Studios-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AMP Visual Studio Plugin - .NET 8 Template

Visual Studio Marketplace License: MIT .NET 8 VS 2022

Professional Visual Studio extension providing a modern .NET 8 project template for CubeCoders AMP plugin development.

Extension Icon

🎯 Purpose

This extension updates the outdated .NET Framework 4.8 AMP plugin template to modern .NET 8, enabling developers to create AMP plugins using current technology and best practices.

✨ Features

  • βœ… Modern .NET 8 - SDK-style project format
  • βœ… C# 12 - Latest language features
  • βœ… Nullable Reference Types - Better null safety
  • βœ… Complete Example - Full PluginMain.cs implementation
  • βœ… Web Interface - Dark theme HTML/CSS/JS template
  • βœ… API Helpers - JavaScript functions for AMP API calls
  • βœ… Comprehensive Docs - README with examples and guides

πŸ“¦ What's Included

Template Structure

YourPlugin/
β”œβ”€β”€ YourPlugin.csproj          # .NET 8 SDK-style project
β”œβ”€β”€ PluginMain.cs              # Complete plugin implementation
β”œβ”€β”€ README.md                  # Project documentation
└── WebRoot/
    β”œβ”€β”€ Plugin.html            # Web interface
    β”œβ”€β”€ CSS/
    β”‚   └── Plugin.css         # Dark theme stylesheet
    └── Scripts/
        └── Plugin.js          # API helper functions

Code Features

  • Modern async/await patterns
  • Web API method examples with [WebMethod] attribute
  • Lifecycle management (Init/Shutdown)
  • IPC method support
  • Error handling examples
  • Full XML documentation

πŸš€ Installation

From Visual Studio Marketplace (Recommended)

  1. Open Visual Studio 2022
  2. Go to Extensions β†’ Manage Extensions
  3. Search for "AMP Plugin Template"
  4. Click Install
  5. Restart Visual Studio

Manual Installation

  1. Download AMPPluginTemplate.NET8.vsix
  2. Double-click the file
  3. Visual Studio will install the extension
  4. Restart Visual Studio

πŸ“ Usage

Create New Plugin

  1. Open Visual Studio 2022
  2. File β†’ New β†’ Project
  3. Search for "AMP Plugin"
  4. Select AMP Plugin (.NET 8)
  5. Enter your plugin name
  6. Click Create

Configure AMP Path

Before building, set your AMP installation directory:

Option A: Environment Variable

setx AMPINSTALLDIR "C:\Path\To\Your\AMP\Installation"

Option B: Edit .csproj

<Reference Include="ModuleShared">
  <HintPath>C:\Your\Path\ModuleShared.dll</HintPath>
  <Private>false</Private>
</Reference>

Build Your Plugin

dotnet build -c Release

Output: bin\Release\net8.0\

Deploy to AMP

Windows:

xcopy /E /I bin\Release\net8.0\* "%ProgramData%\CubeCoders\AMP\instances\[Instance]\Plugins\[YourPlugin]\"

Linux:

sudo -u amp cp -r bin/Release/net8.0/* /home/amp/.ampdata/instances/[Instance]/Plugins/[YourPlugin]/

Restart AMP:

ampinstmgr restart [InstanceName]

πŸ’» Example Code

Basic Plugin Structure

namespace MyPlugin;

public class PluginMain : AMPPlugin
{
    public override string DisplayName => "My Plugin";
    public override string Author => "Your Name";
    public override Guid PluginID => new Guid("12345678-1234-1234-1234-123456789abc");
    public override string PluginVersion => "1.0.0";
    public override bool HasWebRoot => true;
    
    public override void Init(IApplicationWrapper app, ProviderManifest manifest)
    {
        base.Init(app, manifest);
        Console.WriteLine("[MyPlugin] Loaded!");
    }
}

Web API Method

[WebMethod("Get server status", "status")]
public ActionResult GetStatus()
{
    return new ActionResult
    {
        Status = ActionStatus.OK,
        Result = new { success = true, uptime = TimeSpan.FromHours(24) }
    };
}

πŸ”„ Differences from Old Template

Feature Old Template (.NET 4.8) New Template (.NET 8)
Project Format Legacy .csproj SDK-style
Target Framework net48 net8.0
NuGet packages.config PackageReference
AssemblyInfo Separate file In .csproj
Nullable Types Disabled Enabled
C# Version 7.3 12.0
Build Tool msbuild dotnet CLI

πŸ“‹ Requirements

  • Visual Studio 2022 (17.0 or later)
  • .NET 8 SDK (Download)
  • CubeCoders AMP 2.5+ (runs on .NET 8)

πŸ› οΈ For Extension Development

Building the VSIX

cd /path/to/repo
zip -r AMPPluginTemplate.NET8.vsix extension.vsixmanifest [Content_Types].xml LICENSE.txt icon.png preview.png ProjectTemplates/AMPPluginTemplate.zip

Updating the Template

  1. Edit files in ProjectTemplates/
  2. Rebuild template ZIP:
cd ProjectTemplates
zip -r AMPPluginTemplate.zip *
  1. Rebuild VSIX (see above)
  2. Test in Visual Studio

Publishing to Marketplace

See MARKETPLACE_SETUP_GUIDE.md for detailed instructions.

πŸ“š Documentation

🀝 Contributing

Contributions are welcome! Please:

  1. Fork this repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ› Issues & Support

πŸ“„ License

This project is licensed under the MIT License - see LICENSE.txt for details.

Important Notes

  • This is an independent community contribution
  • Not officially endorsed by CubeCoders Limited
  • AMP is a trademark of CubeCoders Limited
  • Template designed for use with AMP software
  • No affiliation or warranty implied

πŸ™ Credits

Created by: Barrer Software
With assistance from: GitHub Copilot CLI
For: CubeCoders AMP community
Icon Design: Modern shield (Windows Defender inspired)

πŸ“Š Project Stats

  • Extension Size: 21 KB
  • Template Files: 8 files
  • Code Examples: Complete plugin with web interface
  • Documentation: Comprehensive guides included
  • License: MIT (free and open source)

πŸ”— Links

πŸ“… Version History

v2.0.1 (2025-10-21)

  • βœ… Modern shield icon (Windows Defender style)
  • βœ… Professional appearance
  • βœ… Updated preview images

v2.0.0 (2025-10-21)

  • βœ… Initial release
  • βœ… .NET 8 support
  • βœ… SDK-style project format
  • βœ… Complete example plugin
  • βœ… Web interface template
  • βœ… Comprehensive documentation

Made with ❀️ for the AMP community

Helping developers create modern AMP plugins with .NET 8

About

Visual Studio extension providing modern .NET 8 project template for CubeCoders AMP plugin development

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •