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?

9
  • You might find something useful here: social.msdn.microsoft.com/Forums/en-US/… or another SO post here: stackoverflow.com/questions/12520212/…
    – dsmeclipse
    Jan 11, 2018 at 19:47
  • @dsmeclipse I'm not sure those links help, for one, this program doesn't know if any plugin exists until it looks. Secondly, these are files that are generated with the Province Copier project outside the ModCopier project. So if I change the name of Microsoft.ExtendedReflection.dll to something else, would that make it work?
    – Kyu Vulpes
    Jan 11, 2018 at 20:17
  • If I rename Microsoft.ExtendedReflection.dll it loads, but then Province Copier.dll then yells that it cannot find Microsoft.ExtendedReflections.
    – Kyu Vulpes
    Jan 11, 2018 at 20:28
  • What happens if you move the file and point the location outside of AppData? Create a folder on your root, dump the file there, point it, then try again. I've run into issues with permissions pointing to files on the root of c as well as the user folders within Windows 7/10.
    – dsmeclipse
    Jan 11, 2018 at 20:48
  • I know it seems silly to ask since I'm sure you've already checked, but that's just me: What do you have for the Assembly name here: Project > Project Properties?
    – dsmeclipse
    Jan 11, 2018 at 20:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.