Visual Studio 2019 F12 to decompiled source for .NET Core projects - .net-core

I very often use the Visual Studio F12 to decompiled source feature. When I do this against framework classes in a .NET Core project I very often end up looking at some sort of reference assembly that has no implementation code, just stubs, e.g
Is there any way of getting it to go straight to the actual implementation code instead?

So you see at the top where it lists .Ref at the end of the package name? I'm not positive but I suspect this is trimmed down version of the DLL that doesn't include the full source.
If you search for the dll elsewhere you should be able to find the dll with the full source and decompile that with a standalone decompiler.
So for your example you can find the full dll at C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App\3.0.0\Microsoft.AspNetCore.Authentication.Cookies.dll
Personally I prefer using the free decompiler offered by JetBrains called dotPeek. It allows you to navigate directly to the decompiled source using F12, however this will only lead you back to where you are stuck now. BUT if you open the path I listed above for the full DLL and open that in dotPeek, you'll get the full decompiled source code.
As far as I know there's no way to lookup the actual DLL via keyboard shortcut inside the IDE, you have to find the DLL yourself and open it in a decompiler.

Assuming you've downloaded the ILSpy visual studio extension...
There is a way to decompile using a keyboard shortcut.
Tools->Options->Environment->Keyboard
Press a set of keys for the keyboard shortcut. (I used ctrl i l).
Click Assign->OK
Pressing the above keyboard shortcut will now open the selected code decompiled in a new window of ILSpy.

I have a partial solution for this. It's partial because still the Go to Definition (F12) won't work for it, but the Step Into (F11) option while debugging can successfully step into the actual .NET Core, not just the stub.
The feature is called Source Link, I hope it helps.

They are still working on this feature. There's a github issue for it.

You can do this if you have JetBranis dotPeeK installed and you cannot see the decompiled file when you press F12 or Ctrl + F12 :
Go to Tools > Option > Resharper Options > External Sources : then enable Decompile Resource

Related

Dll library is not detected from the browser

I am using a dll in my new web proyect, I added the dll as a reference but, when I call it from code behind it works fine, It detects the library in my visual studio
But when I runn it from a browser, it mark an error:
enter link description here
PD: The dll works fine in my other 2 proyects(wpf & winform)
Does anybody knows what could it be?
Thanks!
And sorry for my english, im steal learning
Have you set the file to "Copy to Output Directory"
Click the DLL in your solution explorer and it will be in the properties panel at the top

Open source file of a referenced project in Visual Studio

In Visual Studio, in design time, when I encounter a call to a procedure, I can jump to the code of that procedure by right-clicking it's name and selecting 'Go To Definition' (or press F12) from the pop-up menu.
However, this does not work for a procedure in a referenced (DLL) file (not included in the project).
But when I'm debugging in runtime, I CAN step into that procedure pressing F10 when it's called. This makes me think it should be possible in design time too, but I can't find how to do this.
Not trying to be a smart-a$$, but: double-click on it. Probably I'm not understanding you. Give a better explanation, please.

What is Interop.MSutil.dll

First of all i want to say that I'm still a beginner in ASP.NET development. I think this is a simple question but I cant find an answer anywhere. The following is my problem:
I have a big ASP.NET project develped in .NET 2.0 . Now I have to update thisProject to .NET 4.0. I think it worked quite well when I loaded and converted it to .NET 4.0 with VS2010 but there is this missing reference.
The missing reference is MSutil.dll and I don't have any clue what that reference is for an I cant find the dll anywhere either. In the cs code its used like this:
using LogQuery = MSUtil.LogQueryClassClass;
using IisW3cLogInputClass = MSUtil.COMIISW3CInputContextClassClass;
using LogRecordSet = MSUtil.ILogRecordset;
using LogRecord = MSUtil.ILogRecord;
Can anyone tell me...
what this reference is for?
where I can find/download it?
how I can include/install it in my solution?
This is used to read the IIS log files and parse them.
To get that DLL follow those steps:
Download the Log Parser package, here. (free download, small .msi file)
Install the Log Parser on the machine with the your project and Visual Studio.
Browse to the location of the installed program and you will see file called "LogParser.dll" in there. Copy the file to some easy location e.g. "C:\Temp" see below why.
Go to All Programs --> Microsoft Visual Studio 2010 --> Visual Studio Tools and right click "Visual Studio Command Prompt" then choose Run as administrator.
From within the console type:
tlbimp "C:\temp\LogParser.dll" /out:"C:\temp\Interop.MSUtil.dll"
That's it - after this you will have the lost Interop.MSUtil.dll back on your machine, copy it to your project location and add reference to it like you add to any other external DLL file.
Interop.MSutil.dll is a .NET interface to LogParser.dll, primarily used to parse IIS logs.
To use it, you will need LogParser 2.2 installed and LogParser.dll registered on your machine.
Interop.MSUtil is now available via nuget so you no longer have to create it yourself, but after installation you will have to manually add a reference to the DLL in your solution's packages folder.
After adding the reference, right-click it and set Embed Interop Types to false to avoid receiving an error that the classes cannot be embedded.
It seems is an Interop object.
An Interop object is a bridge between a .Net dll and a COM object
Perhaps this link helps you
http://www.fixdllexe.com/Interop.MSUtil.dll-149085.html

QT with debugger

I am new to QT
I downloaded online installer for QT windows in the location
http://qt.nokia.com/downloads
I just tried simple program like printin hello world.
I Could execute the program. But I am not able to debug it.
I am getting errors like
None of the debugger engines 'Cdb engine, Gdb engine' capable of
debugging binaries of the type 'x86-windows-msvc2008-pe-32bit' is
configured correctly.
Should I download a different version for debugging or Did I miss any procedure to include debuging facility?. Please help me to install QT with debugger.
Do you have Visual Studio installed?
You need to have it installed so you can use this engines to debug.
Here is the link for the Visual studio: LINK
Enjoy!
I had the same problem with QtCreator. An Update of the QtSDK solved it for me. You find the update mechanism in a menu of QtCreator.
Go to Tools -> Options -> Tool Chains, and tell us what you see. I have only ever used Qt with mingw, not Visual Studio, so I don't know if it will help, but look at this question and its resolution.
It looks like there was a bug in QtSDK installer at some point. Firstly, try updating. Secondly, try this:
open Qt Creator and go to Tools → Options... → Build & Run, select Tool Chains tab;
there should be Auto-detected list, select in there Mingw as GCC for Windows targets and click Clone button;
Now select cloned tool chain, you should be able edit specific fields in the bottom;
Click Browse... right to Debugger field and select %QTDIR%\pythongdb\python_2.7based\gdb-i686-pc-mingw32.exe;
Save your edits, create a new project (don't forget to select cloned tool chain) and try debugging.
Does it work?

How can I make MSVC debugger step into Qt library source code again?

Until now my Visual Studio 2008 debugger gracefully stepped into Qt library code when I pressed F11. After upgrading Qt to the latest version and changing QTDIR, F11 does not step into library code anymore. Any clues how to make the debugger smart again?
Activate the modules list, Debug - Windows - Modules, to see what libraries are loaded and if debug symbols are loaded for those libraries. Note that you need to have the debugger active on your process to be able to do this.
In debug mode, the Qt libraries should be suffixed by d. QtCored4.dll for instance. If you see QtCore4.dll on the list, you have linked to the wrong libraries. If it does say QtCored4.dll but under Symbol Status there is something different than Symbols loaded., then that's the reason. You can manually load the symbols here by right clicking on the dll and selecting Load Symbols. It asks for the Pdb file after clicking that.
You can add more pdb file locations, if they weren't loaded but exist, from Tools - Options - Debugging(tree) - Symbols(tree). If you want the symbols to be automatically loaded.
Should it give some error, that the pdb file doesn't match the binary or something like that, you should re-build your Qt debug version, unless you have more pdb files to try. Use the Visual studio command prompt and go to the Qt directory, run configure and nmake. It takes a while, possibly some hours. There was some switch to only build debug version but i forgot where it goes. Note that the build might fail and after that it's a lot of fun www.google.com searches. The best bet might be to get the source only package, I forgot where to get that and it's not easily found. If you know where to get it, tell me please. I vaguely remember that there might be some other way to build the debug version, but this is the only one i know for sure.
#0xbaadf00d's recommendation to "open the Debug/Windows/Modules view" for verifying which modules have loaded successfully and which are not loaded is extremely useful.
Here is a summary of what I check when I need to step into Qt source code:
The DLLs must be for the Qt version in developer's Qt kit
The Qt .pdb files must be present in Qt kit's folders: bin, lib, plugins/platforms, plugins/qmltooling
Visual Studio Tools/Option/Debugging/Symbols needs paths to .pdb files:
If qt.conf file is used, must point to correct bin folder
If target is WinCE or WEC2013 and using HKLM\Loader\SystemPath, you must specify path to DLLs in SystemPath variable
Set the location for the source files in the project property pages:

Resources