The library hostpolicy.dll was not found

前端 未结 13 1148
自闭症患者
自闭症患者 2020-11-30 08:28

I have a simple .NET Core project (console app) that I\'m trying to compile and run. dotnet build succeeds, but I get the following error when I do dotnet

13条回答
  •  遥遥无期
    2020-11-30 09:01

    Update for dotnet core 2.0 and beyond: the file appname.runtimeconfig.json (for both debug and release configuration) is needed in the same path as appname.dll.

    It contains:

    {
      "runtimeOptions": {
        "tfm": "netcoreapp2.0",
        "framework": {
          "name": "Microsoft.NETCore.App",
          "version": "2.0.0"
        }
      }
    }
    

    then dotnet.exe exec "path/to/appname.dll" [appargs] works.

提交回复
热议问题