Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When launching AppInspector.dll "error occurred while loading required library hostpolicy.dll" is displayed #124

Closed
sartajshaikahmed opened this issue Jan 30, 2020 · 9 comments

Comments

@sartajshaikahmed
Copy link

Describe the bug
When launching AppInspector.dll "error occurred while loading required library hostpolicy.dll is displayed"

To Reproduce
Steps to reproduce the behavior:

1.Download "ApplicationInspector_windows_1.0.24.zip" and unzip
2.Execute command "dotnet AppInspector.dll"

Expected behavior
Inspector should be launched

Actual behavior
Following error is displayed

Failed to load the dll from [C:\Users\sartaj.ahmed\Downloads\ApplicationInspector_windows_1.0.24\ApplicationInspector_1.0.24\hostpolicy.dll], HRESULT: 0x800700C1
An error occurred while loading required library hostpolicy.dll from [C:\Users\sartaj.ahmed\Downloads\ApplicationInspector_windows_1.0.24\ApplicationInspector_1.0.24]

Screenshots
If applicable, add screenshots to help explain your problem.
image

image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@sartajshaikahmed
Copy link
Author

@guyacosta I would be really thank full, if you could provide your inputs on it. I know somewhere I am doing some silly mistake

@bilalshahzad139
Copy link

I am facing same issue. I downloaded latest release. Unziped in a folder and executed command from same folder like this
dotnet Appinspector.dll
It gives following error
HRESULT: 0x800700C1
An error occurred while loading required library hostpolicy.dll

I tried by providing a source code folder too but same error
dotnet Appinspector.dll analyze -s E:\myproj

I matched hostpolicy.dll version with what we've in .json file and that are matching.

@yaziid
Copy link

yaziid commented Jan 30, 2020

I faced the same problem, using Powershell weirdly works !

@guyacosta
Copy link
Contributor

The error seems related to authenticode signing but the file is signed and the certificate is valid as shown in the Digital Signature for file properties. As long as the file has not been modified etc. it should work but I'll try to reproduce it -no luck so far. One option is to install the certificate in the file properties by selecting the signature and see if that addresses the issue. Let me know. I'll continue to investigate.

@bilalshahzad139
Copy link

@guyacosta I downloaded master branch, built it and tested from its bin folder and it not throwing exception and processing the files.

@guyacosta
Copy link
Contributor

guyacosta commented Jan 30, 2020

Good your not blocked. I created a Windows 10 VM and downloaded the 1.0.24 release etc. and did not see an issue. Again the signature is valid but for those having the issue there is some helpful information here in this support article indicating an AppLocker rule creation issue for that error or when have been modified from the time of signing. I''ll continue to look for a cause for the behavior that does not fall into one of those categories a little longer. Anyone seeing the issue on an older version of Windows? The OS was not reported and that would be helpful.

@guyacosta
Copy link
Contributor

The only other related item found was you may have .net core 3.1 installed but not 3.0 which the application release and solution are targeted to. That's why rebuilding it solved the issue for you. I will be upgrading the solution target to 3.1.

@efriese
Copy link

efriese commented Feb 4, 2020

What is the solution to fixing this issue? I cloned the master branch and built via "dotnet publish -c Release -r linux-x64". When I run "dotnet AppInspector.dll" from bin/publish I get the libhostpolicy.dylib missing error. This is a fresh install of .NET Core 3.1 on Catalina

@guyacosta
Copy link
Contributor

See #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants