diff --git a/Directory.Build.props b/Directory.Build.props
index 16477fa..a670ccb 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,6 +1,7 @@
net7.0
+ latest
enable
disable
True
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1d3e922..263eda4 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -5,6 +5,11 @@
+
+
+
+
+
@@ -12,4 +17,4 @@
-
+
\ No newline at end of file
diff --git a/samples/CPlugin.Net.Examples.sln b/samples/CPlugin.Net.Examples.sln
new file mode 100644
index 0000000..4f011d6
--- /dev/null
+++ b/samples/CPlugin.Net.Examples.sln
@@ -0,0 +1,74 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.7.34024.191
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPlugin.Net.Attributes", "..\src\Attributes\CPlugin.Net.Attributes.csproj", "{D9737294-F5EA-4EA0-8BF2-2BF5C3954DD9}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPlugin.Net", "..\src\Core\CPlugin.Net.csproj", "{116B353F-FC68-4412-8A2D-34DA0BE88060}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contracts", "Contracts\Contracts.csproj", "{BBDE7F3C-2A41-40B6-B609-839D09676D0E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "HostApplications\ConsoleApp\ConsoleApp.csproj", "{3E943746-09CD-430E-9BBF-67DBBF9F5CEF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi", "HostApplications\WebApi\WebApi.csproj", "{C221B4F0-857F-4380-B5AD-E4B2BBA65622}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonPlugin", "Plugins\JsonPlugin\JsonPlugin.csproj", "{C5B8EF73-7DB5-441F-AE38-0988751A896B}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OldJsonPlugin", "Plugins\OldJsonPlugin\OldJsonPlugin.csproj", "{1ADE3B86-00EF-4976-8B67-09B360B149FA}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppointmentPlugin", "Plugins\AppointmentPlugin\AppointmentPlugin.csproj", "{2832E5C3-660E-49B9-8E62-03B11A8CC6D7}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DA150C23-F1A9-42CF-899C-6C4E6B940E72}"
+ ProjectSection(SolutionItems) = preProject
+ ..\Directory.Build.props = ..\Directory.Build.props
+ Plugins\Directory.Build.props = Plugins\Directory.Build.props
+ ..\Directory.Packages.props = ..\Directory.Packages.props
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D9737294-F5EA-4EA0-8BF2-2BF5C3954DD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D9737294-F5EA-4EA0-8BF2-2BF5C3954DD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D9737294-F5EA-4EA0-8BF2-2BF5C3954DD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D9737294-F5EA-4EA0-8BF2-2BF5C3954DD9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BBDE7F3C-2A41-40B6-B609-839D09676D0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BBDE7F3C-2A41-40B6-B609-839D09676D0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BBDE7F3C-2A41-40B6-B609-839D09676D0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BBDE7F3C-2A41-40B6-B609-839D09676D0E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3E943746-09CD-430E-9BBF-67DBBF9F5CEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3E943746-09CD-430E-9BBF-67DBBF9F5CEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3E943746-09CD-430E-9BBF-67DBBF9F5CEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3E943746-09CD-430E-9BBF-67DBBF9F5CEF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C221B4F0-857F-4380-B5AD-E4B2BBA65622}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C221B4F0-857F-4380-B5AD-E4B2BBA65622}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C221B4F0-857F-4380-B5AD-E4B2BBA65622}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C221B4F0-857F-4380-B5AD-E4B2BBA65622}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C5B8EF73-7DB5-441F-AE38-0988751A896B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C5B8EF73-7DB5-441F-AE38-0988751A896B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C5B8EF73-7DB5-441F-AE38-0988751A896B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C5B8EF73-7DB5-441F-AE38-0988751A896B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1ADE3B86-00EF-4976-8B67-09B360B149FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1ADE3B86-00EF-4976-8B67-09B360B149FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1ADE3B86-00EF-4976-8B67-09B360B149FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1ADE3B86-00EF-4976-8B67-09B360B149FA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2832E5C3-660E-49B9-8E62-03B11A8CC6D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2832E5C3-660E-49B9-8E62-03B11A8CC6D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2832E5C3-660E-49B9-8E62-03B11A8CC6D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2832E5C3-660E-49B9-8E62-03B11A8CC6D7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {116B353F-FC68-4412-8A2D-34DA0BE88060}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {116B353F-FC68-4412-8A2D-34DA0BE88060}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {116B353F-FC68-4412-8A2D-34DA0BE88060}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {116B353F-FC68-4412-8A2D-34DA0BE88060}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {67EE578E-EE0A-4E98-AE5A-1771751D8B5F}
+ EndGlobalSection
+EndGlobal
diff --git a/samples/Contracts/Contracts.csproj b/samples/Contracts/Contracts.csproj
new file mode 100644
index 0000000..78ea792
--- /dev/null
+++ b/samples/Contracts/Contracts.csproj
@@ -0,0 +1,12 @@
+
+
+
+ netstandard2.0
+ latest
+
+
+
+
+
+
+
diff --git a/samples/Contracts/ICommand.cs b/samples/Contracts/ICommand.cs
new file mode 100644
index 0000000..7bcaadc
--- /dev/null
+++ b/samples/Contracts/ICommand.cs
@@ -0,0 +1,8 @@
+namespace Contracts;
+
+public interface ICommand
+{
+ string Name { get; }
+ string Description { get; }
+ int Execute();
+}
diff --git a/samples/Contracts/IWebStartup.cs b/samples/Contracts/IWebStartup.cs
new file mode 100644
index 0000000..3a1b38c
--- /dev/null
+++ b/samples/Contracts/IWebStartup.cs
@@ -0,0 +1,10 @@
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Contracts;
+
+public interface IWebStartup
+{
+ string Name { get; }
+ string Description { get; }
+ void ConfigureServices(IServiceCollection services);
+}
diff --git a/samples/HostApplications/ConsoleApp/.env b/samples/HostApplications/ConsoleApp/.env
new file mode 100644
index 0000000..08df5e1
--- /dev/null
+++ b/samples/HostApplications/ConsoleApp/.env
@@ -0,0 +1 @@
+PLUGINS=OldJsonPlugin.dll JsonPlugin.dll
\ No newline at end of file
diff --git a/samples/HostApplications/ConsoleApp/ConsoleApp.csproj b/samples/HostApplications/ConsoleApp/ConsoleApp.csproj
new file mode 100644
index 0000000..685c991
--- /dev/null
+++ b/samples/HostApplications/ConsoleApp/ConsoleApp.csproj
@@ -0,0 +1,16 @@
+
+
+
+ Exe
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/HostApplications/ConsoleApp/GlobalUsings.cs b/samples/HostApplications/ConsoleApp/GlobalUsings.cs
new file mode 100644
index 0000000..40307ff
--- /dev/null
+++ b/samples/HostApplications/ConsoleApp/GlobalUsings.cs
@@ -0,0 +1,3 @@
+global using Contracts;
+global using CPlugin.Net;
+global using DotEnv.Core;
diff --git a/samples/HostApplications/ConsoleApp/Program.cs b/samples/HostApplications/ConsoleApp/Program.cs
new file mode 100644
index 0000000..cc03969
--- /dev/null
+++ b/samples/HostApplications/ConsoleApp/Program.cs
@@ -0,0 +1,13 @@
+// See https://aka.ms/new-console-template for more information
+new EnvLoader().Load();
+Console.WriteLine("PLUGINS=" + EnvReader.Instance["PLUGINS"]);
+Console.WriteLine();
+
+var envConfiguration = new CPluginEnvConfiguration();
+PluginLoader.SetConfiguration(envConfiguration);
+// Loads the plugins from the .env file.
+var contracts = PluginLoader.Load();
+foreach(ICommand contract in contracts)
+{
+ contract.Execute();
+}
diff --git a/samples/HostApplications/WebApi/Controllers/WeatherForecastController.cs b/samples/HostApplications/WebApi/Controllers/WeatherForecastController.cs
new file mode 100644
index 0000000..5ce71f5
--- /dev/null
+++ b/samples/HostApplications/WebApi/Controllers/WeatherForecastController.cs
@@ -0,0 +1,31 @@
+namespace WebApi.Controllers;
+
+[ApiController]
+[Route("[controller]")]
+public class WeatherForecastController : ControllerBase
+{
+ private static readonly string[] Summaries = new[]
+ {
+ "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
+ };
+
+ private readonly ILogger _logger;
+
+ public WeatherForecastController(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ [HttpGet(Name = "GetWeatherForecast")]
+ public ListedResult Get()
+ {
+ var data = Enumerable.Range(1, 5).Select(index => new WeatherForecast
+ {
+ Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
+ TemperatureC = Random.Shared.Next(-20, 55),
+ Summary = Summaries[Random.Shared.Next(Summaries.Length)]
+ })
+ .ToArray();
+ return Result.Success(data);
+ }
+}
diff --git a/samples/HostApplications/WebApi/GlobalUsings.cs b/samples/HostApplications/WebApi/GlobalUsings.cs
new file mode 100644
index 0000000..00014dc
--- /dev/null
+++ b/samples/HostApplications/WebApi/GlobalUsings.cs
@@ -0,0 +1,6 @@
+global using System.Reflection;
+global using Contracts;
+global using CPlugin.Net;
+global using Microsoft.AspNetCore.Mvc;
+global using Microsoft.AspNetCore.Mvc.ApplicationParts;
+global using SimpleResults;
diff --git a/samples/HostApplications/WebApi/Program.cs b/samples/HostApplications/WebApi/Program.cs
new file mode 100644
index 0000000..c63f901
--- /dev/null
+++ b/samples/HostApplications/WebApi/Program.cs
@@ -0,0 +1,42 @@
+var builder = WebApplication.CreateBuilder(args);
+
+// Add services to the container.
+
+var jsonConfiguration = new CPluginJsonConfiguration(builder.Configuration);
+PluginLoader.SetConfiguration(jsonConfiguration);
+// Loads the plugins from the appsettings.json file.
+var contracts = PluginLoader.Load();
+foreach(IWebStartup contract in contracts)
+{
+ contract.ConfigureServices(builder.Services);
+}
+
+IMvcBuilder mvcBuilder = builder.Services.AddControllers();
+foreach (Assembly assembly in PluginLoader.Assemblies)
+{
+ // This allows to register the controllers for each loaded assembly.
+ mvcBuilder.PartManager.ApplicationParts.Add(new AssemblyPart(assembly));
+}
+
+// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
+builder.Services.AddEndpointsApiExplorer();
+builder.Services.AddSwaggerGen();
+
+var app = builder.Build();
+
+// Configure the HTTP request pipeline.
+if (app.Environment.IsDevelopment())
+{
+ app.UseSwagger();
+ app.UseSwaggerUI();
+}
+
+app.UseRequestLocalization("en");
+
+app.UseHttpsRedirection();
+
+app.UseAuthorization();
+
+app.MapControllers();
+
+app.Run();
diff --git a/samples/HostApplications/WebApi/Properties/launchSettings.json b/samples/HostApplications/WebApi/Properties/launchSettings.json
new file mode 100644
index 0000000..b857a27
--- /dev/null
+++ b/samples/HostApplications/WebApi/Properties/launchSettings.json
@@ -0,0 +1,41 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:57919",
+ "sslPort": 44392
+ }
+ },
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "applicationUrl": "http://localhost:5158",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "applicationUrl": "https://localhost:7049;http://localhost:5158",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/HostApplications/WebApi/WeatherForecast.cs b/samples/HostApplications/WebApi/WeatherForecast.cs
new file mode 100644
index 0000000..dafa103
--- /dev/null
+++ b/samples/HostApplications/WebApi/WeatherForecast.cs
@@ -0,0 +1,12 @@
+namespace WebApi;
+
+public class WeatherForecast
+{
+ public DateOnly Date { get; set; }
+
+ public int TemperatureC { get; set; }
+
+ public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+
+ public string Summary { get; set; }
+}
diff --git a/samples/HostApplications/WebApi/WebApi.csproj b/samples/HostApplications/WebApi/WebApi.csproj
new file mode 100644
index 0000000..7436b5d
--- /dev/null
+++ b/samples/HostApplications/WebApi/WebApi.csproj
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/HostApplications/WebApi/appsettings.Development.json b/samples/HostApplications/WebApi/appsettings.Development.json
new file mode 100644
index 0000000..0c208ae
--- /dev/null
+++ b/samples/HostApplications/WebApi/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/samples/HostApplications/WebApi/appsettings.json b/samples/HostApplications/WebApi/appsettings.json
new file mode 100644
index 0000000..cbf19de
--- /dev/null
+++ b/samples/HostApplications/WebApi/appsettings.json
@@ -0,0 +1,12 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*",
+ "Plugins": [
+ "AppointmentPlugin.dll"
+ ]
+}
diff --git a/samples/Plugins/AppointmentPlugin/Appointment.cs b/samples/Plugins/AppointmentPlugin/Appointment.cs
new file mode 100644
index 0000000..62abf63
--- /dev/null
+++ b/samples/Plugins/AppointmentPlugin/Appointment.cs
@@ -0,0 +1,9 @@
+namespace AppointmentPlugin;
+
+public class Appointment
+{
+ public string Id { get; init; }
+ public string DoctorName { get; init; }
+ public string PatientName { get; init; }
+ public DateOnly Date { get; init; }
+}
diff --git a/samples/Plugins/AppointmentPlugin/AppointmentController.cs b/samples/Plugins/AppointmentPlugin/AppointmentController.cs
new file mode 100644
index 0000000..f29b50b
--- /dev/null
+++ b/samples/Plugins/AppointmentPlugin/AppointmentController.cs
@@ -0,0 +1,18 @@
+namespace AppointmentPlugin;
+
+[TranslateResultToActionResult]
+[ApiController]
+[Route("[controller]")]
+public class AppointmentController : ControllerBase
+{
+ private readonly AppointmentService _appointmentService;
+ public AppointmentController(AppointmentService appointmentService) => _appointmentService = appointmentService;
+
+ [HttpGet]
+ public ListedResult Get()
+ => _appointmentService.GetAll();
+
+ [HttpGet("{id}")]
+ public Result Get(string id)
+ => _appointmentService.GetById(id);
+}
diff --git a/samples/Plugins/AppointmentPlugin/AppointmentPlugin.csproj b/samples/Plugins/AppointmentPlugin/AppointmentPlugin.csproj
new file mode 100644
index 0000000..79344fa
--- /dev/null
+++ b/samples/Plugins/AppointmentPlugin/AppointmentPlugin.csproj
@@ -0,0 +1,14 @@
+
+
+
+ $(SolutionDir)HostApplications/WebApi/bin/$(Configuration)/$(TargetFramework)/plugins/$(MSBuildProjectName)
+ Library
+ true
+ false
+
+
+
+
+
+
+
diff --git a/samples/Plugins/AppointmentPlugin/AppointmentService.cs b/samples/Plugins/AppointmentPlugin/AppointmentService.cs
new file mode 100644
index 0000000..16187d1
--- /dev/null
+++ b/samples/Plugins/AppointmentPlugin/AppointmentService.cs
@@ -0,0 +1,22 @@
+namespace AppointmentPlugin;
+
+public class AppointmentService
+{
+ private readonly List _appointments;
+ public AppointmentService(List appointments) => _appointments = appointments;
+
+ public ListedResult GetAll()
+ => Result.Success(_appointments);
+
+ public Result GetById(string id)
+ {
+ if (string.IsNullOrWhiteSpace(id))
+ return Result.Invalid("ID is required");
+
+ var appointment = _appointments.Find(u => u.Id == id);
+ if (appointment is null)
+ return Result.NotFound();
+
+ return Result.Success(appointment);
+ }
+}
diff --git a/samples/Plugins/AppointmentPlugin/GlobalUsings.cs b/samples/Plugins/AppointmentPlugin/GlobalUsings.cs
new file mode 100644
index 0000000..126715b
--- /dev/null
+++ b/samples/Plugins/AppointmentPlugin/GlobalUsings.cs
@@ -0,0 +1,5 @@
+global using Microsoft.AspNetCore.Mvc;
+global using Contracts;
+global using AppointmentPlugin;
+global using CPlugin.Net;
+global using SimpleResults;
diff --git a/samples/Plugins/AppointmentPlugin/Startup.cs b/samples/Plugins/AppointmentPlugin/Startup.cs
new file mode 100644
index 0000000..f5198db
--- /dev/null
+++ b/samples/Plugins/AppointmentPlugin/Startup.cs
@@ -0,0 +1,40 @@
+[assembly: Plugin(typeof(Startup))]
+
+namespace AppointmentPlugin;
+
+public class Startup : IWebStartup
+{
+ public string Name => "appointment";
+ public string Description => "Expose endpoints.";
+
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddTransient();
+
+ var appointments = new List
+ {
+ new()
+ {
+ Id = Guid.NewGuid().ToString(),
+ DoctorName = "Bob",
+ PatientName = "Alice",
+ Date = new DateOnly(2023, 01, 01)
+ },
+ new()
+ {
+ Id = Guid.NewGuid().ToString(),
+ DoctorName = "Dave",
+ PatientName = "Martin",
+ Date = new DateOnly(2023, 01, 05)
+ },
+ new()
+ {
+ Id = Guid.NewGuid().ToString(),
+ DoctorName = "Steven",
+ PatientName = "Smith",
+ Date = new DateOnly(2023, 01, 10)
+ },
+ };
+ services.AddSingleton(appointments);
+ }
+}
diff --git a/samples/Plugins/Directory.Build.props b/samples/Plugins/Directory.Build.props
new file mode 100644
index 0000000..9977cf6
--- /dev/null
+++ b/samples/Plugins/Directory.Build.props
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+ true
+
+
+
+
+ false
+
+ runtime
+
+
+
+ false
+
+ runtime
+
+
+
\ No newline at end of file
diff --git a/samples/Plugins/JsonPlugin/CreateJson.cs b/samples/Plugins/JsonPlugin/CreateJson.cs
new file mode 100644
index 0000000..33b5e14
--- /dev/null
+++ b/samples/Plugins/JsonPlugin/CreateJson.cs
@@ -0,0 +1,33 @@
+[assembly: Plugin(typeof(CreateJson))]
+
+namespace JsonPlugin;
+
+public class CreateJson : ICommand
+{
+ public string Name => "json";
+ public string Description => "Outputs JSON value.";
+
+ private class Info
+ {
+ public string JsonVersion;
+ public string JsonLocation;
+ public string Machine;
+ public string User;
+ public DateTime Date;
+ }
+
+ public int Execute()
+ {
+ Assembly jsonAssembly = typeof(JsonConvert).Assembly;
+ var info = new Info
+ {
+ JsonVersion = jsonAssembly.FullName,
+ JsonLocation = jsonAssembly.Location,
+ Machine = Environment.MachineName,
+ User = Environment.UserName,
+ Date = DateTime.Now
+ };
+ Console.WriteLine(JsonConvert.SerializeObject(info, Formatting.Indented));
+ return 0;
+ }
+}
diff --git a/samples/Plugins/JsonPlugin/GlobalUsings.cs b/samples/Plugins/JsonPlugin/GlobalUsings.cs
new file mode 100644
index 0000000..ba6a8b3
--- /dev/null
+++ b/samples/Plugins/JsonPlugin/GlobalUsings.cs
@@ -0,0 +1,5 @@
+global using Contracts;
+global using CPlugin.Net;
+global using JsonPlugin;
+global using Newtonsoft.Json;
+global using System.Reflection;
diff --git a/samples/Plugins/JsonPlugin/JsonPlugin.csproj b/samples/Plugins/JsonPlugin/JsonPlugin.csproj
new file mode 100644
index 0000000..acdfdf5
--- /dev/null
+++ b/samples/Plugins/JsonPlugin/JsonPlugin.csproj
@@ -0,0 +1,12 @@
+
+
+
+ $(SolutionDir)HostApplications/ConsoleApp/bin/$(Configuration)/$(TargetFramework)/plugins/$(MSBuildProjectName)
+ false
+
+
+
+
+
+
+
diff --git a/samples/Plugins/OldJsonPlugin/CreateJson.cs b/samples/Plugins/OldJsonPlugin/CreateJson.cs
new file mode 100644
index 0000000..6d3806b
--- /dev/null
+++ b/samples/Plugins/OldJsonPlugin/CreateJson.cs
@@ -0,0 +1,31 @@
+[assembly: Plugin(typeof(CreateJson))]
+
+namespace OldJsonPlugin;
+
+public class CreateJson : ICommand
+{
+ public string Name => "oldjson";
+ public string Description => "Outputs JSON value.";
+
+ private class Info
+ {
+ public string JsonVersion;
+ public string JsonLocation;
+ public string Machine;
+ public DateTime Date;
+ }
+
+ public int Execute()
+ {
+ Assembly jsonAssembly = typeof(JsonConvert).Assembly;
+ var info = new Info
+ {
+ JsonVersion = jsonAssembly.FullName,
+ JsonLocation = jsonAssembly.Location,
+ Machine = Environment.MachineName,
+ Date = DateTime.Now
+ };
+ Console.WriteLine(JsonConvert.SerializeObject(info, Formatting.Indented));
+ return 0;
+ }
+}
diff --git a/samples/Plugins/OldJsonPlugin/GlobalUsings.cs b/samples/Plugins/OldJsonPlugin/GlobalUsings.cs
new file mode 100644
index 0000000..19fd52b
--- /dev/null
+++ b/samples/Plugins/OldJsonPlugin/GlobalUsings.cs
@@ -0,0 +1,5 @@
+global using Contracts;
+global using CPlugin.Net;
+global using OldJsonPlugin;
+global using Newtonsoft.Json;
+global using System.Reflection;
diff --git a/samples/Plugins/OldJsonPlugin/OldJsonPlugin.csproj b/samples/Plugins/OldJsonPlugin/OldJsonPlugin.csproj
new file mode 100644
index 0000000..f93ee78
--- /dev/null
+++ b/samples/Plugins/OldJsonPlugin/OldJsonPlugin.csproj
@@ -0,0 +1,12 @@
+
+
+
+ $(SolutionDir)HostApplications/ConsoleApp/bin/$(Configuration)/$(TargetFramework)/plugins/$(MSBuildProjectName)
+ false
+
+
+
+
+
+
+