Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

accessing a System Process via external CLR Function?

(2016-04-02)

In one of my developments, I needed to access a DOS Process and used a VB.NET external functon :

____________! SAPExternal.vb !______________________________________________

Imports System

Imports System.Diagnostics

Public Class SAPExternal

  Public Shared Function getProcess()

         Dim myProcess As Process = System.Diagnostics.Process.Start("notepad.exe", "C:\data\CLR\zTest.txt")

  myProcess.WaitForExit()

  myProcess.Close()

  getProcess = "OK"

  End Function

End Class

_________________________________________________________________________

Commenting out the 3 "myProcess" lines, compiling with vbc, I get the correct answer in :

CREATE FUNCTION getProcess()

RETURNS LONG VARCHAR

EXTERNAL NAME 'C:\data\CLR\SAPExt.dll::SAPExternal.getProcess() string'

LANGUAGE CLR

:

select getProcess()

Resetting the same 3 lines to active, I get an error that says something like (roughly transated from french) :

"Impossible to load the file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=........' or one of it's denpendencies..."

For my tests, all my files and database file are on the same folder.

After some days looking on internet, I am getting lost, and would like to know if somebody would have a suggestion or a solution ?

Tags:
Former Member
Not what you were looking for? Ask a question