Sorry for posting this in here. I googled solutions but nothing worked.
I have a Asp .net MVC 4 project which is a scraping project that uses phantomjs.
Now I deployed it in shared windows plesk hosting. But the error says “This program is blocked by group policy”. I suspected phantomjs is being blocked.
I attached a screenshot below.
4
Answers
From the stack trace, it appears that the error occurs when Selenium attempts to spawn a new process. Most likely spawning a process from a web app is not allowed by the hosting provider.
It seems that Selenium cant attempts to spawn a new process in hosting provider or you should connect as administrator :
if you are hosting in a specific domain click application pool->click on your domain(example.net)->advance setting ->Check you identity in process Model:you should login as administrator User..
if your website on default application pool you should click on Default Web Site->basic setting ->connect as : administrator User
This can be done by two ways.
1 – Add following code in WebConfig
<system.web>
<trust level="Full" />
</system.web>
2- Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution in Visual Studio
Find “DotNetCompilerPlatform” and uninstall it
This answer I found on GoDaddy’s community forums, but I thought it would be helpful to share in case it solves the issues for other hosting providers. If the post still exists, view it here => https://www.godaddy.com/community/Managing-Web-Hosting/Problem-with-Windows-Web-Hosting-quot-this-program-is-blocked/m-p/14513#M321
From User “mojosound”
After making these changes to the Web.Config and Publish settings, everything started working in the hosting environment.