Vault 2017.0.2 update preventing api login - sometimes

Vault 2017.0.2 update preventing api login - sometimes

JamieVJohnson2
Collaborator Collaborator
3,282 Views
5 Replies
Message 1 of 6

Vault 2017.0.2 update preventing api login - sometimes

JamieVJohnson2
Collaborator
Collaborator

This is another case of the other guy's computer not working.  I've written a custom UI (WPF) that utilizes vault api to get file, folder, and item data from vault, then download files to user's desktop.  Very simplistic, no vault api forms being used, written so the user can find files in a structured and safe read-only mode.  Here is my code for connecting to vault.

 

Public Shared Function LoginVault() As Vault.Currency.Connections.Connection
        Dim sec As Security = Security.Instance
        Dim strVaultServer As String = sec.VaultServer
        Dim strVault As String = sec.VaultVault
        Dim strUser As String = sec.VaultViewerUsername
        Dim strPassword As String = sec.VaultViewerPassword
        Dim lgResults As Vault.Results.LogInResult =
               VDF.Vault.Library.ConnectionManager.LogIn(strVaultServer, strVault, strUser, strPassword, VDF.Vault.Currency.Connections.AuthenticationFlags.Standard, Nothing)
        If lgResults.Success = True Then
            Return lgResults.Connection
        Else
            Dim strErrorMessages As String = String.Empty
            For Each ErrMsg As KeyValuePair(Of Vault.Results.LogInResult.LogInErrors, String) In lgResults.ErrorMessages
                strErrorMessages += Vault.Results.LogInResult.LogInErrors.GetName(GetType(Vault.Results.LogInResult.LogInErrors), ErrMsg.Key) & vbCr & ErrMsg.Value & vbCr
            Next
            MsgBox("Unable to log into vault." & vbCr & strErrorMessages)
            Dim ehLogin As New ErrorHandler(New System.Exception(strErrorMessages & strVaultServer & " ; " & strVault & " ; " & strUser & " ; " & strPassword))
            ehLogin.QuietlyHandleIt()
            Try
                If MsgBox("Attempt manual login?", MsgBoxStyle.YesNo, "Vault Connection") = MsgBoxResult.Yes Then
                    Dim conn As Vault.Currency.Connections.Connection = Nothing
                    conn = LoginVaultManually()
                    Return conn
                End If
            Catch ex As Exception
                Dim eh As New ErrorHandler(ex)
                eh.HandleIt()
            End Try
        End If
        Return Nothing
    End Function

Recently I updated it to display the errors from logging in for best quality control.  On my own machine (which has vault client installed) everything works fine here.  On my test computer, I get the error "Incompatible version, can't get a license".  Initially I thought that may be related to the dlls that came with the SDK vs the updated 2017.0.2 version.  First of all I don't need it to get a license, I really only want read only access.  A select few windows 7 computers before today were also complaining about "InvalidServer;Could not load file or assembly 'Autodesk.Connectivity.WebServices.Interop.dll' or one of its dependencies. The specified module could not be found."

 

My references for this project are:

Autodesk.Connectivity.WebServices (Copy Local, ver 22.0.0.0, per visual studio)

Autodesk.Connectivity.WebServices.Interop (Copy Local, ver 22.0.0.0, per visual studio)

Autodesk.Connectivity.WebServices.WCF (Copy Local, ver 22.0.56.0, per visual studio)

Autodesk.DataManagement.Client.Framework (Copy Local, ver 22.0.0.0, per visual studio)

Autodesk.DataManagement.Client.Framework.Vault (Copy Local, ver 22.0.0.0, per visual studio)

 

I also added clmloader.dll to the project,by using the method of manually copying the files to the project folder, and adding it to the project, then setting it as Build Action: Content, Copy to Output Direct: Copy always.

 

Is there a 2017.0.2 sdk set of dll's I should be using?

 

This setup worked ok for 4 months, until this update.  Now It doesn't.  Please help me to fix it.

 

Thanks,

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Accepted solutions (3)
3,283 Views
5 Replies
Replies (5)
Message 2 of 6

JamieVJohnson2
Collaborator
Collaborator

More specifically, the error I have to overcome is thus:

lgresults.Exception:

{"Exception of type 'Autodesk.Connectivity.WebServices.VaultLicenseMismatchException' was thrown."}

Target Site:

{Void ValidateLicenseForEdition(System.Collections.Generic.IEnumerable~1[Autodesk.Connectivity.WebServices.Product])}

 

It is saying 2017 dlls from the SDK don't get along with the 2017.0.2 hotfix update (and subsequent sever vault migrations).  Am I correct?

Can I take the dlls from Vault explorer, and use them instead?

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 6

JamieVJohnson2
Collaborator
Collaborator

Additional info, I installed Vault Professional 2017 (out of box version 22.0.56.0).  Without ever opening vault client on my test computer, I ran my program.  It then opened vault license manager, and asked if I wanted to select standalone or network license.  (what I expect when I first open Vault Pro 2017 client explorer).  I selected network, gave it the server, it continued to log in and function properly (My coded version does work when vault client is installed).  So, to double check, I uninstalled Vault Pro, and the program went back to its ways complaining that vault license is incompatible version.

 

That means, the server license manager is looking for a mechanism that comes with the vault client, that does not come with the sdk.  Any clue as to what?

 

Thanks,

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 4 of 6

JamieVJohnson2
Collaborator
Collaborator
Accepted solution

Since I started this, I'm going to work it until it is finished...

 

The user I hard-wired to log into the server is a user that was only grated read-only permissions anyway.  So I changed the login setting from .Standard to .ReadOnly

 

VDF.Vault.Library.ConnectionManager.LogIn(strVaultServer, strVault, strUser, strPassword, VDF.Vault.Currency.Connections.AuthenticationFlags.ReadOnly, Nothing)

 

This solved the problem for the invalid license version error.

 

The next problem was the Windows 7 issue with the Vault Server Autodesk.Connectivity.WebServices.dll file or sub file not found.  This problem was mysteriously solved when I installed Visual Studio Community (express really) 2015 onto the Windows 7 computers.  SO something in the visual studio install fixed everything.  I did not let the install finish before I tested it the second time.  The installer only got past: C++ redistributables (for 2013, 2015) and .Net 4.5.1 Multi, and a few other windows core system updates.

 

If I can get a chime in on which core system most likely fixed the dll issue, then I can require that in my programs package that will force said update on the user's computers.

 

Thank you,

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 5 of 6

psaarloos
Collaborator
Collaborator
Accepted solution

Hi,

 

Vault 2017 API basically only works when Vault Client 2017 is installed. It's because of the new 'clic' licensing mechanism. I've been trying everything as well with some web services we've developed. Before 2017 we could just deploy the web services to the ADMS server and they would be able to query Vault, but since 2017 we have to install Vault Client as well on the server although it's never being used. It just needs to be there to have the clic licensing mechanism working correctly.

 

One other thing about the read-only connection. The enum you are using in the LogIn method is correct, but probably you will still see a license being pulled (reserved) in LMTools. Right? To fix this you'll need to add an app.config to your project. If it's not in there yet, right click your project in the solution browser, choose Add --> New Item --> Application Configuration File.

 

The content of this file should be minimal:

 

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="Licensing" type="Autodesk.Connectivity.WebServices.LicensingSection, Autodesk.Connectivity.WebServices"/>
  </configSections>
  <Licensing edition="None"/>
</configuration>

 

After building your code there will be an .exe.config file on the output location. After launching your application no license is being pulled of the server anymore 🙂

 

Hope it helps.

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
Message 6 of 6

JamieVJohnson2
Collaborator
Collaborator
Accepted solution

For those still looking, I have narrowed it down to one final issue.  The users of any custom program that utilizes the 2017 SDK dlls, MUST install the Microsoft Visual C++ Redistributable for 2015 (64bit in my environment) aka version "14".  This can be done by brute force:

 

https://www.microsoft.com/en-us/download/details.aspx?id=53840

 

or by visual studio's project properties / Publish tab / Prerequisites... button / Visual C++ "14" Runtime Libraries check boxes.

 

Thank you everybody for all your attentive help.

 

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/