FileBasedProject.GetSourceLanguageFiles crash

Hello everyone,

similar to my other Question "ReturnPackageImport.Files property crash with Reference Documents" i now managed to reproduce a crash, with just two lines of code

FileBasedProject project = new FileBasedProject(@"C:\Temp\Trados_TM_Speichern\92765\92765.sdlproj");
ProjectFile[] files = project.GetSourceLanguageFiles();

Exception see screenshot:

In the test application, i am neither using ITranslatableFile nor ReferenceFile, so it seems to be a problem inside the Studio API itself.
My test project does contain a sdlxliff file (based on XML) as well as a HTML reference file.

@Romulus: I already sent you some customer specific test data.


Did anybody else have the same problem?

Regards,
Mario

  • Hi Mario,

    I believe you are correct, and this is a bug in the implementation.
    I think they just forgot to account for references files and just cast everything to ITranslatableFile (which is shown in the error message)
  • After talking with Romulus, the problem seems to be that our test project contains a reference file in the target language.
    As Romulus said, there should never be a reference file in the target language in any studio project.

    So we made some tests, and found out that this might be a bug inside of Studio itself (not an SDK Bug):

    Example 1: Correct behaviour
    - Take an existing project
    - Delete all files out of it
    - Add a new translatable file and a new reference file
    - Try to execute a batch task afterwards via right-click menu. You will not be able to select a reference file and run batch tasks for it (in right click menu there will be no available batch tasks for the reference file)
    - If you look into the project, there will not be any reference files in any target language of the project

    Example 2: Problematic behaviour
    - Use the Create Project Button to Create a new project and follow all the steps in the wizard:
    - Select Project template/location
    - Select source/target languages
    - Add a translatable file and a reference file (select two files and change the usage here too)
    - (Select Translation memories)
    - (Select Termbases)
    - (Select Mode for Perfect Match)
    - !!!NOW: Run batch tasks!!!
    - Choose any task sequence which contains at least both the task for Converting to SDLXLIFF, as well as creating target versions of the files
    - (Select additional Parameters for chosen batch tasks)
    - Start processing
    - If you look into the project target languages now, the reference documents will always exist there as well

    We also reported this to SDL, but it has not been confirmed as a bug yet. But i think that multiple API problems can also be caused by this behaviour at project creation.
  • In the meantime, SDL has confirmed this as Bug and is working on a permanent fix, which should be released in one of the future releases of studio.