title: NET Core loading interfaces from DLL get error can't find the file (VS2017 RC)
body: <p>Having a lot of trouble with a dotnet core c# console application using Visual Studio 2017RC (27th Jan build) when trying to load interfaces from a separate DLL (project is part of same solution). I followed the Visual Studio 2017RC instructions for setting up for dotnet core here: <a href="https://www.microsoft.com/net/core#windowsvs2017" rel="nofollow noreferrer">https://www.microsoft.com/net/core#windowsvs2017</a></p>
  
  <p>Main application:</p>
  
  <pre><code>public class Core
  {
      public static void Main(string[] args)
      {
      Console.WriteLine("Starting...");
          // Setup PubSub                      
          var pubSub = new PubSub();
      }
  }
  
  public class PubSub : IPubSub
  {
      // Subscription table
      private static ConcurrentDictionary&lt;ChannelKey, ChannelSub&gt; subscriptions = new ConcurrentDictionary&lt;ChannelKey, ChannelSub&gt;();
  
      // User group table
      private static ConcurrentDictionary&lt;string, List&lt;string&gt;&gt; clientGroups = new ConcurrentDictionary&lt;string, List&lt;string&gt;&gt;();
  
      public PubSub()
      {
          try
          {
              List&lt;string&gt; users = new List&lt;string&gt;();
              clientGroups["ADMINS"] = new List&lt;string&gt; { "PubSub.myClient" };
              AddUpdChannel(new ChannelKey
              {
                  network = Core.networkName,
                  category = "LIGHTING",
                  className = "CBUS",
                  instance = "MASTERCOCOON"
              }, new ChannelSub
              {
                  auth = new List&lt;AccessAttribs&gt;
              {
                  new AccessAttribs
                  {
                      name = "ADMINS",
                      access = "RW"
                  }
              },
                  clients = new List&lt;AccessAttribs&gt;
              {
                  new AccessAttribs
                  {
                      name = "PubSub.myClient",
                      access = "RW"
                  }
              }
              });
  
              Subscribe("myClient", new ChannelKey
              {
                  network = Core.networkName,
                  category = "LIGHTING",
                  className = "CBUS",
                  instance = "MASTERCOCOON"
              });
          }
          catch (Exception ex)
          {
  
              throw ex;
          }
      }
  
      public bool Publish(string clientName, ChannelKey channel, string message, [CallerFilePath] string caller = "")
      {
          Logger.LogInformation("Client: " + clientName + " published to: " + channel.instance + " TEST");
          return true;
      }
  
      // Channels must be created before subscribed to.
      public bool AddUpdChannel(ChannelKey channel, ChannelSub channelSub, [CallerMemberName] string caller = "")
      {
          channelSub.author = caller;                                                             // Enforce author as caller, regardless of setting passed.
          subscriptions[channel] = channelSub;
          return true;
      }
  
      // Subscribe to channel for Ext/Plug.Client. Return null if channel does not exist else return access rights ("", R, RW) and update any old entries or add new
      public string Subscribe(string clientName, ChannelKey channel, [CallerFilePath] string caller = "")
      {
          string access = "";
          var fullClientName = Path.GetFileNameWithoutExtension(caller) + "." + clientName;
  
          if (subscriptions.TryGetValue(channel, out var subscription))                           // Get channel subscription info
          {
              foreach (var subGroup in subscription.auth)                                         // Get access rights for group client is a member of
              {
                  clientGroups.TryGetValue(subGroup.name, out var clientGroup);                   // Lookup clients associated with group
                  if (clientGroup.Contains(fullClientName))
                  {
                      access = subGroup.access;
                      if (subGroup.access == "RW") break;                                         // RW access takes precidence if user is a member of multiple groups
                  }
              }
  
              if (access != "")                                                                   // Some access allowed so setup
              {
                  var newAccess = new AccessAttribs
                  {
                      name = fullClientName,
                      access = access
                  };
                  var exists = subscription.clients.FindIndex(x =&gt; x.name == fullClientName);     // Look for fullClientName already in list (assume there could be any access strings)
                  if (exists != -1)
                  {
                      subscription.clients[exists] = newAccess;                                   // Update if existing
                  }
                  else
                  {
                      subscription.clients.Add(newAccess);                                        // Add if new
                  }
                  subscriptions[channel] = subscription;                                          // Update subscription with new client access info
              }
  
              return access;
          }
          return null;                                                                            // subscription does not exist
      }
  }
  </code></pre>
  
  <p>The interfaces are defined in a separate project as follows:</p>
  
  <pre><code>namespace Interfaces
  {
    public interface IExtension
    {
      string ExtStart(IPubSub myHost);
      string ExtStop(string param);
    }
  
  public interface IPubSub
  {
      bool AddUpdChannel(ChannelKey channel, ChannelSub channelSub, [CallerMemberName] string caller = "");
      string Subscribe(string clientName, ChannelKey channel, [CallerFilePath] string caller = "");
      bool Publish(string clientName, ChannelKey channel, string message, [CallerFilePath] string caller = "");
  }
  
  public struct ChannelKey
  {
      public string network;
      public string category;
      public string className;
      public string instance;
  }
  
  public struct AccessAttribs
  {
      public string name;
      public string access;
  }
  
  public class ChannelSub
  {
      public bool active = true;
      public string desc = "";
      public string type = "GENERIC";
      public string author = "";
      public List&lt;AccessAttribs&gt; clients = new List&lt;AccessAttribs&gt;();                                         // List of clients subscribed &amp; their access rights. This is set when subscribing to enable fast lookup when processing messages
      public List&lt;AccessAttribs&gt; auth = new List&lt;AccessAttribs&gt;();                                            // When subscribing, clients must be a member of one of these groups &amp; will get the access rights of that group
      public List&lt;KeyValuePair&lt;string, string&gt;&gt; attribs = new List&lt;KeyValuePair&lt;string, string&gt;&gt;();
  }
  </code></pre>
  
  <p>Solution builds fine, and intellisense finds all the interface definitions in the DLL, so it must be finding the file. I have clean/rebuilt/checked the file location many times and it is fine. Also I can cut/paste this code into a non Core .NET project and it works fine.</p>
  
  <p>The error reported when first starting in debug mode is:</p>
  
  <pre><code>System.IO.FileNotFoundException 'Could not load file or assembly Commons, Version=1.0.0.0,
  culture=neutral, PublicKeyToken=null". The system cannot find the file specified.
  </code></pre>
  
  <p>csproj for the main project:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;
   &lt;PropertyGroup&gt;
    &lt;OutputType&gt;Exe&lt;/OutputType&gt;
    &lt;TargetFramework&gt;netcoreapp1.1&lt;/TargetFramework&gt;
   &lt;/PropertyGroup&gt;
   &lt;ItemGroup&gt;
    &lt;PackageReference Include="Microsoft.Extensions.Configuration" Version="1.1.0" /&gt;
    &lt;PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="1.1.0" /&gt;
    &lt;PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" /&gt;
    &lt;PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
    &lt;Reference Include="Commons"&gt;
     &lt;HintPath&gt;..\Commons\bin\Debug\netcoreapp1.1\Commons.dll&lt;/HintPath&gt;
     &lt;Private&gt;true&lt;/Private&gt;
    &lt;/Reference&gt;
   &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>csproj for the interface DLL (Commons.DLL)</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp1.1&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>I have rebuilt this project many times, reinstalled VS 2017RC several times and I can't get rid of the file not found error for the interface reference DLL.</p>