Today's By Request items, taken from the google search records.
log4net from ASP.Net
There have been some searches talking about how to configure log4net to work within your ASP.NET application. I admit its not as straightforward as it should be. There are 3 things to remember:
- Whatever user your ASP.NET application runs as needs permissions to whatever resources you are trying to access. For log files this includes create/modify perms in the directory you want to log to.
- You need to add a log4net config section handler and config section to your web.config file:
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="C:\\Projects\\TheShaft\\MobileServerEndpoint\\ShaftLog.txt" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="MaxSizeRollBackups" value="10" />
<param name="StaticLogFileName" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="RollingFileAppender" />
</root>
</log4net>
3. In the Application_Start event of your Global, you need to tell log4net to configure itself:
protected void Application_Start(Object sender, EventArgs e)
{
log4net.Config.DOMConfigurator.Configure();
ILog log = LogManager.GetLogger( GetType() );
log.Info("Application_Start");
}
And...
Compact Framework 2 on CE.Net
Right now, in Beta 2, you can run CF2 applications on WindowsMobile 2003, CE.NEt 4.0 and up, and WindowsMobile Smartphone. If you start a SmartDevice CAB project, you will see the "MinVersion" parameter equal to 4.0. However, I have been told directly from a Microsoft employee (via the newsgroups) that this will not be the case when Visual Studio 2005 goes final. For the CE.NET OS, only version 5 will run Compact Framework 2 applications.