fsprojects / SQLProvider

A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.
https://fsprojects.github.io/SQLProvider
Other
564 stars 144 forks source link

ConnectionStringName Parameter Not Finding Value in App.confg #722

Closed raquila closed 3 years ago

raquila commented 3 years ago

Describe the bug I just upgrade from version 1.1.5.0 to 1.2.1 and the same code that was working is now throwing an error that the connection string was not found.

Error FS3033 The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Could not find a connection string with name 'APPDB'

If I revert back, the error goes away.

To Reproduce Upgrade from version 1.1.5.0 to 1.2.1, this line of code now throws error. SqlDataProvider<Common.DatabaseProviderTypes.MSSQLSERVER,ConnectionStringName="APPDB",UseOptionTypes=true> App.config contains a connection string called APPDB

Expected behavior No errors

Additional context .Net 4.8 fsharp.core 4.7.2

Thorium commented 3 years ago

I expect any 1.1.x is working and 1.2 needs a proper compile-time connection string... Is there such thing as App.config in .Net Standard?

JordanMarr commented 3 years ago

You would typically use an appSettings.json file in .NET core. https://blog.hildenco.com/2020/05/configuration-in-net-core-console.html

Thorium commented 3 years ago

yes, but this issue is raised on .Net framework full. But how could we support both models from one library? The ConfigurationManager is not the same.

I would recommend using separate compile-time connection string and then runtime use a parameter... This is duplicate of #625