Windows Vista Logging App Block Security Error!

Topics: Logging Application Block
May 7, 2008 at 9:46 PM
First - The Error: "The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file."

Second - The Details: "System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security."

The Offending Line of Code: logEntry.Categories.Add("BLL")

I'm a developer run VS2008 Pro on Windows Vista Business and am attempting to run a .net app I've brought up from my XP dev machine .. running it locally (Via the option to 'View in Browser') ... runs without error on the XP machine ....

I'm logged in as a member of the admin group ... I've made the aspnet user a member of the admin group ... I've added aspnet user as a permitted user to write to the event logs via regedt32 ... I've checked the app, it runs with the highest trust level allowed ...

How do I get my app (now running wonderfully well on XP) to run on Windows Vista for Business?

May 7, 2008 at 9:48 PM
Oh, forgot to add that I've also already run the Install Instrumentation bit on the Enterprise Library patterns and practices start menu ...
May 7, 2008 at 10:19 PM
Vista runs all code in partial trust, unlike XP, where in you get full trust for locally installed code.
1 .You can either grants enough rights to your Security policy.
2. Or add Allow partially trusted callers attribute to your Entlib dlls, this needs a recompilation of your entlib.
May 8, 2008 at 6:10 PM


NeoAdroit wrote:
Vista runs all code in partial trust, unlike XP, where in you get full trust for locally installed code.
1 .You can either grants enough rights to your Security policy.


Thank you for the suggestion .... at this point (simply because its my own machine and I <just> want to get my app up and running in a new dev environment, (Using the .NET Framework 2.0 Configuration tool) I've set all my 'Zones' to Fully Trusted ... I've granted complete trust to all Microsoft published assemblies as well as my own .dlls used by this website ... and I still have the same problem ...

Having already ripped out all of the other security barriers (permissions to the event logs, etc.) ... what else am I missing?



May 8, 2008 at 7:03 PM
Also, I've added the Enterprise Library dlls needed for logging to the GAC since the Caspol tool told me that "all GAC assemblies always get full trust ... " alas ... no joy ...
May 8, 2008 at 8:38 PM
Doh! Just saw this on the CTP 2008 preview page ....

"There is no longer any requirement, as there was in version 3.x, to recompile the source code then either use the unsigned binaries or strong-name them yourself." ....