草庐IT

CONFIGURATION

全部标签

c# - 以编程方式添加、启用和禁用 NLog 记录器

如何从NLog的代码中添加、编辑、删除、启用和禁用记录器? 最佳答案 添加:varlogTarget=new...logTarget.Layout="Yourlayoutformathere";//e.g."${logger}:${message}${exception:format=tostring}";//specifywhatgetsloggedtotheabovetargetvarloggingRule=newLoggingRule("*",LogLevel.Debug,logTarget);//addtargetandru

Android报错之Could not resolve all files for configuration ‘:app:debugRuntimeClasspath‘.

Android报错之Couldnotresolveallfilesforconfiguration':app:debugRuntimeClasspath'.解决方法如下1.在Project的build.gradle的两处加入google()解决方法如下1.在Project的build.gradle的两处加入google()//Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{google()jcenter()}dependenc

c# - NHibernate.Spatial 和 Sql 2008 地理类型 - 如何配置

我正在尝试将Nhibernate与Sql2008地理类型一起使用,但遇到了困难。我正在使用FluentNhibernate来配置我对它相当陌生,所以这也可能是问题所在。首先,我要坚持的类(class)看起来像这样:publicclassLocationLog:FluentNHibernate.Data.Entity{publicvirtualnewintId{get;set;}publicvirtualDateTimeTimeStamp{get;set;}publicvirtualGisSharpBlog.NetTopologySuite.Geometries.PointLocatio

c# - NHibernate.Spatial 和 Sql 2008 地理类型 - 如何配置

我正在尝试将Nhibernate与Sql2008地理类型一起使用,但遇到了困难。我正在使用FluentNhibernate来配置我对它相当陌生,所以这也可能是问题所在。首先,我要坚持的类(class)看起来像这样:publicclassLocationLog:FluentNHibernate.Data.Entity{publicvirtualnewintId{get;set;}publicvirtualDateTimeTimeStamp{get;set;}publicvirtualGisSharpBlog.NetTopologySuite.Geometries.PointLocatio

c# - ConfigurationManager.AppSettings 性能问题

我计划将所有配置设置存储在应用程序的app.config部分(使用ConfigurationManager.AppSettings类)。当用户使用应用程序的UI更改设置(单击复选框、选择单选按钮等)时,我计划将这些更改写入AppSettings。同时,在程序运行时,我计划从一个不断处理数据的进程中不断访问AppSettings。通过UI更改设置需要实时影响数据处理,这就是进程将不断访问AppSettings的原因。就性能而言,这是个好主意吗?使用AppSettings应该是编写.Net应用程序时存储和访问配置设置的“正确方法”,但我担心这种方法不适用于恒定负载(至少在不断读取设置)。如

c# - ConfigurationManager.AppSettings 性能问题

我计划将所有配置设置存储在应用程序的app.config部分(使用ConfigurationManager.AppSettings类)。当用户使用应用程序的UI更改设置(单击复选框、选择单选按钮等)时,我计划将这些更改写入AppSettings。同时,在程序运行时,我计划从一个不断处理数据的进程中不断访问AppSettings。通过UI更改设置需要实时影响数据处理,这就是进程将不断访问AppSettings的原因。就性能而言,这是个好主意吗?使用AppSettings应该是编写.Net应用程序时存储和访问配置设置的“正确方法”,但我担心这种方法不适用于恒定负载(至少在不断读取设置)。如

c# - 将 Global.asax 迁移到 Startup.cs

为了更好地使用Microsoft.Owin.Testing.TestServer进行测试,我发现Global.asax没有加载OwinTestServer。因此,我尝试将我的Global.asax配置移动到Startup.cs,如下所示,publicpartialclassStartup{publicvoidConfiguration(IAppBuilderapp){//pastedGlobal.asaxthingsstart.GlobalConfiguration.Configuration.Formatters.Clear();varjsonSerializerSettings=n

c# - 将 Global.asax 迁移到 Startup.cs

为了更好地使用Microsoft.Owin.Testing.TestServer进行测试,我发现Global.asax没有加载OwinTestServer。因此,我尝试将我的Global.asax配置移动到Startup.cs,如下所示,publicpartialclassStartup{publicvoidConfiguration(IAppBuilderapp){//pastedGlobal.asaxthingsstart.GlobalConfiguration.Configuration.Formatters.Clear();varjsonSerializerSettings=n

c# - 如何避免 SerializationException : Type is not resolved for member XXX when testing a component that uses the LogicalCallContext

当EF尝试从App.config加载信息时,我最近开始在我的单元测试(NUnit)代码中遇到以下异常:System.Runtime.Serialization.SerializationException:Typeisnotresolvedformember[mytypename],[myassemblyname]NUnitGUI运行器和R#的VS集成运行器都会发生这种情况。这是重现问题的快速单元测试:[Test]publicvoidTest(){//adding//ConfigurationManager.OpenExeConfiguration(ConfigurationUserL

c# - 如何避免 SerializationException : Type is not resolved for member XXX when testing a component that uses the LogicalCallContext

当EF尝试从App.config加载信息时,我最近开始在我的单元测试(NUnit)代码中遇到以下异常:System.Runtime.Serialization.SerializationException:Typeisnotresolvedformember[mytypename],[myassemblyname]NUnitGUI运行器和R#的VS集成运行器都会发生这种情况。这是重现问题的快速单元测试:[Test]publicvoidTest(){//adding//ConfigurationManager.OpenExeConfiguration(ConfigurationUserL