I am running Visual Studio 2019 on a MacBook Air M1 and I have installed and downloaded the .NET Core SDK. When I am trying to run an asp.net solution from the terminal with the 'dotnet run' command I get the following message:
Failed to load /opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib, error: dlopen(/opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
The library libhostfxr.dylib was found, but loading it from /opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib failed
Installing .NET prerequisites might help resolve this problem.
I have installed and downloaded both the .net SDK for 3.1, 5.0 and 6.0. The solution runs fine from the play button in Visual Studio, but it will not work with the command.
I am just wondering if anyone knows if there is a workaround on this?
Thanks in advance!
I am trying to setup visual studio code for c# on Manjaro Linux
I have installed VSC and .NET core 5.0 SDK through the package manager.
The c# add-on is installed in VSC
With all of these installed correctly, why can't I use the dotnet command in the terminal?
Every time I try I get this error; sh: dotnet: command not found
By default, dotnet is installed to usr/share/dotnet. Check if this path is added to the env var $PATH.
If you can't find it there, you could run on a terminal:
whereis dotnet
If no dotnet is found, the tool wasn't properly installed.
Also, did you close and reopen the terminal window after installing the SDK, as the instructions stated?
I'm working on an api in .net core 5 in wsl2 and I followed all the documentation to install the entity framework core tools.
when i run
dotnet tool list -g
it prints
Package Id Version Commands
--------------------------------------
dotnet-ef 5.0.7 dotnet-ef
but when i run
dotnet ef
or any of its child commands, I get this
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-ef 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.
now, i've looked in my path and it looks like when i ran
dotnet tool install --global dotnet-ef
it installed it under my C drive instead of inside wsl2 which I think might be the problem but I don't understand why running that within ubuntu would install it into my windows directories but this is the line from my path
/mnt/c/Users/ethan/.dotnet/tools
so i guess my question is, is the issue that it unstalled under my windows directories and if so how do i either force it to install on ububtu or change my path and if not what is happening.
i found this post:
Cannot find command 'dotnet ef'
and running
export PATH="$PATH:$HOME/.dotnet/tools/"
makes dotnet ef work until i start a new terminal session so i wanted to double check the right way to make this a permanent fix, according to this article i found https://astrobiomike.github.io/unix/modifying_your_path the best way to handle it is just to add it to your bash_profile or zshrc so thats what i did
I've been working with AWS lambdas for a few months. I was working with a lambda and it was fine at the end of the day. I came back to work on it the next day, and I can't get Visual Studio to even start the application using the Mock Lambda Test Tool.
I ended up creating an empty lambda that just returns the input (the standard project code that AWS gives you as a template) and that won't even run. I hit the play button to star the Mock Lambda Test Tool, it looks like it will run for a couple seconds, then it closes down. The command window does not even pop up.
This is the code from the template project.
public string FunctionHandler(string input, ILambdaContext context)
{
return input?.ToUpper();
}
This is all I get in the output window of VS:
The target process exited without raising a CoreCLR started event.
Ensure that the target process is configured to use .NET Core. This
may be expected if the target process did not run on .NET Core. The
program '[16700] dotnet-lambda-test-tool-2.1.exe: Program Trace' has
exited with code 0 (0x0). The program '[16700]
dotnet-lambda-test-tool-2.1.exe' has exited with code -2147450726
(0x8000809a).
I have tried re-installing the AWS toolkit, and also tried re-installing Visual Studio. This is an issue with VS 2017 and VS 2019. I just installed 2019 to see if that would fix the issue. Any help would be appreciated.
I came to this question having the very same issue. After installing AWS Toolkit I found that the lambda test tool was not installed and therefore I got the same error just as the OP. The only difference is that I was targeting .Net Core 3.1 and therefore I needed amazon.lambda.testool-3.1. However this answer should work for both scenarios.
Unfortunately I did not have the same luck as the OP of having a nice co-worker that could give me the files I needed. So, if this is also your case please continue reading.
In the official project site, which can be found here, there are the instructions to install the tools. It also says that installing the latest version of AWS Toolkit should be enough to have the tools installed (it was not in my case and probably in yours).
It says that in order to install the tools you should run the following commands:
dotnet tool install -g Amazon.Lambda.TestTool-3.1
or
dotnet tool install -g Amazon.Lambda.TestTool-2.1
depending on which tool you need.
However, running these commands fails with the following message:
The tool package could not be restored.
Tool 'amazon.lambda.testtool-2.1' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
And since the project is still in preview I just had to find the latest stable version in order to specify it in the command. For .net core 3.1 here is the nuget site, there I found version 0.10 to be the latest, so the command should look like:
dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1
I have faced the same issue and when i tried to install dotnet-lambda-test-tool-3.1.exe using command prompt I got this issue:
Failed to create shell shim for tool 'amazon.lambda.testtool-3.1': Command 'dotnet-lambda-test-tool-3.1' conflicts with an existing command from another tool.
Tool 'amazon.lambda.testtool-3.1' failed to install.
And I did the following to fix issue
Deleted the dotnet-lamda-test-tool-3.1.exe from the installed folder (C:\Users%USERNAME%.dotnet\tools\dotnet-lambda-test-tool-3.1.exe)
Run dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1 on cmd.
I have faced the same issue and got errors like "dotnet-lamda-test-tool-2.1.exe has exited with code.."
I did the following to fix the issue
Removed the dotnet-lamda-test-tool-2.1.exe from the installed folder
(C:\Users%USERNAME%.dotnet\tools\dotnet-lambda-test-tool-2.1.exe)
Removed the [amazon.lambda.testtool-2.1] folder as well
(C:\Users%USERNAME%.dotnet\tools\tools.store\amazon.lambda.testtool-2.1)
Installed dotnet tool from Developer command prompt using the command
[install -g Amazon.Lambda.TestTool-2.1]
Run the project. It is working
I have seen this issue many time on my system with dotnet-lambda-test-tool-6.0. Only one fix work for me
Remove dotnet-lambda-test-tool-6.0.exe from C:\Users\username.dotnet\tools
Open Command prompt from C:\Users\username.dotnet\tools
run command dotnet tool install -g Amazon.Lambda.TestTool-6.0
For anyone else that hits this same issue, it had to do with the the AWS toolkit install. I did not modify it, but somehow it was no longer working. I tried un-installing and re-installing, but it was still having issues running it. A co-worker sent me the exe and subdirectory that was setup on his machine under C:\Users\%user%.dotnet\tools. The exe is located in this directory, and there is another folder under .store for amazon.lambda.testtool-2.1. That directory had different folders and files than what I was able to install. So I copied in what he had and it worked. There might be a profile file associated to the tools install that points to these folders and files that might need to be modified. Since I was able to fix it with this, I didnt look any further into that.
I had the same issue with my .NET 6.0 lambda project. I installed the tool by executing dotnet tool install --global Amazon.Lambda.TestTool-6.0 --version 0.12.6 as suggested on https://www.nuget.org/packages/Amazon.Lambda.TestTool-6.0
Just ensure it is installed at %USERPROFILE%\.dotnet\tools\dotnet-lambda-test-tool-6.0.exe
I got the same issue with VS2019 with lambda design in 3.1 version and in Output window getting error
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
Then checked the folder having multiple version of lambda-test-tool in path
C:\Users{username}.dotnet\tools
I removed all the lambda-test-tool and installed the required tool only with version 3.1 by command in developer command prompt:
dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1
Then I can able to debug the lambda
I have install and repair dotnet sdk 1.1 and dotnet sdk 2.0 preview with visual studio preview,
Now when I type any command CLI, I have no result.
PS C:\Codes\Anna\src\Web\test> dotnet new
PS C:\Codes\Anna\src\Web\test>
I have test to run with administrator but this not working.
Or with this command
PS C:\Codes\Anna\src\Web\test> dotnet --info
PS C:\Codes\Anna\src\Web\test>
My path is :
PS C:\Windows\system32> (get-command dotnet).Path
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\dotnet.exe
The path is wrong. C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\dotnet.exe is only used to run compiled .Net Core 1.0 applications. You want to use C:\Program Files\dotnet\dotnet.exe, which will let you run the SDK commands, like dotnet new.
I don't know how did the wrong dotnet.exe get into your PATH. Are you sure you installed the SDK, and not just the runtime?
If you think it could be a bug in the installer, you might consider reporting it at the dotnet/core-setup repo.