Debugging code from dynamically loaded assembly in .net core 2.0

前端 未结 5 647
一向
一向 2021-02-05 07:27

I have a .net core 2.0 console app that does the following (simplified):

var a = Assembly.Load(Assembly.GetEntryAssembly()
                              .GetRefe         


        
5条回答
  •  清歌不尽
    2021-02-05 07:44

    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.

提交回复
热议问题