jjzjj

Configuration-ProgrammaticConfigu

全部标签

c# - 加载配置文件时如何修复 "Configuration system failed to initialize/Root element is missing"错误?

我在我的C#Windows应用程序中遇到了这个错误:“配置系统初始化失败”。它运行良好。突然我得到了这个异常(exception)。它将内部异常详细信息显示为“缺少根元素”。(C:\Users\company\AppData\Local\Clickbase_Corp_Sverige_AB\TouchStation.vshost.exe_Url_no1nets4fg3oy2p2q2pnwgulbvczlv33\1.1.0.12\user.config)”}。当我尝试从Settings.cs类获取值时会发生这种情况。在program.cs文件中写了下面的代码if(Properties.Se

c# - 永久禁用 EF 中的 Configuration.ProxyCreationEnabled?

有没有一种方法可以在全局范围内设置该值,而不是必须对每个查询都执行以下操作?模型View中有延迟加载设置,但似乎没有ProxyCreation的设置。using(varcontext=newLabEntities()){**context.Configuration.ProxyCreationEnabled=false;**varQuery=fromsincontext.EAssets.Include("Server").Include("Type").Include("Type.Definition")where(s.Type.Definition.b_IsScannable==tr

c# - 代理设置设置为 "Use automatic configuration script"的 WCF 客户端

我目前正在开发一个需要与Internet上的Web服务通信的应用程序。InternetExplorer是迄今为止唯一通过代理服务器连接到Internet的应用程序。代理设置设置为“使用自动配置脚本”。我保留了默认设置另外设置但运气不好。我不断收到“(407)需要代理身份验证。”我已经进行了一些Google搜索,但解决方案似乎不适合我的情况。简短更新:该应用程序应使用默认用户凭据运行,并使用这些凭据通过NTLM向代理进行身份验证。但即使我将客户端设置为这样做,它似乎也无济于事。 最佳答案 保留设置,并确保useDefaultCrede

c# - System.Web.Configuration.WebConfigurationManager 和 System.Configuration.ConfigurationManager 之间的行为差​​异

我在带有ASP.NET网站的测试服务器上遇到了一些问题。我傻了,有了家默认网站的目录指向了错误的位置。当我尝试时:ConfigurationManager.ConnectionStrings["connectionString"];它返回了null,但是usingSystem.Web.Configuration;/*...*/varrootWebConfig=WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);WebConfigurationManager.OpenWebConfiguration(

c# - IIS 抛出 ThreadAbortException 并回收 worker,IIS 日志记录为 "IIS configuration change"的可能原因是什么?

当后台线程正在运行时,我开始在Appharbor上托管的.NetMVC网络应用程序中看到错误-经过仔分割析-我无法找出原因。首先,我注意到的异常是ThreadAbortException。然而,这实际上只是表示线程正在被杀死。在线程被杀死之前,您可以看到IIS创建了一个新的worker,并在同一台机器上调用了Application_Start。新应用程序启动并运行后,IIS会终止旧应用程序并按预期处理新请求。同时,IIS记录一条消息:ShutDownMessage:IISconfigurationchangeHostingEnvironmentinitiatedshutdownHost

c# - .NET 自定义配置部分 : Configuration. GetSection 引发 'unable to locate assembly' 异常

我已经为一个插件DLL创建了一个自定义配置部分,它将.configXML存储在一个单独的(与主可执行应用程序不同的)文件中。这是自定义部分类的示例:usingSystem;usingSystem.Configuration;namespacePluginFramework.MyConfiguration{publicclassMyConfigurationSettings:ConfigurationSection{privateConfiguration_Config=null;#regionConfigurationProperties//////AcustomXMLsectionf

c# - 有没有办法根据任意 xml 获取 System.Configuration.Configuration 实例?

我正在尝试对我编写的自定义ConfigurationSection进行单元测试,我想将一些任意配置XML加载到System.Configuration.Configuration中对于每个测试(而不是将测试配置xml放在Tests.dll.config文件中。也就是说,我想做这样的事情:ConfigurationtestConfig=newConfiguration("...");MyCustomConfigSectionsection=testConfig.GetSection("mycustomconfigsection");Assert.That(section!=null);然

c# - 获取 "The WebResource.axd handler must be registered in the configuration to process this request."错误

我在IIS7上运行我的ASP.NET应用程序时遇到此错误。我已经尝试按照它说的去做,但没有帮助。TheWebResource.axdhandlermustberegisteredintheconfigurationtoprocessthisrequest.>>>>>>>>>我正在使用一点AJAX,我认为这是导致问题的原因。有人遇到过这个吗? 最佳答案 我想通了,所以出于搜索原因我将其张贴在这里。这是ASP.NET中的一个错误,它与安装ColdFusion有关。Microsoft尚未发布修复程序。有两种方法可以解决这个问题。将IIS7

javascript - AWS : Invalid identity pool configuration. 检查为此池分配的 IAM Angular 色

我已经创建了一个用户池和身份池。我用过javascriptsdk。我可以使用javascriptsdk成功注册、发送确认码和确认用户。但是当我尝试使用身份验证方法登录用户并尝试通过使用以下代码传递idToken来使用“CognitoIdentityCredentials”获取凭据时logins[cognitoEndpoint+"/"+userPoolId]=jwtToken;AWS.config.credentials=newAWS.CognitoIdentityCredentials({IdentityPoolId:identityPoolId,Logins:logins});它给我

php - 拉维尔 : unable to read configuration files

我正在开发一个Laravel包,但我无法从我的服务提供商的register()方法中读取我的配置文件。如果我尝试\Config::get("package::file.option")我得到null,如果我尝试\Config::get("package::file")我得到一个空数组。尽管如此,我还是可以从boot()方法中读取它们!以下是我在boot()方法中调用的package()和我的文件夹结构://package()call:$this->package('cerbero/login');//packagedirectorystructure:/workbench/cerber