Using WinSCP in Sql Server - Finalizers must be removed.

Advertisement

gregoryagu
Joined:
Posts:
2

Using WinSCP in Sql Server - Finalizers must be removed.

I need to be able to SFTP from inside Sql Server. In other words, I have created a CLR stored procedure that uses WinSCP to connect to an SFTP site and upload a file. It works outside of Sql Server, but when I try to install, I get an error message from Sql Server.

The issue is that Sql Server does not allow any assembly that uses a Finalizer. It is forbidden in a Sql Server context. So I can't use WinSCP.dll as it is.

Is it possible to make a version that does not have any Finalizers in it? I downloaded the source code and looked through it, but I don't know C++. But I do know C# and would attempt to make changes if you think it is possible to make this work. I know it would be better to kept them there, but in this case, it's just not possible.

I would be happy to make a donation if you could make this work.

Greg

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Using WinSCP in Sql Server - Finalizers must be removed.

WinSCP itself (not the C# WinSCP .NET assembly wrapper) is pure WinAPI C++ application, not Managed C++. So there are no finalizers.

So you just need to remove finalizers from the C# part (dotnet folder). Note that source code for the .NET assembly is available only for the 5.2.x branch.

Your question on StackOverflow:
https://stackoverflow.com/q/19234629/850848

Reply with quote

Advertisement

You can post new topics in this forum