linux netcore dotnet command

好久不见. 提交于 2020-03-18 17:10:32

执行 dotnet aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers

报错:

A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/dong/.dotnet/tools/.store/dotnet-aspnet-codegenerator/3.1.1/dotnet-aspnet-codegenerator/3.1.1/tools/netcoreapp3.1/any/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet/install_location].

The .NET Core runtime can be found at:
- https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=manjaro-x64

解决方案:

编辑:    vim ~/.bash_profile

增加    export DOTNET_ROOT=/opt/netcore (.netcore 目录)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!