So you write your nice and fancy service and are all excited to distribute it to your client. You don’t feel like creating an installer for it, that seems like overkill. You just send a zip file with a batch file that calls installutil to register the service. Easy right?
Well, your client calls and complains that get the following error when running installutil aka your batch file:
Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly ‘file:///D:servicesmyservicehost.exe’ or one of its dependencies. Operation is not support. (Exception from HRESULT: 0x80131515).
I am sure you will start scratching your head and immediately blame them missing a dll or maybe the client ran it wrong. Maybe they have it in the wrong directory? Seems feasible, right? Wrong.
It turns out that Windows was protecting them. Windows doesn’t like files from other computers very much, especially not executables. They get a special stay away from me flag.
So, how do I fix this? Easy. Just open the properties dialog on the exe/service you extracted and hit the UNBLOCK button. Now installutil will work great!
Happy Coding!
Thnx.
Gracias! Me funcionó perfecto!
Thank you, just what I needed.
Thanks a lot!
Thanks!
Thaaaaaaaaaaaaanks 🙂 Its work.
Worked for me. Thanks!
Incredible but true !!!
Easy, fast and really useful.
Thanks a lot
Excellent! Thanks a ton.
Mitch
Awesome… It worked.. !!!
You are my idol.
Thanks Man!!
Great. That work well 🙂 thanks alot
Awesome
Microsoft create all kind of problems when it comes to security.
I think that would be nice to have descriptive errors instead “HRESULT: 0x80131515”. No system ir perfect right?
Thank you Brian 😉
Happy to help.
Thanks a lot!
THANK YOU VERY MUCH MY TEACHER (HOCAM)
Excellent a Lot
After 5 years this is stil relevant. Many thanks.
Thanks so much, it’s works.
Thanks
Thank you! I was scratching my head for hours. Most of other websites including stackoverflow are full of crap about this issue.
Thank You!
Worked!
Thanks Buddy,Was already stuck to just a simple task
Gracias
you are the man
Excellent solution. saved so much time for me.
Excellent solution. It saved my time.
Excellent solution. It saved my time.