RE: VB.NET Win Service throws SecurityException on ServiceController.C



Hi,

Can you tell me where you run your ServiceController.Close() code?
SecurityException is normally thrown because of the .Net Code Access
Permission. Based on my research, there is a ServiceControllerPermission, I
suspect the code group you run may be lack of the
ServiceControllerPermission which caused the SecurityException. To verify
this, you may check SecurityException.PermissionType property. To help us
further understand this problem, can you post the stack trace of this
SecurityException? It may reveal the call path of this failure and find the
culprit.

Since you mentioned the user account is not Administrator, have you tried
to run your code under the Administrator account? Does the problem go away
under the Administrator account? If so, this SecurityException may be
caused by the native Windows service ACL settings permission issue.

Anyway, if we can get the call stack for this SecurityException and other
detailed information to analysis, we will can help you better. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



.



Relevant Pages

  • RE: VB.NET Win Service throws SecurityException on ServiceControll
    ... SC Manager ... SecurityException is normally thrown because of the .Net Code Access ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.platformsdk.security)
  • RE: FileIOPermission problem
    ... SecurityException, which is thrown by .Net Code Access Security engine. ... application's file read I/O permission to all local files. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.clr)
  • RE: Catching Security Exceptions:
    ... event to capture any potential .NET CAS SecurityException in your ASP.net ... you're encountering some CAS specific SecurityException ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: =?ISO-8859-15?Q?Anf=E4nger=3A_serverseitiger_E-Mailversa?= =?ISO-8859-15?Q?n
    ... Ich habe mich wirklich sehr mit ihnen herumgeärgert, genau wegen jener SecurityException. ... Aber meinst du, der Support weiß, was eine Exception ist? ... Eben. ... Aber ich lege dir den Wechsel wirklich sehr ans Herz. ...
    (microsoft.public.de.german.entwickler.dotnet.asp)