Skip to content

feat(core): improve error handling for not found plugin assemblies - #42

Merged
DevD4v3 merged 1 commit into
masterfrom
feature/plugin-not-found-exception
Jul 29, 2026
Merged

feat(core): improve error handling for not found plugin assemblies#42
DevD4v3 merged 1 commit into
masterfrom
feature/plugin-not-found-exception

Conversation

@DevD4v3

@DevD4v3 DevD4v3 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

Improve the error handling when a configured plugin assembly cannot be found.

Instead of propagating the generic exception produced by AssemblyDependencyResolver, CPlugin.Net now validates that the plugin assembly exists before attempting to load it.

Changes

  • Add PluginNotFoundException.
  • Validate the plugin assembly path before creating AssemblyDependencyResolver.
  • Include the expected plugin path in the exception message.
  • Add tests covering the new behavior.

Example

Before:

System.InvalidOperationException: Failed to locate managed application [C:\...\Example.EconomyPlugin.dll].
   at System.Runtime.Loader.AssemblyDependencyResolver..ctor(String componentAssemblyPath)
   at CPlugin.Net.PluginLoadContext..ctor(String pluginPath)
   at CPlugin.Net.PluginLoader.Load(...)

After:

The plugin 'Example.AppointmentPlugin.dll' was not found at:

C:\...\plugins\Example.AppointmentPlugin\Example.AppointmentPlugin.dll

Ensure the plugin project has been built and the assembly exists in the plugins directory.

Add PluginNotFoundException to provide a clear and actionable error when a configured plugin assembly cannot be found.

Validate the plugin assembly path before creating AssemblyDependencyResolver and include the expected plugin path in the exception message.
@DevD4v3
DevD4v3 merged commit fb73880 into master Jul 29, 2026
1 check passed
@DevD4v3
DevD4v3 deleted the feature/plugin-not-found-exception branch July 29, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant