I am trying for some hours to install a custom visualizer in VS2022. Basically it is a simple string visualizer that opens a wpf form.
I followed this: https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-install-a-visualizer?view=vs-2022
But the instructions do not seem to work.
When the visualizer and the test console app are in the same solution, the visualizer works, shows up. Everything is alright, but that is not of too much help
What I have tried until now, but without success:
Copy all visualizer dlls in C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers
Copy all visualizer dlls in C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers
Checked on multiple projects, some targeting .NET Framework 4.7.2, some .NET 6
Checked on one of my colleagues pc, also with VS2022
Copied all dlls to a folder here(where I found DataSetVisualizer and IEnumerableVisualizer): C:\Program Files\Microsoft Visual
Studio\2022\Professional\Common7\IDE\CommonExtensions\Platform\Debugger\
Run devenv /ResetSettings from an admin console
Run devenv /resetskippkgs from an admin console
Run Visual Studio as administrator
Checked in Debug => Windows => Modules to see if the custom dll is loaded
Do you guys have any idea what should I try? Or what could be the problem?
Did any of you succeeded in running a custom visualizer in VS2022
Thank you
So, after some days, and many hours of trial and error, I could finally install and see my custom visualizer.
Basically, what I have done and (I think) it solved the issues:
Cleaned up all the dlls from "C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers" and all of its subfolders corresponding to .net framework versions
Checked that my visualizer corresponds to the correct type:
[assembly: DebuggerVisualizer(
typeof(DebuggerSide),
typeof(TextChunkObjectSource),
Target = typeof(IEnumerable),
Description = "PDF Visualizer")]
Don't put List<TextChunk>, or IReadOnlyList<TextChunk>, instead of IEnumerable<TextChunk>
Delete bin folder(s) and rebuild the visualizer project
Make sure to copy the dlls in all the needed folders:
I had to copy them here:
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netstandard2.0\
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netcoreapp\
I think this might be a new low for Microsoft Visual C++, which I have used since the 1990s.
File > New Project > C++, Windows COnsole app.
Build
Error (active) E1696 cannot open source file "ctype.h" C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\cctype 12
and 400+ more errors.
Is this expected?
Note that the default hello world program it generates only includes iostream directly.
So this means that the VC++ install is probably corrupt?
I have installed VS2013 and VS2015 on Windows 7.
I have an existing C++ Dll project that was building fine but now all of a sudden it wont build using VS2015 and gives me the error:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
From this post: fatal error LNK1104: cannot open file 'kernel32.lib' I went looking for the kernel32.lib file and it is located here:
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86
When I go to my Projects Properties-->Linker-->Input and select Macros I see that this path is indeed there:
My Platform Toolset is set to Visual Studio 2013 - Windows XP (v120_xp) which is what it always has been set to.
Why has my Project all of a sudden stopped building? What could have gone wrong?
I had this similar problem today with Visual Studio 2013 when I changed my VC++ Directories:
Project->Properties->VC++ Directories:
Include Directories
If the cause is some plug-in/extension that changes your props files, it may in consequence change the "Visual C++ Directories" settings of your project.
So, the solution that worked for me is described on my own answer Can't compile 64 bits Visual Studio 2010 projects, which I fully transcribe to here:
After I asked a colleague for help, we noticed, that even getting
clean builds of the projects from TFS, with overwrite option, the
Project's Configuration Properties > VC++ Directories on my computer
were always different from other computers.
Searching more we found the solution on the last post of Reset
include/lib path, which I will fully transcribe:
use "del %HOMEPATH%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props"
is not always the right way.
Better use "del %USERPROFILE%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props"
where the application data folder is normally placed in.
Then I've looked inside the contents of Microsoft.Cpp.x64.user.props
and I've seen that there were things added by Visual Leaks Detector.
Which is reasonable, as one month before, I did a memory leak analysis
using VLD.
So, I deleted the file and now everything compiles fine at 64bits!
I had to install the Visual C++ for Desktop Development.
Open Visual Studio Installer and go to Installed tab. Click on the Change Button on your installed Visual Studio Community Edition. -> On the Workloads Tab there should be a option Desktop Development with C++. Activate that option and modify the changes.
Afterwards it was working for me.
I had the same problem today. As it turned out somehow the SDK 10.0.15063.0 got installed on my system but without the Desktop C++ files. Selecting the SDK in the list of installed programs, doing a change install and there selecting the Desktop C++ options added the necessary files and now I can link again.
I got this error fatal error lnk1104: cannot open file 'kernel32.lib'.
this error is getting because there is no path in VC++ directories.
To solve this probelem
open visual studio 2008
go to Tools-options-Projects and Solutions-VC++ directories-*
then at right corner select Library files
here you need to add path of kernel132.lib
In my case It is C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
Thank you.
I had this following upgrade of some projects from VS2013 to VS2017.
Original project had a manual modification to the "Library Directories" item under VC++ Directories in the project settings.
This meant it did not pick up changes from the upgrade.
Using the option will reset this to something that works (assuming the SDK is installed OK) provided anything other than the default is not needed of course. In my case it was trying to point at the v7.1 SDK but that was not installed for vs2017.
in vs 2019, just run the installer, click modify, and then in the individual components tab, remove windows 10 SDK. then again run the installer and add windows 10 sdk!
I had this similar problem today with Visual Studio 2017. My cause turned out to be a bad environment setting in NETFXSDKDir, specifically:
NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1
It needed to have a value of:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x86
I have a more detailed response here:
fatal error LNK1104: cannot open file 'kernel32.lib'
In VS 2022 I was trying to compile an old solution that originally ran in VS 2010 then in VS 2019. It continually gave me the "cannot find Kernel32.lib" error. I spent 8 hours trying everything, including everything on this page. What worked for me: Configuration Properties -> VC++ Directories -> Library Directories and "inherit from parent" (guessing this sets to defaults) fixed this for me. Also note: I'm using winsock and directinput.
I have two visual studio projects:
Project A,
Project B having a file which doesn't compile.
I have a visual studio solution which contains those two projects. I set a project dependency to have A that depends on B. The build order would be B, A.
When visual studio IDE builds the solution, the behaviour is:
Project B starts to compile and fails showing errors,
Project A starts to compile.
When msbuild builds the solution, it compiles project B, shows the errors and doesn't continue by compiling project A. I'm using the following command line to build the solution:
msbuild my.sln /target:Build /property:Configuration=Debug /property:Platform=x64
Why msbuild and visual studio IDE don't have the same behaviour by default?
Is there a simple way to have msbuild continuing on errors without defining a msbuild project file?
(I'm using visual studio 2015 and simple C++ projects)
I have a driver code working for win2008 server compiled using wdk7.1.0. I converted the project to compile in visual studio 2012 with wdk8.1 and created sln and vcxproj files. I compiled successfully and generated .sys and .inf files.
My question is I have some files need to be copied to the output directory as part of build process automatically (after generating .inf and .sys files).
For wdk7.1.0, I wrote a makefile in which I executed "-copy /y src.out dest.out" and copied as part of compilation.
In wdk8.1 as I am compiling using visual studio, is there any way to execute these commands as part of build? like can I edit .sln/.vcxproj files etc etc.
Thanks in Advance
Venkatesh
You can use pre-build or post-build events properties of a project for this. You can call either a specific command or batch file to do such work.