C
C#9mo ago
cow

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)
No description
No description
36 Replies
Amelia
Amelia9mo ago
does ctrl + f12 work better for you?
cow
cowOP9mo ago
no it still gives that same summary/comment
cow
cowOP9mo ago
i get a page full of stuff like this
No description
cow
cowOP9mo ago
and when i expand a function, its just a comment:
No description
cow
cowOP9mo ago
not the actual source code
jcotton42
jcotton429mo ago
that should definitely work for modern versions of .NET, what runtime version are you targeting @cow?
cow
cowOP9mo ago
.NET 8 latest version 8.0.2 i think
reflectronic
reflectronic9mo ago
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
cow
cowOP9mo ago
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
reflectronic
reflectronic9mo ago
cow
cowOP9mo ago
yeah but I'd love to have that info in the IDE just by pressing a button
Henkypenky
Henkypenky9mo ago
it's weird in vs it doesn't work sometimes, in rider it does
cow
cowOP9mo ago
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
Henkypenky
Henkypenky9mo ago
are you loading symbols?
cow
cowOP9mo ago
how do i check that
Henkypenky
Henkypenky9mo ago
chck options, debugging symbols
cow
cowOP9mo ago
ok
Henkypenky
Henkypenky9mo ago
and uncheck just my code
cow
cowOP9mo ago
No description
Henkypenky
Henkypenky9mo ago
toggle it
cow
cowOP9mo ago
ok... im not
Henkypenky
Henkypenky9mo ago
and disable just my code build once and then try to check the source code
cow
cowOP9mo ago
do i need to be debugging for it to work?
Henkypenky
Henkypenky9mo ago
yes build in debug
cow
cowOP9mo ago
i mean, it's built yes, but do i need to launch the debugger
Henkypenky
Henkypenky9mo ago
just run it in debug like you always do with the debugger attached it should load all the symbols
cow
cowOP9mo ago
ok yeah its spending a long time loading symbols now hopefully it will work once it's done 👍
Henkypenky
Henkypenky9mo ago
first time it takes longer then it's faster
cow
cowOP9mo ago
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
Henkypenky
Henkypenky9mo ago
good to hear
cow
cowOP9mo ago
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
Henkypenky
Henkypenky9mo ago
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
cow
cowOP9mo ago
yeah might have to anyway, half way there, thanks very much 🙂
Henkypenky
Henkypenky9mo ago
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
cow
cowOP9mo ago
oh yep already ticked for me
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server