bert2 / microscope

:microscope: CodeLens extension for Visual Studio that lets you inspect the intermediate language instructions of methods and properties.

Home Page:https://marketplace.visualstudio.com/items?itemName=bert.microscope

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to show instructions of code generated by Source Generators

vvdev opened this issue · comments

commented

VS2022, Version 17.6.0 Preview 1.0

CodeLens do not show instructions details, hint shows the following exception:
image

commented

That's a weird one. The extension tries to determine the csproj/assembly where the current file resides in, but can't find it.

In my understanding this would mean you are working on a .net framework project and the generated file is not visible in the solution explorer. Are those assumptions correct?

Could you provide more details please? I need to know the folder structure and the solution structure of the folder/project where the affected file belongs to.

commented

@vvdev Just noticed I accidentally closed the issue yesterday. Reopened.

commented

Hello, @bert2

Project is .NET6/.NET7

Yes, code file is not visible in Solution Explorer, it is not even persisted to disk, it is behavior of C# Source Generator.
https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview
You can see/inspect such code only by navigating there using Go To Definition from callee code.

Please let me know if you need more context.

Thanks for your product and attention to issues :)

Regards.