Click here to Skip to main content
16,018,294 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Terminal is returning the following:

"Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET program, but dotnet--r does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH."

Goal is to create a single executable file. This is what I input in terminal:

dotnet -r publish win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true --output "C:\Users\C124\OneDrive\Desktop\Single\"

What I have tried:

I am able to publish using Publish in Build menu but this gives me a setup file which is not what I want. Instead, I want one executable ready to go, not a setup file. Thank you so much!
Posted
Updated 19-Aug-24 17:10pm
v4

1 solution

The "publish" has to be immediately after the "dotnet". You have "-r" in there. That has to be moved. The command must come first before any other options.
dotnet publish -r win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true --output "C:\Users\C124\OneDrive\Desktop\Single\"
 
Share this answer
 
Comments
Pada Temp 20-Aug-24 3:15am    
Ah thank you. It works better, but I get a new error MSB4062: The "Microsoft.Build.Tasks.RequiresFramework35SP1Assembly" task could not be loaded from the assembly Microsoft.Build.Tasks.Core
Dave Kreskowiak 20-Aug-24 9:16am    
The first thing you do is Google the error message: error msb4062 the microsoft.build.tasks.requiresframework35sp1assembly - Google Search[^].
Then you start reading the links and comparing against your situtation.
PIEBALDconsult 20-Aug-24 10:41am    
Then brew a nice hot cup of tea.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900