Build fails [dotnet The application '--version' does not exist]
Build fails and the error message says that the dotnet --version doesn't exist. The build was working fine till a week before, no changes was done. Please find the build log below.
dotnet --version
The command could not be loaded, possibly because:
* You intended to execute a .NET application: The application '--version' does not exist. * You intended to execute a .NET SDK command: A compatible .NET SDK was not found.
Requested SDK version: 2.2.100
global.json file: C:\projects\planter\global.json
Installed SDKs:
Install the [2.2.100] .NET SDK or update [C:\projects\planter\global.json] to match an installed SDK.
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
3.0.103 [C:\Program Files\dotnet\sdk]
3.1.202 [C:\Program Files\dotnet\sdk]
3.1.426 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
5.0.416 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]
Command exited with code -2147450735
- build_fails.PNG 30.3 KB
- log.txt 1.16 KB
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Owen McDonnell on 06 Dec, 2023 06:28 PM
Are you subscribed to the technical updates newsletter?
.Net core 2 was deprecated in the last image update as mentioned in the newsletter.
In the near term you can revert to
Previous Visual Studio 2019
or 2022 image to get your build working again, but of course this will only work until a new image update.You could also add the following script to the
install
stage of your build.2 Posted by ebenezarp on 07 Dec, 2023 05:46 AM
Hi Owen,
Thanks for the response. I tried changing to Previous Visual Studio 2019, 2022 image and also added this script to my install stage. Still the same issue. I have attached screenshots (of the environment settings and build outcome). I'd appreciate your help.
Note: I am not subscribed to the newsletter. I will check and subscribe to it.
Support Staff 3 Posted by Owen McDonnell on 07 Dec, 2023 04:13 PM
Does your repo have an
appveyor.yml
config file in it, or perhaps a custom named config file, which would be overriding those ui settings?4 Posted by Sathish B on 08 Dec, 2023 05:01 AM
Hi Owen,
Ebenezer and I working in same team. Do we need to remove the appveyor.yml file to apply the given script?
Support Staff 5 Posted by Owen McDonnell on 08 Dec, 2023 06:33 AM
First, I would recommend taking a look at the relevant documentation here.
and you can specify the image like this,If you are currently using a configuration file, you can run that install script in an
install
block like this,Again, the docs demonstrate this and more.
6 Posted by ebenezarp on 11 Dec, 2023 04:54 AM
Hi Owen,
This issue is now resolved. Thank you for your valuable guidance in fixing this. I appreciate your help.
Support Staff 7 Posted by Owen McDonnell on 15 Dec, 2023 06:16 AM
No worries, thanks for updating.
Owen McDonnell closed this discussion on 15 Dec, 2023 06:16 AM.