I have a .net core 2.0 console app that does the following (simplified):
var a = Assembly.Load(Assembly.GetEntryAssembly()
.GetRefe
I agree with the answers of Lukasz and Alexan. If you've checked those and it does not work then the reason why your code examples differ could be that they do not load the same assembly.
The executing assembly and entry assembly are not always the same assembly, so the paths can be different. It might also be that another version of the assembly is loaded, for instance from the GAC. Using the modules window in Visual Studio you can see which dll is loaded. If the correct PDB is present and Just My Code is turned off you should be able to step into it.