2

i am trying to run a Net Core Application from python and i am getting this error message:

 error:"A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'D:\\BenchmarkingApp\\BenchmarkingApp\\bin\\Debug\\netcoreapp2.1\\'.\r\nFailed to run as a self-contained app. If this should be a framework-dependent app, add the D:\\BenchmarkingApp\\BenchmarkingApp\\bin\\Debug\\netcoreapp2.1\\BenchmarkingApp.runtimeconfig.json file specifying the appropriate framework.\r\n"

Why do i get this error ?

Python code

import subprocess
csServerPath = "D:\\BenchmarkBuild\server\Server.dll"

def main():
    command = "dotnet D:\\BenchmarkingApp\\BenchmarkingApp\\bin\Debug\\netcoreapp2.1\\BenchmarkingApp.dll 1 2 3"
    process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
    (output, err) = process.communicate()
    print("output:"+str(output))
    print("error:"+str(err))

main()

P.S If you point me towards this link : The library hostpolicy.dll was not found as duplicate, i have the appname.runtimeconfig.json in the same path with the appname.dll

Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
  • Is this problem only while invoking from Python? Does `dotnet D:\\BenchmarkingApp\\BenchmarkingApp\\bin\Debug\\netcoreapp2.1\\BenchmarkingApp.dll 1 2 3` from command line? – skjoshi Aug 28 '18 at 08:29
  • It did not work in the terminal either.I have solved the `hostpolicy` problem by adding the `appname.runtimeconfig.json`.But now i get `Error: An assembly specified in the application dependencies manifest (BenchmarkingApp.deps.json) was not found: package: 'Newtonsoft.Json', version: '11.0.2' path: 'lib/netstandard2.0/Newtonsoft.Json.dll' ` – Bercovici Adrian Aug 28 '18 at 09:08

0 Answers0