Security Error (MVC4 Beta)

Apr 27, 2012 at 4:35 PM

Hello! I just discovered your forum platform and wanted to give it a spin. However, I came across a security error when I try to run the web site and I'm hoping someone here that's more familiar with it's insides could point me in the right direction. This is the error that I am getting when I first try to access the site:

Server Error in '/' Application.

Security Exception

Description: 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. 

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  To create the source, you need permission to read all event logs to make sure that the new source name is unique.  Inaccessible logs: Security.

Source Error: 

Line 72: 				{
Line 73: 					var encoding = new System.Text.ASCIIEncoding();
Line 74: 					EventLog.WriteEntry("PopForums", "PopForums couldn't initialize an instance of PopForumsServiceModule: " + exc.Message, EventLogEntryType.Warning, 0, 0, encoding.GetBytes(exc.ToString()));
Line 75: 				}
Line 76: 			}


Source File: C:\Users\jchristensen\Desktop\POP Forums v9.3.0 BETA\PopForums9\PopForums\Web\PopForumsServiceModule.cs    Line: 74 

Stack Trace: 

[SecurityException: The source was not found, but some or all event logs could not be searched.  To create the source, you need permission to read all event logs to make sure that the new source name is unique.  Inaccessible logs: Security.]
   System.Diagnostics.EventLogInternal.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) +714
   System.Diagnostics.EventLogInternal.SourceExists(String source, String machineName, Boolean wantToCreate) +460
   System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName) +124
   System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +470
   System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +204
   PopForums.Web.PopForumsServiceModule.SetupServices(HttpApplication application) in C:\Users\jchristensen\Desktop\POP Forums v9.3.0 BETA\PopForums9\PopForums\Web\PopForumsServiceModule.cs:74
   PopForums.Web.PopForumsServiceModule.Init(HttpApplication application) in C:\Users\jchristensen\Desktop\POP Forums v9.3.0 BETA\PopForums9\PopForums\Web\PopForumsServiceModule.cs:27
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +575
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

-------------

And to make things easier than typing out. I'll just attach screenshots of my IIS Site and App Pool settings:

IIS: www.joshuachristensen.net/IIS.png
App Pool: www.joshuachristensen.net/AppPool.png

 

Any help would be greatly appreciated :)

Coordinator
Apr 27, 2012 at 5:16 PM

Yeah, I'm aware of that issue. It happens because the app doesn't have adequate trust to write to the event log. By default, that will usually be everyone.

That said, it usually happens because it can't write to the error log in the database, because the connection string is wrong or the database isn't there, or something along those lines. If you put a breakpoint in there,  you'll probably find some kind of SQL exception.

Make sure you follow the setup instructions, and you should be OK.

Apr 27, 2012 at 6:37 PM

Ahhh for pure sh*ts and giggles I did 'rebuild' and everything went just fine. I guess something was stuck from the initial build that I had done.

As an aside, it might be helpful to update the documentation with more explicit things that need to be updated in the web.config file instead of assuming that the user is going to be a hard-core developer. I do mostly front-end work with .NET applications (and lots of them for many years now) and I've never had to make so many changes to a web.config file and I know for someone like me that grabs a lot of these projects for proof of concept kind of things, you may not always get straight up developers. Just sayin'.

Coordinator
Apr 27, 2012 at 6:44 PM

Those are all valid concerns. Getting more to a drag-and-drop install is certainly a long term goal.