VSCode Omnisharp server A .NET 6 SDK for x86_64 was not found - asp.net

Omnisharp does not seem to recognize my installed .NET sdk (version 6.0.408).
I have tried manually adding this path via settings to Omnisharp: SDK path i.e.:
C:\Program Files\dotnet\sdk\6.0.403
I have also tried reinstalling the SDK and even VSCode.
This does not seem to solve the issue however, and I am unable to run my asp.net application on VSCode. Running dotnet run from the terminal is fine.

TLDR: Both .NET SDK versions and Visual Studion versions needed to be x64.
Here was the exact error I was seeing in the Output Window:
[ERROR] A .NET 6 SDK for x86_64 was not found. Please install the
latest x86_64 SDK from
https://dotnet.microsoft.com/en-us/download/dotnet/6.0.
[ERROR] Error: OmniSharp server load timed out. Use the
'omnisharp.projectLoadTimeout' setting to override the default delay
(one minute).
When I realized there was a mismatch between my .NET SDKs and Visual Studio Code in terms of being x86 and x64, I did the following:
Deleted the bin/obj folders and .vscode folders in my VS Code project.
Uninstalled my .NET SDKs via Windows (Setings > Apps).
Uninstalled Visual Studio Code via Windows (Setings > Apps).
Installed .NET 7.0 x64 and .NET 6.0 x64.
Opened PowerShell and ran dotnet --info to make sure my .NET runtime and SDK were appearing correctly.
Installed Visual Studio Code x64.
Used PowerShell and cd'd to my project folder. Did a dotnet restore. Then launched Visual Studio Code using code . command.
I could then use the most current version of the VS Code extension (v1.25.2).

Uninstalling and then installing the VSCode extension C# for Visual Studio Code solved the issue for me.

I had the same problem and just solved it. Copy and pasting this from a Youtube comment I just finished writing, so it might sound funny out of context, but the good bits are in there. Hope it helps.
Installed dotnet 7.0, but then it said dotnet 6 was missing...
So I deleted the script asset, exited Unity, went back to their website and installed Net 6.0.403
Error still happened.
I'll note this seemed to push a script compiling error out to Unity in the inspector window, as well.
Deleted the script asset again, exited Unity again, then uninstalled both dotnet 7 and dotnet 6.
Then I reinstalled dotnet 6.
Into unity, made a new script, opened it, and this time no error message about missing net 6.
I just started yesterday. Literally. So if my solution is trash, I'll laugh with you lol. Best of luck.

Related

dotnet build stopped working after VS 2022 upgrade

I upgraded Visual Studio Community to the final release, and it stopped working. Specifically, I could generate a new project, but when I try to load it, it gave me an error
Critical Project 'SdkTest' load failed| [MSB4236] The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. ...\SdkTest.csproj
Even though build and run worked fine
I ran "repair" on VS2022, and it seems to be working now from Visual Studio. However, dotnet --info doesn't show any SDKs; only runtime; and dotnet build or dotnet new give an error:
C:\Code>dotnet new console -o myapp
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
* You intended to execute a .NET program:
The application 'new' does not exist.
* You intended to execute a .NET SDK command:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
I even reinstalled .NET 6 and I see it in the list of applications (along with older SDKs). I checked the path, and I see everything that I expect to see:
C:\Program Files (x86)\dotnet\
C:\Program Files\dotnet\
C:\Users\me\.dotnet\tools
I am running Windows 11.
It's known bug in VS2022 installation.
Problem is that dotnet you access is located inside Program Files(x86)/dotnet, but all sdk's are located in Program Files/dotnet. You simply need to edit PATH environment variable so Program Files/dotnet goes before Program Files(x86)/dotnet. If you don't see Program Files(x86)/dotnet in user environment variable (which is likely to happen) then edit system environment variable (located below)
Example with screenshots: https://stackoverflow.com/a/44272417/10339675

'{{FSharpCoreShippedPackageVersion}}' is not a valid version string

I just upgraded to Visual Studio 2019 version 16.5.0 Preview 2.0. It seems to have broken building and running .NET Core projects in F# with the dotnet command line tool.
Previously dotnet build and dotnet run worked fine. Now either one produces this error message (wrapped for readability):
C:\Program Files\dotnet\sdk\3.1.200-preview-014883\NuGet.targets(124,5):
error : '{{FSharpCoreShippedPackageVersion}}' is not a valid version string.
My projects don't have the string FSharpCoreShippedPackageVersion anywhere in them that I can see (including in the .fsproj files). I also looked in the referenced NuGet.targets file and couldn't find FSharpCoreShippedPackageVersion in it either.
Using dotnet new console --language=F# also fails, telling me to restore NuGet packages, but attempting dotnet restore gives the same error message.
What can I do to fix this?
UPDATE: This issue appears to be fixed in the current version of the preview:
3.1.200-preview-014977
If you update Visual Studio 2019 Preview, you shouldn't need this workaround anymore.
I found a workaround:
Run dotnet new globaljson in the project root folder
Edit the global.json to use .NET Core 3.1.101 instead of 3.1.200-preview-014883.
It appears that the combination of VS 2019 Version 16.5.0 Preview 2.0 and .NET Core 3.1.200-preview-014883 causes this problem.

Issue to install core3.1 VSBuildTools offline installer 2017 using workload

When we trying to install the offline installer which is generated using below workload getting exited with errorlevel 1 . Any advise please?
.\vs_buildtools__140882496.1541481122.exe --layout .
--add Microsoft.VisualStudio.Workload.MSBuildTools
Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools
Microsoft.VisualStudio.Workload.WebBuildTools
Microsoft.VisualStudio.Workload.NetCoreBuildTools
Microsoft.Net.Component.4.5.2.TargetingPack
--lang en-US
Error
Something went wrong with the install.
If the issue has already been reported on the Developer Community, you can find solutions or workarounds there. If the issue has not been reported, we encourage you to create a new issue so that other developers will be able to find solutions or workarounds. You can create a new issue from within the Visual Studio Installer in the upper-right hand corner using the "Provide feedback" button.
================================================================================
Package 'Microsoft.Net.4.7.2.FullRedist,version=4.7.3062.3' failed to install.
Search URL
https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.Net.4.7.2.FullRedist;PackageAction=Install;ReturnCode=16389
Details
Command executed: "C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.Net.4.7.2.FullRedist,version=4.7.3062.3\dotNetFxLatest-x86-x64-AllOS-ENU.exe" /q /norestart /KeepAUPaused /ChainingPackage Visual_Studio_15_Setup /CEIPconsent /log "C:\Users\Administrator\AppData\Local\Temp\dd_setup_20200103140616_004_Microsoft.Net.4.7.2.FullRedist.log"
Return code: 16389
Return code details: Unknown error (0x00004005)
Log
C:\Users\Administrator\AppData\Local\Temp\dd_setup_20200103140616_004_Microsoft.Net.4.7.2.FullRedist.log
Impacted workloads
.NET desktop build tools (Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools,version=16.4.29511.114)
MSBuild Tools (Microsoft.VisualStudio.Workload.MSBuildTools,version=16.0.28516.191)
Web development build tools (Microsoft.VisualStudio.Workload.WebBuildTools,version=16.4.29409.204)
Impacted components
.NET Framework 4.7.2 development tools (Microsoft.Net.ComponentGroup.DevelopmentPrerequisites,version=16.3.29207.166)
.NET Framework 4.7.2 targeting pack (Microsoft.Net.Component.4.7.2.TargetingPack,version=16.0.28517.75)
C# and Visual Basic Roslyn compilers (Microsoft.VisualStudio.Component.Roslyn.Compiler,version=16.0.28714.129)
MSBuild (Microsoft.Component.MSBuild,version=16.4.29429.68)

Create new Core 2.0 web project, core libraries can't be loaded

Visual Studio 2017, when creating a new ASP.NET Core Web project with ASP.NET Core 2.0, e.g. React w/ Flux preset, the core dlls fail to load. Nuget package restore does nothing, but I can uninstall and reinstall the AspNetCore.All package. If I do this, I get the following error:
Error MSB3073 The command "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" exited with code 8. ReactTest [PATH]\source\repos\ReactTest\ReactTest\ReactTest.csproj 33
I don't suspect this is a real error, I suspect it's because of the initial package install failure. I have been able to perform this operation on other devices, so I know that I am following the correct processes and have the correct SDKs and toolsets installed. I have repaired, and uninstalled / reinstalled Visual Studio 2017 with reboot and nothing has fixed this.
I had the same problem. My version of node.js was ancient (in web terms...). I installed the latest version (8.8.1) and everything was fine.

The .NET Core SDK is not installed or cannot be found under the path

When compiling .Net Core RC2 project under VS 2015 I am receiving following error
GETSDKTOOLINGINFO : error : The .NET Core SDK is not installed or
cannot be found under the path C:\Program Files\dotnet\bin. These
components are required to build and run this project.
Files do exist under that directory.
Also when I input dotnet into command line I do see it's prining proper version number and stuff.(.NET Command Line Tools (1.0.0-beta-001598)
Any idea how to resolve the issue?
Remove all older versions of core
Unistall Microsoft .NET CLI for Windows from control panel if it exists. This helped me.
After you install RC2, Make sure your control panel shows ONLY these for .Net Core
Microsoft .Net Core 1.0.0 RC2 - VS 2015 Tooling Preview 1 (1.0.20513.14)
Microsoft .Net Core 1.0.0 RC2 - SDK Preview 1 (x64) to be version 1.0.0.2702
Hope this helps.
If you install VS 2015 and VS 2017 side by side you may end up with a situation where you have:
.NET Core 2015 x86
.NET Core 2017 x64
(Take a look in Control Panel > Programs and Features)
When you try to open a VS project/solution targeting .NET Core you get the error message described in this posting.
If you search on this error you may get taken to this page:
https://github.com/aspnet/Tooling/blob/master/known-issues-vs2015.md#missing-sdk
But the solutions described there don't work (such as editing your PATH to exclude the x64 version.)
HOWEVER .. from that page, download the x86 version of .NET x86
".NET Core 1.0.1 SDK 1.0.0-preview2-003131 download links"
CLOSE any open sessions of VS. Then uninstall .NET Core 2017 x64 and then install .NET Core x86 version you just downloaded.
Your Control Panel > Programs and Features should now look like this:
Control Panel - After
What this effectively does is that now all your .NET Core is x86 rather than a mix of x86 and x64.
Reboot not required.
Repair Microsoft .Net Core 1.0.0 RC2
In case the previous answer doesn't help you because the right version of dotnet core (SDK & Tools) is already the only one installed (I was in that case):
Repair both and that should fix your problem.
For anyone getting similar messages, here is the official Issue page in the CLI repo.
Of the mentioned workarounds, one is to remove the 'DotNet CLI' entries from the installed programs.
New update: 2021 Jan Update VS Code/ VS 2019/CLI: Get/Download LATEST CORE version
here
A) first check what you have --> run dotnet --info for runtime & dotnet --list-sdks for SDK, from the command line, then B) check which ones can be un/re-installed dotnet-core-uninstall list download MS tool from here IT WILL CLEAN uninstall correctly,
Now you can re/install .Net Core make sure you close your VS Code / VS Studio, and then do your un-install/install
(Windows Skip) for Mac only add your /usr/local/share/dotnet to PATH in your ~/.bash_profile
the install from here on Microsoft
To Fix Path for CLI commands, run these below it will add it to your path:
set DOTNET_ROOT=%USERPROFILE%\dotnet
set PATH=%USERPROFILE%\dotnet;%PATH%
set DOTNET_MULTILEVEL_LOOKUP=0
Check for dotnet --list-sdks.In my case there were none.
Installing the .NET Core sdk worked for me.
If above answers not works
Try this
If you installing 64 bit SDK's, Do uninstall x86 bit SDK's from the control penal
And Try in Visual Studio
It worked from me

Resources