MS SQL CLR Problem
Just an execution of this procedure thrown an exception.
Msg 6522, Level 16, State 1, Line 4
A .NET Framework error occurred during execution of user-defined routine or aggregate "ext_REMOTE_GET_DIR_INFO":
System.Exception: Cannot locate path of assembly [WinSCP, Version=1.0.4.2881, Culture=neutral, PublicKeyToken=b5f19f5762436b89] neither from its code base [], nor from its location []
System.Exception:
bei WinSCP.Logger.GetAssemblyFilePath()
bei WinSCP.ExeSessionProcess.GetExecutablePath()
bei WinSCP.ExeSessionProcess..ctor(Session session)
bei WinSCP.Session.Open(SessionOptions sessionOptions)
bei SqlNetwork.WinScpClient.WinScpManaged.EnumerateRemoteDir(String directory)
bei SqlNetwork.TabledFunctions.RemoteDirStructure(SqlString id, SqlString dir)
.
public class WinScpManaged : Abstracts.Ssh { /// <summary> /// Get Session Information. /// </summary> private SessionOptions ConnectionOptions { get { return new SessionOptions { Protocol = (Protocol)this.ProtocolType, HostName = this.Host, UserName = this.User, Password = this.Password, SshHostKeyFingerprint = this.HostKey }; } } private void StartSession(Session session) { //session.ExecutablePath = @"C:\Program Files (x86)\WinSCP\WinSCP.exe"; session.DisableVersionCheck = true; session.DebugLogPath = @"C:\projects\winscp\winscp.dbg"; session.SessionLogPath = @"C:\projects\winscp\winscp.log"; session.Open(this.ConnectionOptions); } public override IEnumerable EnumerateRemoteDir(string directory) { using (var session = new Session()) { this.StartSession(session); return session.ListDirectory(directory).Files; } }
WinSCP is installed and it have no effect if i use ExecutablePath or not.
No session has been started, so no output file for session log exists.
Debug output is
[2013-01-23 16:30:37.294Z] [000e] CallstackAndLock..ctor entering
[2013-01-23 16:30:37.300Z] [000e] Session.DoDispose entering
[2013-01-23 16:30:37.309Z] [000e] Session.Cleanup entering
[2013-01-23 16:30:37.310Z] [000e] Disposing log readers
[2013-01-23 16:30:37.313Z] [000e] Session.Cleanup leaving
[2013-01-23 16:30:37.356Z] [000e] CPU Load [266,8286%]
[2013-01-23 16:30:37.356Z] [000e] Disposing logger, no more logging
Hm, i do not really know what else to do...
Someone have any idea?
All assemblies are loaded into the Application Domain of the MS SQL Server. I guess, MS SQL load it directly from memory, so this assemblies have not location on the HDD. Sure, if you try to access assembly location so it will be always empty.
It is possible to activate embemed assembly call instead of calling it from path?