Closed jfabry closed 6 months ago
I have found the underlying problem and produced a workaround, and am leaving it here at least for reference.
The issue is that Assembly.LoadFrom(string assemblyFile)
expects the path assemblyFile
to have a filename extension. The file C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\ExternalLibraries\5\65537\1\regex
does not. This then throws a FileNotFoundException, aborting the load.
The workaround that I'm using is as follows:
.dll
filename extension to the regex
file, @script = N'regex.dll;UserExecutor.CSharpRegexExecutor'
(i.e. adding .dll
as well). This makes the example work for me. I expect that this is a general issue, not just limited to this regex sample, so it seems that a more fundamental fix would be needed.
Fixed by pull request #44
Hi all,
I am attempting to get the sample for .Net C# working, but I get the following error in the EXEC sp_execute_external_script step
Error: Could not load file or assembly 'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\ExternalLibraries\5\65537\1\regex'. The specified module could not be found.
(Full error message below).The file exists and is indeed the dll of the regex sample that I built and installed successfully. Suspecting permissions issues, I checked permissions on the directory and icacls tells me:
ExternalLibraries APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(OI)(CI)(RX)
. I have also tried withAPPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(OI)(CI)(F)
but to no avail.I am using the .NET C# language extension v1.1.0 on a fresh install of Microsoft SQL Server Developer (64-bit) v 16.0.1000.6, on a Windows 10 Pro (10.0) machine.
I am not sure on how to proceed at this point. Any help would be greatly appreciated.
Thanks in advance!