<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Forms</title><link>http://forums.asp.net/18.aspx</link><description>All about building ASP.NET Pages - server controls, events, validation, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1786182.aspx</link><pubDate>Wed, 04 Jul 2007 05:38:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1786182</guid><dc:creator>jasonken</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1786182.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1786182</wfw:commentRss><description>&lt;p&gt;Powershell offers another really good option as you can call directly into the framework. This way you don&amp;#39;t have to create a project just for the sake of performing some minor admin legwork. Also, you could probably package the script in a setup package.&lt;/p&gt;
&lt;p&gt;From the powershell commandline:&lt;br /&gt;&lt;br /&gt;$x = [System.Diagnostics.EventLog]&lt;br /&gt;$x::CreateEventSource(&amp;quot;MyApp&amp;quot;, &amp;quot;Application&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1735868.aspx</link><pubDate>Fri, 01 Jun 2007 20:20:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1735868</guid><dc:creator>LurkingVariable</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1735868.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1735868</wfw:commentRss><description>&lt;p&gt;Good idea Joteke. Maybe I can add this as a custom action to the setup and deployment package for my web app.&lt;/p&gt;</description></item><item><title>Re: Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1308070.aspx</link><pubDate>Wed, 07 Jun 2006 18:09:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1308070</guid><dc:creator>joteke</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1308070.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1308070</wfw:commentRss><description>&lt;p&gt;As I referred to having Admin permissions, I have been doing this by having a custom WinForm&amp;nbsp;app which does the registration (creating event source&amp;nbsp;with given name etc). &lt;/p&gt;
&lt;p&gt;It is just run once by admin (or by me in this case) and after that ASP.NET is able to write to the event log (with that source). Point is just to create the source with adequate permissions.&lt;/p&gt;</description></item><item><title>Re: Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1305618.aspx</link><pubDate>Mon, 05 Jun 2006 16:06:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1305618</guid><dc:creator>jbeall</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1305618.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1305618</wfw:commentRss><description>http://support.microsoft.com/default.aspx?scid=kb;en-us;329291&lt;br /&gt;&lt;br /&gt;You want the method described under "First Approach".&lt;br /&gt;</description></item><item><title>Re: Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1305598.aspx</link><pubDate>Mon, 05 Jun 2006 15:52:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1305598</guid><dc:creator>sahina</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1305598.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1305598</wfw:commentRss><description>How did you manually create it? I need to do the same thing. I am having problems creating it programmatically.&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;</description></item><item><title>Re: Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1273656.aspx</link><pubDate>Tue, 02 May 2006 13:31:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1273656</guid><dc:creator>jbeall</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1273656.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1273656</wfw:commentRss><description>I had to create the event source manually by editing my registry.&amp;nbsp; Doing it in code from my web app didn't work (I assume because my web app was not running as a user with sufficient privileges).&lt;br /&gt;&lt;br /&gt;Thanks for the pointer.&lt;br /&gt;</description></item><item><title>Re: Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1264513.aspx</link><pubDate>Fri, 21 Apr 2006 15:59:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1264513</guid><dc:creator>joteke</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1264513.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1264513</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;have you initially created a event source? You need to create the event source (with administrative permissions), and after that ASP.NET is able to write to event log. It just can't create the event source by default.&lt;/p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/xzwc042w(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/xzwc042w(VS.80).aspx&lt;/a&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Writing to the EventLog from an ASP.NET page</title><link>http://forums.asp.net/thread/1264458.aspx</link><pubDate>Fri, 21 Apr 2006 15:23:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1264458</guid><dc:creator>jbeall</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1264458.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1264458</wfw:commentRss><description>We've been trying to do this, and we're getting the following exception:&lt;br /&gt;&lt;br /&gt;System.Security.SecurityException was unhandled by user code&lt;br /&gt;&amp;nbsp; Message="The source was not found, but some or all event logs could not be searched.&amp;nbsp; Inaccessible logs: Security."&lt;br /&gt;&amp;nbsp; Source="System"&lt;br /&gt;&amp;nbsp; StackTrace:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Diagnostics.EventLog.SourceExists(String source, String machineName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at HSLDA.EEntry.Common.Request.Request.Save() in D:\NetProjects2005\EEntry\EEntryRequest\Request.vb:line 169&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at _Default.SendApplication() in d:\dev\EEntryGateway\Default.aspx.cs:line 258&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at _Default.Page_Load(Object sender, EventArgs e) in d:\dev\EEntryGateway\Default.aspx.cs:line 41&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Web.UI.Control.OnLoad(EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Web.UI.Control.LoadRecursive()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I assume this is because the ASP.NET process is not allowed to write to the event logs.&amp;nbsp; So, should I:&lt;br /&gt;&lt;br /&gt;1) Change permissions so that the ASP.NET process can write to the logs?&amp;nbsp; If so, how do I go about that?&lt;br /&gt;2) Use some other method for writing to the event logs?&lt;br /&gt;3) Run as a different user that has permissions to write to the event log?&amp;nbsp; This seems like an incorrect solution...&lt;br /&gt;4) Something else?&lt;br /&gt;&lt;br /&gt;Thanks for any help!</description></item></channel></rss>