How to show ESLint errors in VS2022 MAC? - visual-studio-mac

I would like to be able to see errors and warnings from my ESLint rules as I am editing JavaScript and TypeScript files in Visual Studio 2022 Mac. Is it possible to enable that natively or is there an extension for that?

Related

CMake - could not find any instance of Visual Studio [duplicate]

When I am trying to install CMake I get the error:
Visual Studio 15 2017 could not find any instance of Visual Studio.
I am using Windows 7 and Visual Studio 2017. The CMakeOutput.log file writes:
The system is: Windows - 6.1.7601 - AMD64
Any ideas?
I ran into the same error and performed the following steps to resolve the issue:
Open Visual Studio
Go to Tools -> Get Tools and Features
In the "Workloads" tab enable "Desktop development with C++"
Click Modify at the bottom right
These steps resulted in the "Visual C++ tools for CMake" feature being installed, but the other optional C++ features included in this workload may also helpful for what you are trying to do.
After the Visual Studio updater finishes installing try re-running the command. You may need to open a new command window.
In my case, I installed Visual Studio, selecting the workloads and modules that I wanted, but I ignored the request to reboot, assuming that shutting down the computer at the end of the day and restarting it the following day would suffice. I was wrong.
The following day I tried a cmake build and got the "could not find any instance of Visual Studio" error. After several attempts to resolve, I re-ran the installer, made no changes to the configuration, and clicked Modify. This time I let it reboot the computer. The reboot took a long time. After which my cmake build worked.
If you have already installed the workload Desktop development with C++ and still getting the following errors while using visual studio 2022 for flutter
Generator
Visual Studio 16 2019
could not find any instance of Visual Studio.
Building Windows application...
Exception: Unable to generate build files"
Solution: Follow these steps,
Edit your_flutter_path\packages\flutter_tools\lib\src\windows\build_windows.dart, and change the constant on line 28 from Visual Studio 16 2019 to Visual Studio 17 2022
Delete flutter_tools.stamp and flutter_tools.snapshot from your_flutter_path\bin\cache\
Run flutter clean in the project
I had the same issue "could not find any instance of Visual Studio"
but with Visual Studio 2019 (Community Edition) and I just had to configure the VS160COMNTOOLS variable so that CMake correctly detects Visual Studio.
export VS160COMNTOOLS="/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools"
(cf https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html)
With Visual Studio 15 2017, the variable you need should be VS150COMNTOOLS.
(cf https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html)
NB: in my case, in a Travis-CI workflow, I installed Visual Studio using the commands (no need to reboot):
choco install visualstudio2019community
choco install visualstudio2019-workload-nativedesktop # required
With only the first package, CMake detection of VS2019 failed.
I was configuring a Jenkins build node and could successfully run CMake GUI manually but command line use or builds using the CMake plugin would fail with:
Visual Studio 16 2019 could not find instance of Visual Studio.
-A x64 parameter was added with no change in result.
The problem was that CMake could not determine the Windows SDK version.
By adding CMAKE_SYSTEM_VERSION parameter CMake was then able to find Visual Studio.
-D CMAKE_SYSTEM_VERSION=10.0.18362.0 (use your windows SDK version)
Environment:
windows 10 system build: 19042
CMAKE 3.19.4
VS 2019 Professional 16.8.4
Jenkins 2.235.1
Full command line that worked:
"C:\Program Files\CMake\bin\cmake" -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Release -A x64 -D CMAKE_SYSTEM_VERSION=10.0.18362.0
When using VS 2017, be aware that this is really VS 2015, and CMake identified it as VS 2017 2022 which is not the version of VS 2017 I had, that gave me this error. So the conclusion I offer is to try different versions, specifically the 2015 one.
I had a similar issue where installing libzmq in my npm project was throwing the same error and that wasn't getting solved by enabling "msbuild" under "Desktop development with C++" in the Visual Studio installer.
My solution ended up being to reinstall the Windows build tools for npm with the following command.
npm install --global windows-build-tools
Note: Remember to run the command prompt (or whatever terminal you are using) as admin before running this.
If the CMake used to work with the installed Visual Studio and is broken someday, then the problem could be VS requires system reboot to complete some update.
For quick verification, rename HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup\Reboot to like HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup\Reboot.bak, then re-run cmake which should succeed. Don't forget to rename the registry back and reboot the system if this is the problem.
In my case, I was selecting different version of visual studio in that configuration dialog box whereas I installed different version.
Do select the same version.
Above solutions did not solve this issue for me. After installing node.js from https://nodejs.org/en/download/ apparently a correct version of windows-build-tools was installed
I reinstalled the Visual Studio 2019(my former one is 2017 version ) with all those settings required(my cmake version is 3.23.0),and it works. So try to install different versions.
In my case, the problem was gone after I deleted the previous cmake result directory and then ran cmake again.
if you have installed two or more Windows 10 SDK, delete them excluding latest one.
Try downloading the windows-build-tools package.
npm install --global --production windows-build-tools --vs2015
This step should be the end-all-be-all solution to fixing node-gyp problems. For most people, that’s true. NPM has a package called windows-build-tools that should automatically install everything you need to get node-gyp working, including the Microsoft build tools, compilers, Python, and everything else required to build native Node modules on Windows.

Spectre-mitigated libraries are required for this project, EVEN after i disabled it in options?

I tried DISABLING the Spectre mitigation from the code generation in option, but i still cannot compile a simple hello world driver, why? how can i stop this message and just compile a simple hello world without needing to install these libraries? i tried to even install them using individual components, but there are 100 different versions in there.. tried installing the latest verison but didnt help..
I am using the latest version of visual studio 2019. SDK and WDK are both installed.
this is happening after i made a mistake of upgrading visual studio, everything was fine in my 2017 visual studio..
after you install those libraries( which is necessary ) you can go to project Property then C/C++ the Code Generation look down you going to find Spectre mitigation then you can enable it or disable it, this won't work if you didn't install those libraries which is necessary for the last update of visual studio

How to install OpenCV with contrib modules in Windows 10 on Visual Studio 2019

I am trying to install OpenCV with contrib modules for Visual Studio 2019 on a Windows 10 machine.
I previously had a working version in Visual Studio 2017, but have been unable to get either 2019 or 2017 working recently.
I have been using CMake to install this, adding the extra modules path before generating. Once I have built the ALL_BUILD and INSTALL files I am not sure of where I am meant to add the libraries and include paths and I have found conflicting results between tutorials and neither seem to work.
My code won't include the libraries and says that it can't open the source file.
Here is my code:
#include <opencv2/core/core.hpp>
The error is:
Cannot open source file "opencv2/core/core.hpp"
I have reviewed the following materials to attempt to solve this but there are no up to date guides to include contrib modules nor any that work
OpenCV install tutorial
Previous question not for visual studio
Previous question for 2017 version
Previous question not for visual studio
Youtube guide that worked for 2017 version
this is a problem of the path to include directory.
You can set directly the path in Project setting- C/C++ - General - Additional Include Directory: (c:/opencv/install/include) "Just example". Follow the picture. This will correct the problem with includes.
You have to include additional library Directories as: c:\xxx\xxx\install\x64\vc16\lib
x64 depends if you compiled opencv for 64 or 32 bits, vc16 is Visual Studio 2019.
The Additional dependencies on the following picture provide opencv_MODULE420.lib, where module is core, video, videoio, etc. If you have a problem here, The message symbol is not resolved will occur.
I recently did a tutorial for this here funvision blog HERE
in case you have a problem with installation by CMAKE. The tutorial includes the installation of GSTREAMER as well.

Robert Giesecke's Unmanaged Exports and Visual Studio 2015 Build Error

We have been using Robert Giesecke's excellent Unmanaged Exports library for a while with our Delphi application. We just upgraded to Visual Studio 2015 and it doesn't seem to be working anymore--I can compile the exact same project in VS2013 and it works fine, can access the functions in the DLL, etc. I recompile in VS2015 (exact same code and project) and I get a build failure on the Unmanaged Exports library as shown below:
Task Parameter:SdkPath=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\ (TaskId:44)
Cannot find lib.exe in 'K:\Visual Studio 2015\Common7\IDE\\..\..\VC\bin'. (TaskId:44)
Done executing task "DllExportAppDomainIsolatedTask" -- FAILED. (TaskId:44)
Done building target "RGieseckeDllExport" in project "BWSITwilio.csproj" -- FAILED.: (TargetId:73)
And as such the library will not export the functions in the DLL for me to access in Delphi. I can stay in VS2013 for a while but something seems amiss with the library in VS2015 (maybe looking in the NETFX 4.6 folder??)
I am open to ideas so I can use VS2015--I was about to uninstall 2013 but have to hold off now.
Thanks in advance for any input or advice--it is really this library that has allowed us to continue to use Delphi since we can access anything in .NET with it!
The release notes for version 1.2.7 (dated 16 August 2015) on Nuget include this:
no longer fails the build when it can't find lib.exe
I suspect you are using an older version and can solve your problem by moving to the latest.
You are probably using a version that was built before VS 2015 was released and I'm sure Robert's latest version now supports VS 2015.
For what it's worth, even if lib.exe still cannot be found that's not going to bother you since you don't need a .lib file to import into Delphi.
I was facing the same issue and was able to solve this by manually copying over some Visual Studio 2013 files into the 2015 folder. I searched for lib.exe on my computer and used Beyond Compare with the two application's program file directories.
Open C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\ in
Explorer, select all files, Copy.
Open C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ in Explorer, Paste. When prompted to replace, choose Skip.
After doing this I was able to compile my projects that were using RGiesecke.DllExport in Visual Studio 2015 again.
I can't tell you what specific version of 2013 I had installed because I've since uninstalled, but apparently these files are leftover. I'm running MS VS Community 2015 Version 14.0.23107.0.
Not sure if its relevant at all, but the lib.exe I copied from the 2013 bin folder's version reads 12.0.21005.1.

Web.config fail to transform on TFS 2012

I currently work on a MVC 4.0 project that was upgraded to MVC 5.0 using the official guide.
I use Visual Studio 2012 locally and a publish profile was created for the project.
Locally I call msbuild via the Visual Studio developer command prompt using: msbuild /m /p:Configuration=Dev;DeployOnBuild=true;PublishProfile=Dev my-solution.sln
All projects in the solutions do have a Dev configuration and there is a web.dev.config.
The command line on the server is the same.
So far the difference is that on the server only the visual studio shell is installed (not the full) and we cannot install the full instance of VS2012 on the server.
Also, seeing on the install of TFS on the server, I discovered that only v9.0 target files were installed (Visual Studio 2008). Copying Visual Studio 2012 target files do not fix this problem.
I see 2 solutions so far but searching for a third.
Install full Visual Studio 2012 instance
Update csproj to include a target transformConfigFiles (basically copy and paste the content of the "Microsoft.Web.Publishing.targets" section) or import the file via a declaration inside of the .csproj
Would there be a third solution available?
It is pretty common to install full Visual Studio on your build server. As of VS 2012 you couldn't even run Unit Tests in your build without VS installed.
I'd suggest installing VS and seeing if that fixes the issue.

Resources