Visual Studio 2022 was installed on clean Windows 11 using Web Development profile.
Running existing ASP.NET 6 MVC project in it using F5 throws error in build window
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Error occurred while restoring NuGet packages: The operation failed as details for project MyApp could not be loaded.
Error window contains number of warnings
> Severity Code Description Project File Line Suppression State
> Warning CS8032 An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnalyzerFieldsAnalyzer
> cannot be created from
> C:\Users\kobru\.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll: Could not load type
> 'Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.DiagnosticAnalyzerFieldsAnalyzer`4'
> from assembly 'Microsoft.CodeAnalysis.Analyzers, Version=3.3.3.10305,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35'..
Will this stop code analyzer? How to fix this so that warnings to not appear?
Usually the NuGet package restore failed... error means that the required package doesn't exist in the NuGet global-packages folder or the package installation is corrupted.
The simplest way to resolve this problem is to install/reinstall the package by using the NuGet Package Manager or perform the following command from the Package Manager console in the Visual Studio:
Install-Package package_name
An additional information:
Install and manage packages in Visual Studio using the NuGet Package Manager
Manage packages with the Visual Studio Package Manager Console (PowerShell)
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.
In Visual Studio 2017, I run the remote debugger server (MSVSMON) on my local machine as an administrator so that I can attach the debugger to IIS without Visual Studio needing to run as an administrator.
When running Visual Studio 2019 Preview, the attach the debugger dialog doesn't seem to detect the MSVSMON process and so can't connect.
Is there a new version of MSVCMON?
I've tried using Bing / Google with no luck.
Is it just a bug in 2019 that it can't detect but it should?
Any suggestions how I can resolve this would be appreciated. This is a critical part of my workflow.
I found it. They haven't published a package for the current preview but the debugger is included in the standard install at:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\Remote Debugger\x64\msvsmon.exe
Visual Studio 2019 finally got an Installer Package on the Download-Site of Visual Studio: Visual Studio Remote Tools
This package should be preferred if you need the Windows Service for Debugging another machine.
The link above did not work for me. Downloaded it now from the following page:
Visual Studio 2019 Remote Debugger
In my case, no link worked for me as they all linked me to a download page for Visual Studio 2022.
If you guys are searching for the msvsmon.exe files, I found them at:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Remote Debugger
Both for x64 and x86
Visual Studio 2017 15.7.4
Xamarin Forms, building for Android and using .NetStandard
Error Messages:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(609,2):
error MSB4044: The "GetJavaPlatformJar" task was not given a value for the required parameter "AndroidSdkPlatform".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(609,2):
error MSB4044: The "GetJavaPlatformJar" task was not given a value for the required parameter "AndroidSdkDirectory".
I have attempted:
Cleaning and rebuilding
Deleting "bin" and "obj" and rebuilding
Reinstalling Visual Studio
Reinstalling the Android SDK
Changing Minimum Android Version, Target Android Version, and
Compile Using Version
Adjusting my glasses and staring awkwardly for long periods of time
Any suggestions?
Build Output:
I'm working on Hybrid mobile application using cordova. When I tried to deploy it to Mac using visual studio it gives following error message.
1> ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\0A5IORSI.S5U\packages\vs-mda
1>MDAVSCLI : error - Build failed with error /Users/admin/remote-builds/builds/888/cordovaApp/platforms/ios/cordova/build: Command failed with exit code 69
1>Error : Remote build error from the build server Build failed with error /Users/admin/remote-builds/builds/888/cordovaApp/platforms/ios/cordova/build: Command failed with exit code 69:
Any help or suggestion to fix this?
More info: I'm getting following error message in Remote Server (mac)
error BuildFailedWithError [ '/Users/admin/remote-builds/builds/888/cordovaApp/platforms/ios/cordova/build: Command failed with exit code 69' ]
We recommend to use VS 2015 and not VS2013 since Microsoft has recently changed the Cordova App structure to comply with recent CLI changes. Please open up your project using VS2015 which will upgrade and slight change the current structure of your project.
Let me know if you have any other issues.