cost 414 ms
ConfigurationManager.OpenMappedExeConfiguration“因為它正被另一個進程使用”

[英]ConfigurationManager.OpenMappedExeConfiguration "because it is being used by another process"

當用戶修改它時,我想重新閱讀 MySolution.main.config(我的 app.config)感謝 FileSystemWatcher。 我構建了一個名為 FileWatcher 的包裝器。 使用這段代碼捕獲 OnChanged 事件 引發此異常 System.Configuration ...

在單元測試中使用時,是什么導致 ConfigurationManager 不適用於 class 庫項目?

[英]What is causing ConfigurationManager not to be working for class library project when used in unit test?

我正在使用什么我在用着: .NET 6與<Nullable>disable</Nullable> , NUnit (3.13.3), 和System.Configuration.ConfigurationManager 。 我有的目前,我有一個由 3 個項目組成的簡單解 ...

刪除 .NET 6 中集成測試的配置提供程序

[英]remove configuration providers for integration tests in .NET 6

我目前在 .NET 6 上有一個 web 應用程序,使用WebApplicationFactory進行集成測試。 這是我的 Program.cs 文件的簡化版本: 對於我需要模擬的大多數服務,我可以將它們從服務描述符中刪除。 但是,這不適用於我所看到的添加身份驗證等服務。 基本上,我正在尋找一種模擬 ...

Net6 控制台應用程序,自定義 ConfigurationProvider 問題

[英]Net6 Console app, custom ConfigurationProvider question

我有一個 .Net6 控制台應用程序,我需要從 AppSettings.json 檢索對象數組。 目前我正在使用“選項”類來檢索數組。 和 給我一個包含 subOpts 列表的 opts 對象。 子選項字段之一需要在加載/保存時進行解密和加密。 所以我想使用 CustomConfigPro ...

未找到配置管理器

[英]ConfigurationManager is not found

我在課堂上使用 ConfigurationManager。 我添加了使用 System.Configuration。 使用為灰色且 ConfigurationManager 未知。 為什么我的 .NET Core 3.1 項目不知道 System.Configuration.Configuratio ...

為什么 sqlconnection.open 在我的配置文件中出現問題?

[英]Why is sqlconnection.open nosing around in my config file?

今天我想,哦,我只是將一些 SQL 日志記錄添加到我們擁有的 C# SFTP 自定義(控制台)程序中。 不是我寫的,它可能有一個奇怪的配置文件。 看起來 SQL 性能計數器需要一個符合要求的配置文件? 為 TypeInitializationException 添加捕獲提供了一些更具體和有用的信息。 ...

C# 檢查處理程序是否存在於 Web.Config

[英]C# check if handler is present in Web.Config

在我的 Web.Config 文件中,我有以下內容: 在我運行一段特定的代碼之前,我想檢查我的 Web.Config 文件中是否存在處理程序。 這是我能做的事嗎? 我試過: ConfigurationManager.GetSection("system.webServer/handlers")但沒 ...

不驗證參數的腳本

[英]Script that doesn't validate argument

我有這個腳本,它在 Word 文檔中搜索“ Detection Method Type ”,然后從第 5 行提取值,例如"C:\program files\test\notepad.exe" ,然后腳本應將其拆分為$filepath文件路徑 = $filepath C:\program files\ ...

SCCM Powershell 使用 Set-CMTaskSequence 編輯 TaskSequence 設置

[英]SCCM Powershell edit TaskSequence settings using Set-CMTaskSequence

嘗試更改我的 TS 支持的操作系統以便在軟件中心隱藏/顯示它。 導入 ConfigurationManager.psd1 模塊並根據Set-CMTaskSequence的文檔,我應該能夠指定應該支持的操作系統: 如果我手動設置一個特定的操作系統,然后想撤消以下代碼,請將我的 TS 改回“在任何平台 ...

app.config 中的自定義配置部分無法讀取 883812976388 數據作為 C# 應用程序中的集合

[英]Custom configuration section in app.config cannot read xml data as collection in C# application

我有以下 class 擴展 ApplicationSettingsBase 如下 這是我的 App.config 當我使用 SMTPServerConfig.Instance.TestProp 時,它會顯示結果為“123123”(這是真實值,這意味着我有正確的配置架構),但 SMTPServerCo ...

.NET 6 C# 配置部分變化

[英].NET 6 C# configuration section variation

我正在使用 .NET 6 構建一個控制台應用程序。要加載我使用選項模式的設置,我想創建 json 配置文件,其中包含一組對象,這些對象的一個屬性有變化。 示例 json: 我想過為特性屬性使用一個空接口,但我不知道如何使用 Configuration.GetSection().Bind() 或 Co ...

SpecFlowPlusRunnerAssemblyHook 拋出異常無效的 URI:無法解析主機名

[英]SpecFlowPlusRunnerAssemblyHook throwing exception Invalid URI: The hostname could not be parsed

我正在將 SpecFlow 與 .net 3.1 應用程序一起使用。 當我運行/調試測試時,我在一些非常深的 dll 中不斷收到錯誤。 它似乎與 ConfigurationManager 相關。 2021-11-02T09:12:27.7102541-06:00:2021-11-02T09: ...

在 Azure 函數 V1 中,如何使用 ConfigurationManager 檢索 settings.json 值?

[英]In Azure function V1, how can I retrieve settings.json Values using ConfigurationManager?

我的一位客戶想要將舊的 .NET Framework 4.5.2 控制台應用程序遷移到 Azure 函數。 遺憾的是,這個控制台應用程序引用了一個在 .NET Framework 4.5.2 中開發的類庫,他們不想將它遷移到 .Net Core 或以任何方式修改它。 因此,該功能將采用 V1,這是 ...

使用一個 minion 的 IP 地址更新 minion 的配置文件

[英]Update the config file of minion with the IP Address of one minion

首先,我對鹽很陌生,如果這是一個微不足道的問題,請原諒我。 我有一個 salt-master 和 3 個 salt-minions(1 個 license-minion,2 個 app-minion)在我的設置中運行。 要求是使用 license-minion 的 IP 地址更新 2 個 app-m ...

有沒有辦法在不知道部分名稱的情況下讀取配置部分? (還有一些)

[英]Is there a way to read configuration sections without knowing the name of the sections? (And some more)

我正在使用一個程序,它需要處理一些所謂的“接口”。 程序不知道這些“接口”的名稱,但程序需要能夠讀取配置文件中提供的接口名稱、名稱和字段值。 為此,我創建了一個“App.config”文件,如下所示: 但是,為了在配置文件中讀取該信息,我使用了以下代碼(帶有相應的問題): 在觀察窗口中檢查 ...

是否有任何標准方法可以從 .NET 4.6.1 中的 appSettings.config 文件加載數組

[英]Is there any standard way to load array from appSettings.config file in .NET 4.6.1

我的appSettings.config文件中有這樣的設置 是否有任何標准方法可以直接將這些值讀取為 arrays ? 我知道我可以在讀取值並拆分字符串以獲取數組后使用字符串,但這很難看。 我也試過這個 但這實際上並沒有返回一個數組。 ...

IConfigurationRoot 和類型信息

[英]IConfigurationRoot and type information

根據此Using System.Text.Json to Serialize an IConfiguration back to Json看來您可以放入 JSON 的有限類型信息已被丟棄。 您似乎認為 IConfiguration 對象正在存儲對應於 JSON 元素類型的整數、布爾值等(例如)。 這 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM