title: AppDomain.CurrentDomain.AssemblyResolve asking for a <AppName>.resources assembly?
body: <p>using the code <a href="https://stackoverflow.com/questions/1453755/how-to-embed-a-satellite-assembly-into-the-exe-file/1454496#1454496">How to embed a satellite assembly into the EXE file</a> provided by csharptest.net, I've created a custom assembly resolver and embedded my assemblies in my resources. </p>
  
  <p>I can successfully resolve my assemblies used in but somehow AppDomain.CurrentDomain.AssemblyResolve asks for an assembly called 'AppName.resources' specifically "MyProgram.resources, Version=0.15.3992.31638, Culture=en-US, PublicKeyToken=null" which i don't know how to resolve?</p>
  
  <p>I've tried to disable loading my custom assemblies from resources (placed all my assembly dll's in program directory) and just enabled AppDomain.CurrentDomain.AssemblyResolve, but it was still asking for it.</p>
  
  <p>I'm a bit confused about this, will appreciate a lot if you can help me on this.</p>
  
  <p>Here's my code for interested ones;</p>
  
  <pre><code>static Assembly ResolveAssemblies(object sender, ResolveEventArgs args)
  {
      Assembly assembly = null;
      string name = args.Name.Substring(0, args.Name.IndexOf(','));
      if (name == "MyProgram.resources") return null;
      else name = string.Format("MyProgram.Resources.Assemblies.{0}.dll", name);
  
      lock (_loadedAssemblies)
      {
          if (!_loadedAssemblies.TryGetValue(name, out assembly))
          {
              using (Stream io = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
              {
                  if (io == null)
                  {
                      MessageBox.Show("MyProgram can not load one of it's dependencies. Please re-install the program", string.Format("Missing Assembly: {0}", name), MessageBoxButtons.OK, MessageBoxIcon.Error);
                      Environment.Exit(-1);
                  }
                  using (BinaryReader binaryReader = new BinaryReader(io))
                  {
                      assembly = Assembly.Load(binaryReader.ReadBytes((int)io.Length));
                      _loadedAssemblies.Add(name, assembly);
                  }
              }
          }
      }
  
      return assembly;
  }
  </code></pre>