Hello to all.
I got a strange problem. My application has a simple method, which if IE enters the state, if it does not respond, this method starts, closing all IE processes, and then the application restarts its work with IE.
Method Code:
foreach (System.Diagnostics.Process exe in System.Diagnostics.Process.GetProcesses()) { if (exe.ProcessName.StartsWith("iexplore")) exe.Kill(); }
Even when debugging my application with administrator privileges, the application sometimes successfully runs this method, and sometimes I get an Access Denied error even as an administrator.
I even encoded my own manifest file, indicating that this application should run as administrator, which I think I understood.
Manifest code:
<?xml version="1.0" encoding="utf-8"?> <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <assemblyIdentity version="1.0.0.0" name="Demo.app"/> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> </application> </compatibility> </asmv1:assembly>
Has anyone had the same problem? How can I fix this strange problem.
thanks
Fábio antunes
source share