Replies: 1 comment 1 reply
-
By copying the file from the "runtimes\win\lib" back down to DOTNET_ASSEMBLY_SEARCH_PATHS, I was able to execute the entire SqlConnection constructor. But things subsequently fail when opening the connection, with .Open():
I was able to find that file and copy it back to DOTNET_ASSEMBLY_SEARCH_PATHS as well. Now everything works. Would love to hear how others handle this issue. I'm assuming the problem is related to unmanaged code for specific platforms. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm getting this annoying error from SQL.
System.PlatformNotSupportedException: 'System.Data.SqlClient is not supported on this platform.'
Things work fine on the driver while debugging via org.apache.spark.deploy.dotnet.DotnetRunner. But when the same type of code is delegated to the Spark.Worker.TaskRunner process, those keeps hitting these exceptions.
I think the problem is related to either the .Net Core version, or related to the DOTNET_ASSEMBLY_SEARCH_PATHS.
The driver reports the System.Environment.Version as 3.1.10 and the worker reports it as 3.1.8. This seems like it could be an issue (although probably unlikely).
I think I found a better clue related to the origin of the assembly System.Data.SqlClient.dll. The worker is loading it from a path like so:
... which is in the directory that is set by DOTNET_ASSEMBLY_SEARCH_PATHS.
... But the driver loads System.Data.SqlClient.dll from a path like so:
I'll continue playing with this but would appreciate any help. Honestly I'm not that familiar with .Net Core ... so I don't know how it loads assemblies in the normal case, let alone when there is an environment variable being used (like DOTNET_ASSEMBLY_SEARCH_PATHS).
I may try copying the "good" assembly over the "bad" one and see what happens. But manual steps like that aren't great as a long-term solution.
Beta Was this translation helpful? Give feedback.
All reactions