Possible to F12 into C# source?
VS 2022 latest version.
When I F12 onto something like
.FirstOrDefault()
it just tells me a summary like this: (see screenshot 1)
Is it possible to view the acutal source code on F12?
I thought if these options were ticked I could view source code, but I guess I misunderstood? (see screenshot 2)

36 Replies
does ctrl + f12 work better for you?
no it still gives that same summary/comment
i get a page full of stuff like this

and when i expand a function, its just a comment:

not the actual source code
that should definitely work for modern versions of .NET, what runtime version are you targeting @cow?
.NET 8 latest version
8.0.2 i think
yeah it's supposed to work if you're on .NET but sometimes it doesn't
like i just tried it, and the first time it brought me to the metadata view, and then i closed that and tried again and it brought me to the source
i've closed and opened a few times but no luck
ok but good to know i'm not going crazy. I should be able to view source code
usually i use https://source.dot.net
yeah but I'd love to have that info in the IDE just by pressing a button
it's weird in vs it doesn't work sometimes, in rider it does
I've never had it work... i just stumbled on a discussion online and people had screenshots of the source
and i was like ?????? you can do that???
but sadly doesnt work for me
are you loading symbols?
how do i check that
chck options, debugging symbols
ok
and uncheck just my code

toggle it
ok... im not
and disable just my code
build once
and then try to check the source code
do i need to be debugging for it to work?
yes build in debug
i mean, it's built yes, but do i need to launch the debugger
just run it in debug
like you always do
with the debugger attached
it should load all the symbols
ok yeah its spending a long time loading symbols now
hopefully it will work once it's done 👍
first time it takes longer
then it's faster
ok so I set a breakpoint at a TryParse, and I can step inside and see TryParse source and step through it which is cool and good progress
good to hear
but if i just hit f12 on TryParse it still just shows the comments, not the source
so i have to actively debug and step into it
yeah it's weird, i don't VS anymore to help cause i switched to rider
sorry
bus as reflectonic said just use source.dot.net
yeah might have to
anyway, half way there, thanks very much 🙂
there is probably another setting i'm missing
here
https://learn.microsoft.com/en-us/aspnet/core/test/debug-aspnetcore-source?view=aspnetcore-8.0
enable source link support
oh yep already ticked for me
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View