Could not load file or assembly exception C# .NET

1

I'm working on this program for a friend, but I'm having an issue. The program keeps throwing "The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)" It's trying to load Microsoft.ExtendedReflection.dll for the ProvinceCopier.dll plugin. The full exception that my program outputed to a log is as follow:

01/11/18 13:05:26: PluginHandler.cs: A critical error has occured: Message: Could not load file or assembly 'C:\\Users\\user\\AppData\\Local\\Tech N Gamer\\Mod Copier\\Plugins\\Province.Copier.Plugin\\dependency\\Microsoft.ExtendedReflection.dll' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Stacktrace:    at System.Reflection.AssemblyName.nInit(RuntimeAssembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent)
    at System.Reflection.RuntimeAssembly.CreateAssemblyName(String assemblyString, Boolean forIntrospection, RuntimeAssembly& assemblyFromResolveEvent)
    at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
    at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
    at System.AppDomain.Load(String assemblyString)
    at System.AppDomain.Load(String assemblyString)
    at Utility.Workers.Handlers.PluginHandler.LoadPlugin() in E:\Personal Files\Programs\Git Repositories\Mod Copier\Utility\Workers\Handlers\PluginHandler.cs:line 93

The line that is throwing this is here:

pluginDomain.Load( file );

I have no idea why it's throwing it, but it's a separate AppDomain from the main one so it can dynamically load and unload plugins. Even if I do the following code it still throws the error:

AppDomain.CurrentDomain.Load( file );

The plugin's dependency is located at AppData\Local\Tech N Gamer\Mod Copier\Plugins\Province.Copier.Plugin\dependency

Is their something that I'm missing?

c#
.net
asked on Stack Overflow Jan 11, 2018 by Kyu Vulpes

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0