VAF Event Handler App - Error when Event Handler activates

Hi,

Our Organization is working on moving towards VAF, away from VBscript from within Admin. As part of this process I am testing an application that has one of our Event handlers in it and I am installing it on one of our test Vaults. I am seeing the following error when the event fires in M-Files.

Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed.
The remote procedure call failed.

ExtensionManager_Legacy.cpp, 3185, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
ExtObjectPlatform_Legacy.cpp, 140, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
ExtObjectPlatform_Legacy.cpp, 1382, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
ExtObjectPlatform_Legacy.cpp, 1916, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
MCallInLoop.h, 535, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
ExtObjectPlatform_Legacy.cpp, 2005, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
ExtObjectPlatform_Legacy.cpp, 2147, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
ExtObjectPlatform_Legacy.cpp, 2147, The remote procedure call failed. (0x800706BE)
(M-Files 25.2.14524.3 2025-03-04T18:56:18.286Z)

Code (Removed Specifics in the Event handler code):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Reflection.Emit;
using System.Runtime.Remoting;
using System.Text;
using MFiles.VAF;
using MFiles.VAF.Common;
using MFilesAPI;
using static MFiles.VAF.Placeholders.PlaceholderTemplateParser;
using static System.Collections.Specialized.BitVector32;
using System.Windows;

namespace KageInnovation.VAF.EventHandlers
{
    
    public partial class VaultApplication : VaultApplicationBase
    {

        [EventHandler(MFEventHandlerType.MFEventHandlerAfterCheckInChangesFinalize, ObjectType = "MFiles.ObjectType.Part Revision")]
        [EventHandler(MFEventHandlerType.MFEventHandlerBeforeCreateNewObjectFinalize, ObjectType = "MFiles.ObjectType.Part Revision")]
        public void NullToEmptyEventHandler(EventHandlerEnvironment env)
        {
        
            --Event Handler Logic Here
        
        }
        
    }
    
}

Any Idea as to why we are seeing this error?

  • That error is from the startup process, not the event handler.  Are you overriding StartOperations and doing things?

  • I saw a previous forum post where you said we should not override start operations. The code above is really the entire structure of the project in its simplest form without any of the event handler code within it. I did not modify the appdef file or the configuration file.

  • Restart the vault with the app installed and look at the windows event log. Any errors reported? 

  • This is the error we see after restarting the vault.

    M-Files Online
    Kage_Test_Environment {B321EEA2-BDB1-4F88-9F04-CFBCF4FD330C}
    KageInnovation.VAF.EventHandlers (0.1)

    Starting the application "KageInnovation.VAF.EventHandlers" failed.
    Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed.
    The RPC server is unavailable.

    ExtensionManager_Legacy.cpp, 1905, Starting the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    ExtensionManager_Legacy.cpp, 1905, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    ExtObjectPlatform_Legacy.cpp, 1531, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    ExtObjectPlatform_Legacy.cpp, 1869, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    MCallInLoop.h, 578, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    MCallInLoop.h, 517, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    ExtObjectPlatform_Legacy.cpp, 2005, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    ExtObjectPlatform_Legacy.cpp, 2147, Executing the "StartOperations" method of the application "KageInnovation.VAF.EventHandlers" failed. (0x80040120)
    ExtObjectPlatform_Legacy.cpp, 2147, The RPC server is unavailable. (0x800706BA)
    (M-Files 25.2.14524.3 2025-03-06T22:00:09.823Z)

  • I have seen errors like this thrown during application startup if something goes badly wrong during the application initialization.  What methods do you override from the base?