blob: e6c78066f259f8664db8d414d95e3648ea1ab255 [file] [log] [blame]
<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<title>DefaultRepositorySelector.CreateRepository Method (Assembly, Type, String, Boolean)</title>
<xml>
</xml>
<link rel="stylesheet" type="text/css" href="MSDN.css" />
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
<tr id="hdr">
<td class="runninghead">Apache log4net� SDK Documentation - Microsoft .NET Framework 4.0</td>
<td class="product">
</td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1">DefaultRepositorySelector.CreateRepository�Method�(Assembly, Type, String, Boolean)</h1>
</div>
</div>
<div id="nstext">
<p> Creates a new repository for the assembly specified. </p>
<div class="syntax">
<span class="lang">[Visual�Basic]</span>
<br />Overloads�Public�Function�CreateRepository( _<br />���ByVal <i>repositoryAssembly</i>�As�<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemReflectionAssemblyClassTopic.htm">Assembly</a>,�_<br />���ByVal <i>repositoryType</i>�As�<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemTypeClassTopic.htm">Type</a>,�_<br />���ByVal <i>repositoryName</i>�As�<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemStringClassTopic.htm">String</a>,�_<br />���ByVal <i>readAssemblyAttributes</i>�As�<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemBooleanClassTopic.htm">Boolean</a>�_<br />)�As�<a href="log4net.Repository.ILoggerRepository.html">ILoggerRepository</a></div>
<div class="syntax">
<span class="lang">[C#]</span>
<br />public�<a href="log4net.Repository.ILoggerRepository.html">ILoggerRepository</a>�CreateRepository(<br />���<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemReflectionAssemblyClassTopic.htm">Assembly</a><i>repositoryAssembly</i>,<br />���<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemTypeClassTopic.htm">Type</a><i>repositoryType</i>,<br />���<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemStringClassTopic.htm">string</a><i>repositoryName</i>,<br />���<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemBooleanClassTopic.htm">bool</a><i>readAssemblyAttributes</i><br />);</div>
<h4 class="dtH4">Parameters</h4>
<dl>
<dt>
<i>repositoryAssembly</i>
</dt>
<dd>the assembly to use to create the repository to associate with the <a href="log4net.Repository.ILoggerRepository.html">ILoggerRepository</a>.</dd>
<dt>
<i>repositoryType</i>
</dt>
<dd>The type of repository to create, must implement <a href="log4net.Repository.ILoggerRepository.html">ILoggerRepository</a>.</dd>
<dt>
<i>repositoryName</i>
</dt>
<dd>The name to assign to the created repository</dd>
<dt>
<i>readAssemblyAttributes</i>
</dt>
<dd>Set to <code>true</code> to read and apply the assembly attributes</dd>
</dl>
<h4 class="dtH4">Return Value</h4>
<p>The repository created.</p>
<h4 class="dtH4">Remarks</h4>
<p> The <a href="log4net.Repository.ILoggerRepository.html">ILoggerRepository</a> created will be associated with the repository specified such that a call to <b>GetRepository</b> with the same assembly specified will return the same repository instance. </p>
<p> The type of the <b>ILoggerRepository</b> created and the repository to create can be overridden by specifying the <a href="log4net.Config.RepositoryAttribute.html">RepositoryAttribute</a> attribute on the <i>repositoryAssembly</i>. The default values are to use the <i>repositoryType</i> implementation of the <b>ILoggerRepository</b> interface and to use the <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemReflectionAssemblyNameClassNameTopic.htm">Name</a> as the name of the repository. </p>
<p> The <b>ILoggerRepository</b> created will be automatically configured using any <a href="log4net.Config.ConfiguratorAttribute.html">ConfiguratorAttribute</a> attributes defined on the <i>repositoryAssembly</i>. </p>
<p> If a repository for the <i>repositoryAssembly</i> already exists that repository will be returned. An error will not be raised and that repository may be of a different type to that specified in <i>repositoryType</i>. Also the <b>RepositoryAttribute</b> attribute on the assembly may be used to override the repository type specified in <i>repositoryType</i>. </p>
<h4 class="dtH4">Exceptions</h4><div class="tablediv"><table class="dtTABLE" cellspacing="0"><tr valign="top"><th width="50%">Exception Type</th><th width="50%">Condition</th></tr><tr valign="top"><td width="50%"><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemArgumentNullExceptionClassTopic.htm">ArgumentNullException</a></td><td width="50%"><i>repositoryAssembly</i> is a null reference
(<b>Nothing</b> in Visual Basic).</td></tr></table></div><h4 class="dtH4">See Also</h4><p><a href="log4net.Core.DefaultRepositorySelector.html">DefaultRepositorySelector Class</a> | <a href="log4net.Core.html">log4net.Core Namespace</a> | <a href="log4net.Core.DefaultRepositorySelector.CreateRepository_overloads.html">DefaultRepositorySelector.CreateRepository Overload List</a></p><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;"><param name="Keyword" value="CreateRepository method"></param><param name="Keyword" value="CreateRepository method, DefaultRepositorySelector class"></param><param name="Keyword" value="DefaultRepositorySelector.CreateRepository method"></param></object><hr /><div id="footer"><a href='http://logging.apache.org/log4net/'>Copyright 2004-2013 The Apache Software Foundation.</a><br></br>Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.</div></div>
</body>
</html>