Reputation: 31
This is my first time posting so bear with me.
I was learning C# utilizing VS Code with no issue until .NET 8.0 was released. After the release, none of my C# projects would open, so I uninstalled VS Code and all .NET related programs to create a clean slate.
I have now downloaded and installed and then uninstalled the .NET SDK package at least 6 times in using various methods including winget and every time I get the same error message shown in the screenshot attached.
This is the error message I get:
The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.Sdk". Exception: "System.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I do not understand what I am doing wrong and I am nearly at my wits end because this just doesn't make any sense. I am relatively tech savvy, but the text of this is less than helpful.
Hope someone can assist. Thanks
I have tried installing, uninstalling at least 6 times downloading directly from the website and also using winget to download and install and it is always the same error message. The latest attempt as illustrated in the attached screenshot was my attempt just to create a new C# project and I can't even do that let alone open the projects I had before this newer version was released.
UPDATE###########
still having the same issue and decided to walk away from it for a few days for the holidays etc. First, thank you to eferyone that has contributed it really is appreciated. Following the advice of "Filmore" and just typed dotnet --info and I noticed that even when executing that I still get the same error.
I'm not sure whether the screenshot i took is going to be visible so i have also copied and pasted the text here. The "block quote" material is the error message. The remaining text provides information about what sdks and runtimes were installed. None of this may be helpful but I am still no closer to a solution, so again any assistance is greatly appreciate d and i hope this additional information is helpful although it may have muddied the waters further. thanks
Microsoft Windows [Version 10.0.22631.2861]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Danie>dotnet --info .NET SDK: Version: 8.0.100 Commit: 57efcf1350
System.Text.Json.JsonReaderException: '0x00' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0. at
System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader&
json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at
System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at
System.Text.Json.Utf8JsonReader.ReadSingleSegment() at
System.Text.Json.Utf8JsonReader.Read() at
Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.Utf8JsonStreamReader.Read()
at
Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.ReadStringDictionary(Utf8JsonStreamReader&
reader) at
Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.ReadLocalizationCatalog(Stream
localizationStream, JsonReaderOptions readerOptions) at
Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.ReadWorkloadManifest(String
manifestId, Stream manifestStream, Stream localizationStream, String
manifestPath) at
Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.LoadManifestsFromProvider(IWorkloadManifestProvider
manifestProvider) at
Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.Create(IWorkloadManifestProvider
manifestProvider, String dotnetRootPath, String sdkVersion, String
userProfileDir) at
Microsoft.DotNet.Workloads.Workload.List.WorkloadInfoHelper..ctor(Boolean
isInteractive, VerbosityOptions verbosity, String targetSdkVersion,
Nullable`1 verifySignatures, IReporter reporter,
IWorkloadInstallationRecordRepository workloadRecordRepo, String
currentSdkVersion, String dotnetDir, String userProfileDir,
IWorkloadResolver workloadResolver) at
Microsoft.DotNet.Cli.WorkloadCommandParser.GetWorkloadsVersion(WorkloadInfoHelper
workloadInfoHelper) at
Microsoft.DotNet.Cli.CommandLineInfo.PrintInfo() at
Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan
startupTime, ITelemetry telemetryClient) at
Microsoft.DotNet.Cli.Program.Main(String[] args)
Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71 RID: win-x64
.NET SDKs installed: 8.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: None
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download
C:\Users\Danie>
Upvotes: 3
Views: 3541
Reputation: 31
Problem solved. Basically I ran the repair function from the sdk install and had to manually provide the file path for about 10 or so installation files that it could not find. Unfortunately, i did not keep a record of the files that i had to reinstall as when I was doing this, I was thinking in the back of my head "this is not going to work" Obviously i was wrong. What i can say, is that when I was repairing, the installation I would get a popup stating that a certain file could not be found and I needed to browse for the file. So I took the first 10 or so alpha numeric characters, did a search of all files on my system until i found the missing file, noted the file path, and then with the browse function of the repair module, located the file and waited for the next missing file. I shouldn't say missing, because they were there, just not in the correct location/directory. Not sure how or why that happened, but it is functioning like normal. Thank you everyone for your comments and assistance. Hope my feedback is useful.
Upvotes: 0