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
570 stars 144 forks source link

dotnet publish fails with Could not load file or assembly 'System.DirectoryServices.Protocols' #642

Closed OnurGumus closed 4 years ago

OnurGumus commented 4 years ago

Description

My project builds and runs fine. But when I call dotnet publish from command line the publish fails with Could not load file or assembly 'System.DirectoryServices.Protocols

Repro steps

Create any project uses sqlprovider. Then use dotnet publish

Expected behavior

publish to succeed

Actual behavior

The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Unable to load one or more of the requested types.Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.Details: Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified

Known workarounds

No

Related information

Thorium commented 4 years ago

Do you have the System.DirectoryServices.Protocols.dll in your reference assembly folder?

OnurGumus commented 4 years ago

@Thorium yes, it is added as a nuget package. VS build and run is fine but dotnet publish fails.

OnurGumus commented 4 years ago

Any updates on this? This is a show stopper!

Thorium commented 4 years ago

I don't use dotnet publish, but it sounds to me that the database driver is depending to this dll that is not found for the path that the publish-command is looking. Maybe there is a way to 1) copy the dll manually to the correct path 2) or have some parameter to publish to force including/copying the reference dlls.

OnurGumus commented 4 years ago

@Thorium strangely those steps don't matter. I am a bit confused.

Thorium commented 4 years ago

I think we would need some support from dotnet.exe publish here, what is happening in the process different than with the normal build.

OnurGumus commented 4 years ago

I don't see this error any more with .net core 3.1