Debugging code from dynamically loaded assembly in .net core 2.0 : <p>I have a .net core 2.0 console app that does the following (simplified):</p>

<pre><code>var a = Assembly.Load(Assembly.GetEntryAssembly()
                              .GetReferencedAssemblies()
                              .First(i =&gt; i.Name == "MyAssembly"));

var t = a.GetType("MyType");
var i = (MyBaseType)Activator.CreateInstance(t);

i.Execute();
</code></pre>

<p>When I debug through the code it stepps into <code>MyType.Execute()</code> as expected.</p>

<p>However If I load the assembly with the following code:</p>

<pre><code>var path = new FileInfo(Assembly.GetExecutingAssembly().Location);
var a = Assembly.LoadFile(Path.Combine(path.DirectoryName, "MyAssembly.dll"));
</code></pre>

<p>The code still works but I can't step into <code>MyType.Execute()</code> while debugging.</p>

<p>Any Idea why/what's wrong?</p>
