This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VAF - DLL missing at execution

Hello,

I have developed a Vault app which uses a nuget which requires a few more.

Everything is ok and the code is working in a console application. However, I have a runtime error in the M-Files vault when changing the workflow state that launches the code.

The BouncyCastle.Crypto DLL is apparently missing. However, it is in the .mfappx file

Has anyone seen a situation like this before? Can I copy the missing DLL by hand? I did not find in which directory.

Thank you in advance for your suggestions.

Parents
  • Hi, 

    Not quite sure how do you test it in console app. Vault apps have to be deployed into Vault (manually or with script, Applications and then install your mfappx bundle). I've used 3rd party dependencies (e.g. OpenXML) that are used on the runtime and it worked well actually. 

    If you have all dependencies in your mfappx and install it in Vault applications, it should actually work. Don't know how you create MFAPPX file, it is actually simple ZIP containing appdef.xml, so be sure you have that file too. If you use VIS template, you can very easily create proper mfappx but as mentioned you can zip your bin folder with all your dependencies and it should work then properly.

    The other thought is to verify your dependency is .NET framework compatible (until 4.8). VAF/M-Files does not support .NET Core/5+.

    Dejan

  • For testing, I create a console project and reference the M-Files VAF nuget. So I can use helpers like ObjVerEx or SearchBuilder.


    Other projects have also dependencies and works weel. I am indeed using the template for the Vault applications to create the .mfappx file

    The .Net version is 4.8 and the appdef.xml is present.

    The error message is:

    Could no load file or assembly 'BouncyCaslte.Crypto, Version = 1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942' or one of its dependencies. The system cannot find the file specified.

    Finally,  I have a myProject.dll.config file like this:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.8.10.0" newVersion="1.8.10.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="10.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup></configuration>

  • The VAF isn't really designed this way, although it can be done.

    The problem appears to be within .NET rather than M-Files; it cannot find the DLL with that name/type.  I note that your error message has the assembly name misspelt.  Are you trying to lazy-load this, perhaps, and have some sort of typo?

  • FYI: the VAF does not support project configuration files.  If you are using these for binding redirection then you will instead need to use the AssemblyResolve event.

  • Hello,

    I misspelt it when copying from the screen capture. Sorry.

    Is M-Files sing a another version of this DLL?

Reply Children