Closed dlidstrom closed 1 year ago
Update: I forgot to try with the latest version but the same seems to happen with 1.3.5.
I think the problem is Npgsql dependencies not being in the lib-folder.
Where is the best place to copy System.{Runtime,Data.Common,Diagnostics.Tracing,Threading,ComponentModel.TypeConverter}
from? This seems to be a common task and there are prepared prebuild scripts for it?
I have this script which seems to be all that is needed when using dotnet
on my old Macbook Pro:
$ErrorActionPreference = "Stop"
$packagesAndPaths=@(
@{
name = "System.Runtime.CompilerServices.Unsafe"
path = "6.0.0/lib/netstandard2.0"
}
)
$nugetPath=(dotnet nuget locals global-packages --list).Split(' ')[1]
New-Item -ItemType Directory -Name lib -Force
foreach ($item in $packagesAndPaths) {
$nugetDll = "$($item.name).dll"
$fullPath = "$nugetPath$($item.name.ToLower())/$($item.path)/$nugetDll"
Copy-Item $fullPath ./lib
" $fullPath > Copied $nugetDll into lib for type provider."
}
Seems to be documented here: https://github.com/fsprojects/SQLProvider/tree/master/tests/SqlProvider.Core.Tests/Postgres Would've been great if this documentation was more visible, for example here: https://fsprojects.github.io/SQLProvider/core/postgresql.html.
I am trying to compile a minimal sample using Visual Studio 17.0.17. I get an error about not being able to load the requested types:
The program looks like this:
and the project file:
Note that this builds fine with
dotnet
:I did not (yet) place any binaries in the lib folder (is this the problem?). This was all done using installed dotnet 7.0.101 on Windows. How come this works using
dotnet
but not Visual Studio?