[英]ConfigurationManager throwing null exception when trying to read connection string in .NET 4.0
我正在與ADO.NET一起研究 .NET Framework 4.0 Class Library項目。 我在App.config中有 connectionString ,我試圖使用ConfigurationManager讀取它,但得到空引用異常。 Error app.config Rea ...
[英]ConfigurationManager throwing null exception when trying to read connection string in .NET 4.0
我正在與ADO.NET一起研究 .NET Framework 4.0 Class Library項目。 我在App.config中有 connectionString ,我試圖使用ConfigurationManager讀取它,但得到空引用異常。 Error app.config Rea ...
[英]Unable to load .NET config sections into System.Configuration classes within an aws lambda function
我想使用 .NET 核心部署 AWS lambda function。 許多代碼與非 lambda 的其他應用程序共享。 我們在整個代碼中廣泛使用 System.Configuration。 但是,我們無法獲取 lambda 代碼來查找和加載配置文件。 這些是我們應用程序配置文件的片段。 然后在 ...
[英]Creating a custom ConfigurationElement with PropertyChanged event
我有一個自定義的可編輯ConfigurationElement ,通常我將它用作我的某些課程的設置 object。 (通過構造函數傳遞它) 當我有一個來自外部 dll 的 object 具有自己的設置屬性(所以我不能將其更改為直接從我的配置元素中讀取)時,我正在使用此擴展將配置屬性值復制到 ZA ...
[英]System.Configuration always saving default values
對於我的項目,我需要一個與可執行文件存儲在同一文件夾中的配置,並且用戶可以輕松訪問和編輯。 我在System.Configuration package 中找到了解決此問題的方法,但現在我遇到了問題。 問題是,當我嘗試保存配置文件時,它會創建它,但會用我假設為默認值的值填充所有值(因此字符串為空字符 ...
[英]The type name 'ConfigurationManager' could not be found in the namespace 'System.Configuration'. This type has been forwarded
我在使用 Visual Studio 2019 的 .NET 5.0 項目中收到此錯誤(在社區/學生版以及專業版上試用)。 “在命名空間'System.Configuration'中找不到類型名稱'ConfigurationManager'。此類型已被轉發......” 我發現的許多答案都說您需要 ...
[英]How do you copy files into Azure Function bin folder?
背景: 我有一個在 netcoreapp3.1 和 azure 版本 v3 中運行的 Azure 函數 C# 項目。 這是 csproj 的一個片段... 運行后異常: 懷疑原因: 問題是在通過 Visual Studios 構建 azure 函數時,它會創建以下文件夾結構。 (原諒我 ...
[英]Can't write ./config file for installing NIX
我正在嘗試安裝 NIX 以運行名為 ARTIQ 的軟件,並按照此頁面中給出的說明進行操作。 https://m-labs.hk/artiq/manual/installing.html#installing-via-nix-linux 我需要通過修改 ~/.config/nix/nix.conf ...
[英]ConfigurationManager could not be found
我有一個基於前端的 react 和后端的 .net MVC 的網站 我想在ConfigurationManager獲取 AppSettings 方法,但是 VS 告訴我, System.Configuration沒有ConfigurationManager類型名稱 我有一個關於System.Conf ...
[英]How to use Microsoft.Management.Infrastructure (MMI) instead of System.Management for local WMI queries
我有這個片段用於使用 WMIC 獲取 Windows 版本 由於 WMI 現在被認為是舊的,並且System.Configuration 的 .NET 核心實現需要最新的 .NET 框架,因此似乎需要使用 MMI 檢索此信息。 令人驚訝的是,每個需要 WMI 訪問的 Windows 問題都有類似於上 ...
[英]Child elements in c# ExeConfiguration (System.Configuration)
是否可以使用 ExeConfiguration 將子對象添加到 xml 文件? 我被困在這段代碼上,我無法弄清楚。 我想只是將 object 作為 ConfigurationElement 添加到 ConfigurationSection 並不是那么簡單。 有什么方法可以實現我想要的嗎? 這是我的配 ...
[英]Can not read user secrets on hosting server
我的.net核心應用程序有問題。 此問題是用戶機密json文件無法讀取。 應用程序在開發中工作正常,但應用程序在托管服務器的發行版中給了我錯誤。 錯誤代碼如下 應用程序啟動異常:System.ArgumentNullException:值不能為null。 參數名稱:C:\\ ...
[英]the name configurationmanager does not exist in the current context
我正在使用 Visual Studio Community for Mac(.NETCore.App(2.1.0)、MacOS 10.14.5)並且我正在嘗試使用 ConfigurationManager 類( https://docs.microsoft.com/de-de/ dotnet/api ...
[英]get & upload json data from .conf file
文件位置例如: http:// localhost:8080 / config / userlog.conf (具有json數據的文件) 下面的功能是從上面的文件中讀取數據。 問題:如何從.conf文件類型讀取數據 ...
[英]"Type is not defined" when I want to add my custom class as settings type
我想將此類添加為設置類型: 所以我做了什么: 在類型下拉框中選擇瀏覽... : 我在任何地方都看不到MY_PROJECT命名空間: 所以我手動輸入了完整的類型: 結果是一個錯誤: 我也單獨嘗試SUB_PROJECT.Configs和Configs 。 沒有任何幫助。 ...
[英]Is it possible to use .Net Standard System.Configuration.ConfigurationManager.AppSettings with an appSettings.json file
我希望能夠構建.Net標准庫,無論是從Net Framework還是Net Core應用程序調用它們,都可以檢索其自身的配置信息。 System.Configuration.ConfigurationManager已添加到Net Standard。 我已經證明可以使用它從傳統的應用程序或 ...
[英]Angular 2 Bootstrap Modal
我是Angular 2的新手,我試圖全面了解如何使用外部庫,尤其是Bootstrap模態。 按照https://www.npmjs.com/package/ng2-bootstrap-modal中的說明,我運行了以下命令: 在我的index.html中,我已經驗證了以下內容: ...
[英]Custom ConfigurationSection throws Unrecognized attribute in web.config
我正在研究並替換應用程序中的先前配置策略,以使其更有意義,但它會在應用程序加載時引發“無法識別的屬性”異常。 這是我的配置部分 這是web.config ... 錯誤是“ Config Error Unrecognized attribute 'defaultPageInd ...
[英]Unable to get user secret from confiuration manager in .net core
我當前正在設置.net核心Web應用程序,並已設置MailKit來處理其電子郵件發送。 與其對我的smtp密碼進行硬編碼,不如使用用戶密碼選項。 但是由於某種原因,每次我嘗試檢索密碼時,密碼都會返回空值。 錯誤: 處理請求時發生未處理的異常。 ArgumentNullExc ...
[英]error CS0012: The type 'ConnectionStringSettings' is defined in an assembly that is not referenced after upgrading to Visual Studio 2015
我剛剛從Visual Studio 2013 Pro升級到Visual Studio到2015(企業版),並且在編譯解決方案時出現以下錯誤: 錯誤CS0012:類型'ConnectionStringSettings'在未引用的程序集中定義。 您必須添加對程序集'System.Conf ...
[英]System.Configuration Configuration Manager
我在我的程序集中使用 System.Configuration,但是一旦我實現了 getter/setter,代碼頂部的 System.Configuration 鏈接就會變灰(未在程序集中使用) 配置和配置管理器用紅色下划線代替青色。 錯誤信息是: 找不到類型和/或命名空間名稱配置。 ( ...