Embedded debug information in dynamically loaded assemblies

175 Views Asked by At

I use assemblies with embedded debug information in .Net 4.7.2. If assemblies are loaded from the file system, then the exception stack traces contain line numbers. But if I dynamically load (via AppDomain.Load (byte[])) an assembly with embedded debug information, then the exception stack traces do not contain line numbers for this assembly.

Is there a way to force the .Net Framework to use the embedded debug information from dynamically loaded assemblies?

Note: I know that if debug information is located in separate PDB file then it is possible to load it along with assembly itself (via AppDomain.Load (byte[], byte[])). The question is about embedded debug information.

1

There are 1 best solutions below

0
On

The very similar problem is described here. VS 2019 resolves problem described there. But VS 2019 does not solve my problem.

It seems that the use of embedded debug information from dynamically loaded assemblies to display line numbers in exception stack traces is not implemented.

Neither updating to .Net 4.8 nor installing VS 2019 helps.

Eventually I recompiled all assemblies with portable debug info and use AppDomain.Load(byte[], byte[]) instead of AppDomain.Load(byte[]).