Skip to content

Commit 5f8a168

Browse files
1 parent 7574924 commit 5f8a168

File tree

230 files changed

+1894
-8617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+1894
-8617
lines changed

samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</ProductVersion>
99
<SchemaVersion>2.0</SchemaVersion>
1010
<ProjectGuid>{58A3721F-5B5C-4CA7-BE39-91640B5B4924}</ProjectGuid>
11-
<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
11+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1212
<OutputType>Library</OutputType>
1313
<AppDesignerFolder>Properties</AppDesignerFolder>
1414
<RootNamespace>OAuth2ProtectedWebApi</RootNamespace>
@@ -93,7 +93,6 @@
9393
<Reference Include="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9494
<SpecificVersion>False</SpecificVersion>
9595
<HintPath>..\..\src\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
96-
<Private>True</Private>
9796
</Reference>
9897
<Reference Include="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9998
<SpecificVersion>False</SpecificVersion>
@@ -349,4 +348,4 @@
349348
</Target>
350349
<Target Name="AfterBuild">
351350
</Target> -->
352-
</Project>
351+
</Project>

samples/OAuthAuthorizationServer/Global.asax.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
using Code;
1010

11-
/// <summary>
11+
using DotNetOpenAuth.Logging;
12+
13+
/// <summary>
1214
/// The global MVC Application.
1315
/// </summary>
1416
/// <remarks>
@@ -24,7 +26,7 @@ public class MvcApplication : System.Web.HttpApplication {
2426
/// <summary>
2527
/// The logger for this sample to use.
2628
/// </summary>
27-
public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthAuthorizationServer");
29+
public static ILog Logger = LogProvider.GetLogger("DotNetOpenAuth.OAuthAuthorizationServer");
2830

2931
public static DatabaseKeyNonceStore KeyNonceStore { get; set; }
3032

@@ -83,19 +85,16 @@ protected void Application_Start() {
8385

8486
KeyNonceStore = new DatabaseKeyNonceStore();
8587

86-
log4net.Config.XmlConfigurator.Configure();
88+
/// LogProvider.SetCurrentLogProvider(new ....)
8789
Logger.Info("Sample starting...");
8890
}
8991

9092
protected void Application_End(object sender, EventArgs e) {
9193
Logger.Info("Sample shutting down...");
92-
93-
// this would be automatic, but in partial trust scenarios it is not.
94-
log4net.LogManager.Shutdown();
9594
}
9695

9796
protected void Application_Error(object sender, EventArgs e) {
98-
Logger.Error("An unhandled exception occurred in ASP.NET processing: " + Server.GetLastError(), Server.GetLastError());
97+
Logger.ErrorException("An unhandled exception occurred in ASP.NET processing: " + Server.GetLastError(), Server.GetLastError());
9998

10099
// In the event of an unhandled exception, reverse any changes that were made to the database to avoid any partial database updates.
101100
var dataContext = DataContextSimple;

samples/OAuthAuthorizationServer/OAuthAuthorizationServer.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
2222
<SchemaVersion>2.0</SchemaVersion>
2323
<ProjectGuid>{C78E8235-1D46-43EB-A912-80B522C4E9AE}</ProjectGuid>
24-
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
24+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
2525
<OutputType>Library</OutputType>
2626
<AppDesignerFolder>Properties</AppDesignerFolder>
2727
<RootNamespace>OAuthAuthorizationServer</RootNamespace>
@@ -48,10 +48,6 @@
4848
<WarningLevel>4</WarningLevel>
4949
</PropertyGroup>
5050
<ItemGroup>
51-
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
52-
<SpecificVersion>False</SpecificVersion>
53-
<HintPath>..\..\src\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
54-
</Reference>
5551
<Reference Include="Microsoft.CSharp" />
5652
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5753
<Private>True</Private>

samples/OAuthAuthorizationServer/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="log4net" version="2.0.2" targetFramework="net45" />
43
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
54
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
65
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />

samples/OAuthClient/Code/Logging.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
using System.Text;
66
using System.Web;
77

8-
/// <summary>
8+
using DotNetOpenAuth.Logging;
9+
10+
/// <summary>
911
/// Logging tools for this sample.
1012
/// </summary>
1113
public static class Logging {
@@ -17,6 +19,6 @@ public static class Logging {
1719
/// <summary>
1820
/// The logger for this sample to use.
1921
/// </summary>
20-
public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthClient");
22+
public static ILog Logger = LogProvider.GetLogger("DotNetOpenAuth.OAuthClient");
2123
}
2224
}

samples/OAuthClient/Code/TracePageAppender.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

samples/OAuthClient/Global.asax.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
using System.Linq;
55
using System.Web;
66

7-
public partial class Global : HttpApplication {
7+
using DotNetOpenAuth.Logging;
8+
9+
public partial class Global : HttpApplication {
810
protected void Application_Start(object sender, EventArgs e) {
9-
log4net.Config.XmlConfigurator.Configure();
11+
1012
Logging.Logger.Info("Sample starting...");
1113
}
1214

1315
protected void Application_End(object sender, EventArgs e) {
1416
Logging.Logger.Info("Sample shutting down...");
15-
16-
// this would be automatic, but in partial trust scenarios it is not.
17-
log4net.LogManager.Shutdown();
1817
}
1918

2019
protected void Application_Error(object sender, EventArgs e) {

samples/OAuthClient/OAuthClient.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
<DefineConstants>$(DefineConstants);SAMPLESONLY</DefineConstants>
5050
</PropertyGroup>
5151
<ItemGroup>
52-
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
53-
<SpecificVersion>False</SpecificVersion>
54-
<HintPath>..\..\src\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
55-
</Reference>
5652
<Reference Include="System" />
5753
<Reference Include="System.Data" />
5854
<Reference Include="System.Data.DataSetExtensions" />
@@ -155,7 +151,6 @@
155151
<Compile Include="TracePage.aspx.designer.cs">
156152
<DependentUpon>TracePage.aspx</DependentUpon>
157153
</Compile>
158-
<Compile Include="Code\TracePageAppender.cs" />
159154
<Compile Include="Properties\AssemblyInfo.cs" />
160155
<Compile Include="WindowsLive.aspx.cs">
161156
<DependentUpon>WindowsLive.aspx</DependentUpon>

samples/OAuthClient/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="log4net" version="2.0.2" targetFramework="net45" />
43
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
54
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
65
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />

samples/OAuthConsumer/Code/Logging.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
using System.Text;
66
using System.Web;
77

8-
/// <summary>
8+
using DotNetOpenAuth.Logging;
9+
10+
/// <summary>
911
/// Logging tools for this sample.
1012
/// </summary>
1113
public static class Logging {
@@ -17,6 +19,6 @@ public static class Logging {
1719
/// <summary>
1820
/// The logger for this sample to use.
1921
/// </summary>
20-
public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthConsumer");
22+
public static ILog Logger = LogProvider.GetLogger("DotNetOpenAuth.OAuthConsumer");
2123
}
2224
}

samples/OAuthConsumer/Code/TracePageAppender.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

samples/OAuthConsumer/Global.asax.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
using System.Linq;
55
using System.Web;
66

7-
public partial class Global : HttpApplication {
7+
using DotNetOpenAuth.Logging;
8+
9+
public partial class Global : HttpApplication {
810
protected void Application_Start(object sender, EventArgs e) {
9-
log4net.Config.XmlConfigurator.Configure();
10-
Logging.Logger.Info("Sample starting...");
11+
/// LogProvider.SetCurrentLogProvider(new ....)
12+
Logging.Logger.Info("Sample starting...");
1113
}
1214

1315
protected void Application_End(object sender, EventArgs e) {
1416
Logging.Logger.Info("Sample shutting down...");
15-
16-
// this would be automatic, but in partial trust scenarios it is not.
17-
log4net.LogManager.Shutdown();
1817
}
1918

2019
protected void Application_Error(object sender, EventArgs e) {

samples/OAuthConsumer/OAuthConsumer.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
<DefineConstants>$(DefineConstants);SAMPLESONLY</DefineConstants>
5050
</PropertyGroup>
5151
<ItemGroup>
52-
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
53-
<SpecificVersion>False</SpecificVersion>
54-
<HintPath>..\..\src\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
55-
</Reference>
5652
<Reference Include="Microsoft.CSharp" />
5753
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
5854
<HintPath>..\..\src\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -157,7 +153,6 @@
157153
<SubType>ASPXCodeBehind</SubType>
158154
</Compile>
159155
<Compile Include="Code\Logging.cs" />
160-
<Compile Include="Code\TracePageAppender.cs" />
161156
<Compile Include="GoogleAddressBook.aspx.cs">
162157
<DependentUpon>GoogleAddressBook.aspx</DependentUpon>
163158
<SubType>ASPXCodeBehind</SubType>

samples/OAuthConsumer/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="log4net" version="2.0.2" targetFramework="net45" />
43
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
54
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
65
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />

samples/OAuthConsumerWpf/OAuthConsumerWpf.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@
6868
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
6969
</PropertyGroup>
7070
<ItemGroup>
71-
<Reference Include="log4net">
72-
<HintPath>..\..\src\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
73-
</Reference>
7471
<Reference Include="System" />
7572
<Reference Include="System.configuration" />
7673
<Reference Include="System.Core">

samples/OAuthConsumerWpf/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
[assembly: AssemblyTrademark("")]
1717
[assembly: AssemblyCulture("")]
1818

19-
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
20-
2119
// Setting ComVisible to false makes the types in this assembly not visible
2220
// to COM components. If you need to access a type in this assembly from
2321
// COM, set the ComVisible attribute to true on that type.

samples/OAuthConsumerWpf/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="log4net" version="2.0.2" targetFramework="net45" />
43
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
54
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
65
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />

samples/OAuthResourceServer/Code/Global.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using System.ServiceModel;
66
using System.Text;
77
using System.Web;
8+
9+
using DotNetOpenAuth.Logging;
810
using DotNetOpenAuth.OAuth2;
911
using DotNetOpenAuth.OAuth2.Messages;
1012

@@ -39,7 +41,7 @@ public class Global : HttpApplication {
3941
/// <summary>
4042
/// The logger for this sample to use.
4143
/// </summary>
42-
public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthResourceServer");
44+
public static ILog Logger = LogProvider.GetLogger("DotNetOpenAuth.OAuthResourceServer");
4345

4446
#if SAMPLESONLY
4547
/// <summary>
@@ -85,19 +87,15 @@ internal static RSACryptoServiceProvider CreateAuthorizationServerSigningService
8587
}
8688

8789
private void Application_Start(object sender, EventArgs e) {
88-
log4net.Config.XmlConfigurator.Configure();
8990
Logger.Info("Sample starting...");
9091
}
9192

9293
private void Application_End(object sender, EventArgs e) {
9394
Logger.Info("Sample shutting down...");
94-
95-
// this would be automatic, but in partial trust scenarios it is not.
96-
log4net.LogManager.Shutdown();
9795
}
9896

9997
private void Application_Error(object sender, EventArgs e) {
100-
Logger.Error("An unhandled exception occurred in ASP.NET processing: " + Server.GetLastError(), Server.GetLastError());
98+
Logger.ErrorException("An unhandled exception occurred in ASP.NET processing: " + Server.GetLastError(), Server.GetLastError());
10199
}
102100

103101
private void Application_EndRequest(object sender, EventArgs e) {

samples/OAuthResourceServer/Code/OAuthAuthorizationManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
using System.ServiceModel.Web;
1212
using System.Threading;
1313
using System.Threading.Tasks;
14+
15+
using DotNetOpenAuth.Logging;
1416
using DotNetOpenAuth.Messaging;
1517
using DotNetOpenAuth.OAuth2;
1618
using ProtocolException = System.ServiceModel.ProtocolException;
@@ -57,10 +59,10 @@ protected override bool CheckAccessCore(OperationContext operationContext) {
5759
return false;
5860
}
5961
} catch (ProtocolFaultResponseException ex) {
60-
Global.Logger.Error("Error processing OAuth messages.", ex);
62+
Global.Logger.ErrorException("Error processing OAuth messages.", ex);
6163
exception = ex;
6264
} catch (ProtocolException ex) {
63-
Global.Logger.Error("Error processing OAuth messages.", ex);
65+
Global.Logger.ErrorException("Error processing OAuth messages.", ex);
6466
}
6567

6668
if (exception != null) {

samples/OAuthResourceServer/Code/TracePageAppender.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

samples/OAuthResourceServer/OAuthResourceServer.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
<WarningLevel>4</WarningLevel>
4747
</PropertyGroup>
4848
<ItemGroup>
49-
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
50-
<SpecificVersion>False</SpecificVersion>
51-
<HintPath>..\..\src\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
52-
</Reference>
5349
<Reference Include="System" />
5450
<Reference Include="System.Data" />
5551
<Reference Include="System.Data.DataSetExtensions" />
@@ -101,7 +97,6 @@
10197
<Compile Include="Code\IDataApi.cs" />
10298
<Compile Include="Code\OAuthAuthorizationManager.cs" />
10399
<Compile Include="Code\OAuthPrincipalAuthorizationPolicy.cs" />
104-
<Compile Include="Code\TracePageAppender.cs" />
105100
<Compile Include="Default.aspx.cs">
106101
<DependentUpon>Default.aspx</DependentUpon>
107102
<SubType>ASPXCodeBehind</SubType>

samples/OAuthResourceServer/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="log4net" version="2.0.2" targetFramework="net45" />
43
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
54
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
65
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />

0 commit comments

Comments
 (0)