When using S2Container.NET, following files (assembly) must be added to referenced files. Furthermore, make Seasar.dll in build directory as ja-JP directory.
s2container.net/build/Seasar.dll
s2container.net/lib/log4net.dll
Next, set configuration in application configuration file (app.config) if necessary. Refer to the following page to set this configuration file.
S2Container.NET uses Apache Logging Services project log4net. Thus, it is necessary to set log4net to log S2Container.NET.
Following is an example of log4net configuration.
Specifying log4net Configuration File
Following attributes are specified in the AssemblyInfo.
This will set application configuration file (app.config) in log4net.
When an application configuration file that is configured with log4net does not log using log4net, however, log will not be outputted. As an example, if Seasar assembly tries to log an output, log4net tries to find log4net configuration in a Seasar assembly and will not output a log.
To properly output a log, therefore, output a log from the application configured in log4net configuration, or add a step to read application configuration file when the program starts.
C#
System.IO.FileInfo info = new System.IO.FileInfo(
log4net.Util.SystemInfo.AssemblyShortName(
System.Reflection.Assembly.GetExecutingAssembly())
+ ".exe.config"); // if an assembly is a dll, use ".dll.config"
log4net.Config.XmlConfigurator.Configure(
log4net.LogManager.GetRepository(), info);
VB.NET
Dim info AsNew System.IO.FileInfo( _
log4net.Util.SystemInfo.AssemblyShortName( _
System.Reflection.Assembly.GetExecutingAssembly()) _
+ ".exe.config") ' if an assembly is a dll, use ".dll.config"
log4net.Config.XmlConfigurator.Configure( _
log4net.LogManager.GetRepository(), info)
S2Unit.NET is a testing framework to make testing with S2Container easier.
Download and install MbUnit 2.3.0 to use S2Unit.NET. The current release of S2Unit.NET requires MbUnit version 2.3.0 - it does not run properly with any other version.
Test class extends Seasar.Extension.Unit.S2TestCase.
S2TestCase class is included in Seasar.Unit.dll. Thus, a project with test codes should reference this Seasar.Unit.dll.
By default, S2AOP.NET implements System.Runtime.Remoting.Proxies.RealProxy, but it is possible to use Castle.DynamicProxy.
Refer to the following document for further information on Seasar.DynamicProxy.
To use Seasar.DynamicProxy, add references to the following files:
s2container.net/build/Seasar.DynamicProxy.dll
s2container.net/lib/Castle.DynamicProxy.dll (It is not necessary to add reference to this dll, if Seasar.DynamicProxy.dll is placed in a folder that is visible from the project)
Add [Seasar.DynamicProxy] assembly to application configuration file (App.config) as below:
Add Seasar.Framework.Aop.Impl.DynamicAopProxyAspectWeaver class to the dicon file as below.
Use caution on row placement so DynamicAopProxyAspectWeaver will be resolved before an aspect is applied to a component.
To run examples, open s2container.net/source/Seasar.sln from Visual Studio and
set Seasar.Examples project as a startup project. When the example is executed, ExamplesExplorer should start.
Some of the examples require SQL Server 2000 (or MSDE 2000). Before running these examples, execute s2container.net/data/setUpDemo.bat to create the necessary tables and set database connection string in Tx.dicon and DTCTx.dicon files in Seasar.Examples folder.