dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.88k stars 4.89k forks source link

Outdated framework (version 1.1.2) missing #7777

Closed Amoranemix closed 2 years ago

Amoranemix commented 2 years ago

This is about the issue I mentioned in post 8 of https://github.com/dotnet/core/issues/7753 to which I have received no response.

OS : Windows 10. x64 system

I am following a course on Test Driven software development on PluralSight. I was asked to install MS Visual Studion Code and .NET Core, which I have done. The verification for .NET Core installation (typing dotnet in cmd) passed.

After some path problems .NET eventually worked.

The teacher gave some C# code in Visual Studio and used dotnet watch test in the command prompt. Then good stuff happened.

Wen I instruct C:\Users\Knarf\Documents\School\Informatica\Software Testing\TDD - The Big Picture\Code examples\TDD-TheBigPicture-master\FizzBuzz-Start\FizzBuzz.Tests>dotnet watch test I get “[stuff about framework no longer being supported and some other stuff] Starting test execution, please wait... A total of 1 test files matched the specified pattern. Testhost process exited with error: You must install or update .NET to run this application. App: C:\Users\Knarf.nuget\packages\microsoft.testplatform.testhost\15.0.0\lib\netstandard1.5\testhost.dll Architecture: x64 Framework: 'Microsoft.NETCore.App', version '1.1.2' (x64) .NET location: C:\Program Files\dotnet The following frameworks were found: 6.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 6.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Learn about framework resolution: https://aka.ms/dotnet/app-launch-failed To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=1.1.2&arch=x64&rid=win10-x64 . Please check the diagnostic logs for more information.

Test Run Aborted. dotnet watch ❌ Exited with error code 1”

I tried some stuff on docs.microsoft.com/nl-nl/dotnet/core/runtime-discovery/troubleshoot-app-launch?pivots=os-windows to resolve the issue. (en-us i.s.o. nl-nl looks like the English version of the page.)

The link leads to a download of version 1.1.13, which is allegedly outdated. Should I install it anyway ?

I didn’t try ‘Binaire bestanden downloaden’ because it told me to use a file (dotnet-sdk-6.0.400-win-x64.zip) that looks identical to what I already have.

I also didn’t try forward-rolling because of the warning that that could change the behaviour of the application.

How can I use dotnet watch test on the exercise project ?

rzikm commented 2 years ago

The project you are trying to run was written against very old .NET version, which is not installed with the latest installer. If you want to run it, you need to either update it and rebuild against .NET 6 or you need to install the (now outdated) 1.1.13 version of the runtime.

Amoranemix commented 2 years ago

OK. Which of those solutions would be the best ? I don’t know how to update and rebuild a project.

rzikm commented 2 years ago

installing older runtime is probably easier then.

Amoranemix commented 2 years ago

I wanted the installer of 1.1.13 to install that version in C:\Program Files\dotnet\dotnet 1.1.13, but the installer refused and seems to have installed it in a secret location.

The command dotnet –info yields 6.0.400 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

The exercise project works. I don’t know problems this secret installation will cause, but it seems to have solved this one. Thanks.

rzikm commented 2 years ago

The installation is not "secret" this is how installing multiple runtimes at once is accomplished. You can see that the 1.1.13 runtime has been installed and its files can be found under C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.13

Since this has been resolved, I will close this issue.