Index: Appender/AppenderSkeleton.cs
===================================================================
--- Appender/AppenderSkeleton.cs (revision 68226)
+++ Appender/AppenderSkeleton.cs (working copy)
@@ -320,7 +320,7 @@
{
ErrorHandler.Error("Failed in DoAppend", ex);
}
-#if !MONO && !NET_2_0
+#if !MONO && !NET_2_0 && !NET_4_0
// on .NET 2.0 (and higher) and Mono (all profiles),
// exceptions that do not derive from System.Exception will be
// wrapped in a RuntimeWrappedException by the runtime, and as
@@ -427,7 +427,7 @@
{
ErrorHandler.Error("Failed in Bulk DoAppend", ex);
}
-#if !MONO && !NET_2_0
+#if !MONO && !NET_2_0 && !NET_4_0
// on .NET 2.0 (and higher) and Mono (all profiles),
// exceptions that do not derive from System.Exception will be
// wrapped in a RuntimeWrappedException by the runtime, and as
Index: Appender/EventLogAppender.cs
===================================================================
--- Appender/EventLogAppender.cs (revision 68226)
+++ Appender/EventLogAppender.cs (working copy)
@@ -298,7 +298,7 @@
///
private static void CreateEventSource(string source, string logName, string machineName)
{
-#if NET_2_0
+#if NET_2_0 || NET_4_0
EventSourceCreationData eventSourceCreationData = new EventSourceCreationData(source, logName);
eventSourceCreationData.MachineName = machineName;
EventLog.CreateEventSource(eventSourceCreationData);
Index: Appender/SmtpAppender.cs
===================================================================
--- Appender/SmtpAppender.cs (revision 68226)
+++ Appender/SmtpAppender.cs (working copy)
@@ -23,7 +23,7 @@
using System;
using System.IO;
-#if NET_2_0
+#if NET_2_0 || NET_4_0
using System.Net.Mail;
#else
using System.Web.Mail;
@@ -340,7 +340,7 @@
/// the body text to include in the mail
virtual protected void SendEmail(string messageBody)
{
-#if NET_2_0
+#if NET_2_0 || NET_4_0
// .NET 2.0 has a new API for SMTP email System.Net.Mail
// This API supports credentials and multiple hosts correctly.
// The old API is deprecated.
@@ -439,7 +439,7 @@
}
SmtpMail.Send(mailMessage);
-#endif // if NET_2_0
+#endif // if NET_2_0 || NET_4_0
}
#endregion // Protected Methods
Index: AssemblyInfo.cs
===================================================================
--- AssemblyInfo.cs (revision 68226)
+++ AssemblyInfo.cs (working copy)
@@ -31,7 +31,7 @@
//
[assembly: System.CLSCompliant(true)]
-#if (!NETCF)
+#if (!NETCF && !NET_4_0)
//
// If log4net is strongly named it still allows partially trusted callers
//
@@ -52,6 +52,8 @@
[assembly: AssemblyTitle("log4net for .NET Framework 1.1")]
#elif (NET_2_0)
[assembly: AssemblyTitle("log4net for .NET Framework 2.0")]
+#elif (NET_4_0)
+[assembly: AssemblyTitle("log4net for .NET Framework 4.0")]
#elif (NETCF_1_0)
[assembly: AssemblyTitle("log4net for .NET Compact Framework 1.0")]
#elif (MONO_1_0)
Index: Config/XmlConfigurator.cs
===================================================================
--- Config/XmlConfigurator.cs (revision 68226)
+++ Config/XmlConfigurator.cs (working copy)
@@ -154,7 +154,7 @@
try
{
XmlElement configElement = null;
-#if NET_2_0
+#if NET_2_0 || NET_4_0
configElement = System.Configuration.ConfigurationManager.GetSection("log4net") as XmlElement;
#else
configElement = System.Configuration.ConfigurationSettings.GetConfig("log4net") as XmlElement;
@@ -618,11 +618,14 @@
#if (NETCF)
// Create a text reader for the file stream
XmlTextReader xmlReader = new XmlTextReader(configStream);
-#elif NET_2_0
+#elif NET_2_0 || NET_4_0
// Allow the DTD to specify entity includes
XmlReaderSettings settings = new XmlReaderSettings();
+#if NET_4_0
+ settings.DtdProcessing = DtdProcessing.Parse;
+#else
settings.ProhibitDtd = false;
-
+#endif
// Create a reader over the input stream
XmlReader xmlReader = XmlReader.Create(configStream, settings);
#else
Index: Layout/XMLLayout.cs
===================================================================
--- Layout/XMLLayout.cs (revision 68226)
+++ Layout/XMLLayout.cs (working copy)
@@ -219,7 +219,7 @@
writer.WriteStartElement(m_elmEvent);
writer.WriteAttributeString(ATTR_LOGGER, loggingEvent.LoggerName);
-#if NET_2_0 || MONO_2_0
+#if NET_2_0 || MONO_2_0 || NET_4_0
writer.WriteAttributeString(ATTR_TIMESTAMP, XmlConvert.ToString(loggingEvent.TimeStamp, XmlDateTimeSerializationMode.Local));
#else
writer.WriteAttributeString(ATTR_TIMESTAMP, XmlConvert.ToString(loggingEvent.TimeStamp));
Index: log4net.csproj
===================================================================
--- log4net.csproj (revision 68226)
+++ log4net.csproj (working copy)
@@ -1,4 +1,5 @@
-
+
+
Local
9.0.30729
@@ -42,15 +43,18 @@
true
false
true
+ v4.0
+
+
- ..\build\bin\net\1.0\debug\
+ ..\build\bin\net\4.0\debug\<
false
285212672
false
- TRACE;DEBUG;NET;NET_1_0;
+ TRACE;DEBUG;NET;NET_4_0;
log4net.xml
true
4096
@@ -63,13 +67,13 @@
prompt
- ..\build\bin\net\2.0\release\
+ ..\build\bin\net\4.0\release\
false
285212672
false
- TRACE;NET;NET_2_0;
+ TRACE;NET;NET_4_0;
log4net.xml
false
4096
Index: Util/SystemInfo.cs
===================================================================
--- Util/SystemInfo.cs (revision 68226)
+++ Util/SystemInfo.cs (working copy)
@@ -224,7 +224,7 @@
{
#if NETCF
return System.Threading.Thread.CurrentThread.GetHashCode();
-#elif NET_2_0
+#elif NET_2_0 || NET_4_0
return System.Threading.Thread.CurrentThread.ManagedThreadId;
#else
return AppDomain.GetCurrentThreadId();
@@ -845,7 +845,7 @@
{
#if NETCF
// Configuration APIs are not suported under the Compact Framework
-#elif NET_2_0
+#elif NET_2_0 || NET_4_0
return ConfigurationManager.AppSettings[key];
#else
return ConfigurationSettings.AppSettings[key];
Index: Util/TypeConverters/IPAddressConverter.cs
===================================================================
--- Util/TypeConverters/IPAddressConverter.cs (revision 68226)
+++ Util/TypeConverters/IPAddressConverter.cs (working copy)
@@ -76,7 +76,7 @@
{
try
{
-#if NET_2_0
+#if NET_2_0 || NET_4_0
// Try to resolve via DNS. This is a blocking call.
// GetHostEntry works with either an IPAddress string or a host name
IPHostEntry host = Dns.GetHostEntry(str);