I'm trying to create a server side script in V5R17 SP4, starting from the example contained into the document "Customizing Using Server_Side Hooks for Server Based Applications".
I use Visual Studio .NET 2003 and I have written the following simple code:
Imports System.IO
Public Class Application
Function BeforeUpdate(ByVal SmSession As SmApplic.SmSession, ByVal ClassID As Integer, ByVal Operation As SmApplic.ISmOperation, ByVal Stage As SmartServerHook.HookStageEnum, ByVal Str As String, ByVal FirstPar As SmRecList.SmRecordList, ByVal SecondPar As SmRecList.SmRecordList, ByVal ThirdPar As SmRecList.SmRecordList) As SmartServerHook.ErrorCodeEnum
Dim sw As StreamWriter = New StreamWriter("C:\BUGatewaySSS3.log",True)
sw.WriteLine("The server side script write. ")
sw.Close()
Exit Function
HandleError:
BeforeUpdate = SmartServerHook.ErrorCodeEnum.ecGen
End Function
End Class
I have linked in the Script Maintenance a dummy script to the "Before Update"
hook for the Project class, then I customized the ServerHooks.CLSID and
ServerHooks.Init keys as described in the documentation.
Then I registered the dll on the Smarteam Server wstation with the following command:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
C:\StandardSSS\bin\StandardSSS.dll /codebase
When in Smarteam Editor I update a value in a project Profile card,
the log file is not created, then it seems that the server side script is not running.
Why ? Did i forget something?
I then added the following code rows, in case the problem was born from a missing declaration: SmEngine.ServerMode = True
Dim Engine As SmApplic.SmFreeThreadedEngine
Engine = CreateObject("SmApplic.SmFreeThreadedEngine")
Engine.Init("SmTeam32")
Engine.ServerMode = True
SmSession = CreateObject("SmApplic.SmSession")
SmSession.Init(Engine, "My session", Engine.ConfigurationName)
but I got the same result.
Any hints? Thanks in advance,
Marcello Esposto
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP