log4net and configSource

https://stackoverflow.com/questions/445976/log4net-config-in-external-file-does-not-work

113

Do you have the following attribute in your AssemblyInfo.cs file:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]

and code like this at the start of each class that requires logging functionality:

private static readonly ILog log = 
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

I have a blog post containing this and other info here.

configuration c# LiveMySqlServer vs. LocalMySqlServer

in der web.config

die Zeilen:

<membership defaultProvider=“MySQLMembershipProvider“>
<providers>
<remove name=“MySQLMembershipProvider“ />
<add name=“MySQLMembershipProvider“ autogenerateschema=“true“ type=“MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.7.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d“ connectionStringName=“LiveMySqlServer“ enablePasswordRetrieval=“false“ enablePasswordReset=“true“ requiresQuestionAndAnswer=“true“ applicationName=“/“ requiresUniqueEmail=“false“ passwordFormat=“Clear“ maxInvalidPasswordAttempts=“5″ minRequiredPasswordLength=“7″ minRequiredNonalphanumericCharacters=“1″ passwordAttemptWindow=“10″ passwordStrengthRegularExpression=““ />
</providers>
</membership>
<profile defaultProvider=“MySQLProfileProvider“>
<providers>
<remove name=“MySQLProfileProvider“ />
<add name=“MySQLProfileProvider“ autogenerateschema=“true“ type=“MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.7.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d“ connectionStringName=“LiveMySqlServer“ applicationName=“/“ />
</providers>
</profile>
<roleManager defaultProvider=“MySQLRoleProvider“>
<providers>
<remove name=“MySQLRoleProvider“ />
<add name=“MySQLRoleProvider“ autogenerateschema=“true“ type=“MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.7.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d“ connectionStringName=“LiveMySqlServer“ applicationName=“/“ />
</providers>
</roleManager>

unter der Rubrik: <system.web>rausgenommen.

Hatte den Fatalen Fehler zur Folge, dass der Transfer nicht mehr funktionierte.

Lösung ist:

Put the following in the web.config:

<connectionStrings configSource=“ConnectionStrings.config“>
</connectionStrings>

and then just maintain different ConnectionString.config files in each deployment.

<connectionStrings>
<add name=“ConnectionStringxxx“ connectionString=“Data Source=xxx.xxx.xxx.xxx;Initial Catalog=Master;Integrated Security=True“
providerName=“System.Data.SqlClient“ />
</connectionStrings>

Your code can always refer to ConnectionStringxxx

Datenobjekt verdoppeln c# linq

https://forums.asp.net/t/2141194.aspx?How+to+copy+all+properties+of+an+object+to+another+in+LINQ

 

Kati Ais Kati Ais

Member

17 Points

60 Posts

Re: How to copy all properties of an object to another in LINQ

May 24, 2018 09:21 AM|LINK

Hi,

Follow this example, it may help:

   public class A 
    {
        public string id{ get; set; }
        //Other 24 attributes that you have
    }
 using System.Reflection;
A obj1 = new A();
        A obj2 = new A();

        obj1.id = "aaa";

        var propInfo = obj1.GetType().GetProperties();
        foreach (var item in propInfo)
        {
            obj2.GetType().GetProperty(item.Name).SetValue(obj2, item.GetValue(obj1, null), null);
        }