Unable to read connection string from app.config
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- postgresql
- 領域
- databases
調査の方向性
src/SQLProvider/Utils.fs から始め、特に getConStringFromConfig と、接続文字列を読み取る参照先の行を確認してください。失敗を再現するため、添付された例の docker-compose、restore、build の手順に従ってください。app.config の接続文字列を使用して provider が正常に接続し、ソースコードまたは実行時に接続文字列を要求しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
I'm attempting to specify the connection string to my DB in an app.config file in the root of my project, instead of hardcoding it in source. The type provider throws the following error:
No connection string specified or could not find a connection string with name DefaultConnectionString
I've read through the Utils.fs file, specifically the getConStringFromConfig function. I can see that line 235 reads match config.ConnectionStrings.ConnectionStrings.[connectionStringName]. Not sure if the double ConnectionStrings is intended? That said, I've tried a few variations of nesting in my app.config file with no luck.
Repro steps
- Download and extract the attached example
cdto root directory of exampledocker-compose updotnet restoredotnet build
Expected behavior
Successful connection to DB using connection string defined in app.config.
Actual behavior
The compiler throws the following error:
No connection string specified or could not find a connection string with name DefaultConnectionString
Known workarounds
- Hardcode the connection string in source
- Provide a connection string at runtime using
.GetDataContext connString(though doesn’t help where compilation needs to happen across differing environments)
Related information
- Used database: Postgres
- Operating system: MacOS and Windows 10 (tested on both)
- Branch:
master - .NET Runtime, CoreCLR or Mono Version: assuming CoreCLR - not sure how to be certain?
Performance information, links to performance testing scripts:
- 主要言語
- F#
- スター
- 627
- フォーク
- 147
- 平均マージ
- 2時間 2分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fsprojects/SQLProvider のほかの issue
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
fsprojects/SQLProvider#872 · コメント 2 件 ·
-
Repo Assist? オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
fsprojects/SQLProvider#870 · コメント 1 件 ·
-
postgresql
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
fsprojects/SQLProvider#869 · コメント 2 件 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 42/100
fsprojects/SQLProvider#868 · コメント 2 件 ·
-
sql server
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fsprojects/SQLProvider#851 · コメント 1 件 ·
fsprojects/SQLProvider の issue をすべて見る
似ている issue
-
Edit: CW+ オープンchannels:edit check:passed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Area/ICP Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
wso2/product-integrator#2514 ·
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
community-scripts/ProxmoxVE#17396 · コメント 1 件 ·
-
bug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/PictoPy#1553 · コメント 4 件 ·