I use Trados 2024 API for project automation testing. My first step is to set up a project, I have activated Trados 2024.
When I run the code, it displays the errors, my sample code:
using Sdl.Core.Globalization;
using Sdl.Core.Settings;
using Sdl.Core.Globalization.Async;
using Sdl.Desktop.Platform;
using Sdl.FileTypeSupport.Framework.Core;
using Sdl.FileTypeSupport.Framework.BilingualApi;
using Sdl.FileTypeSupport.Framework.IntegrationApi;
using Sdl.FileTypeSupport.Framework.NativeApi;
using Sdl.FileTypeSupport.Filters;
using Sdl.ProjectApi;
using Sdl.ProjectAutomation.Core;
using Sdl.ProjectAutomation.FileBased;
using Sdl.ProjectAutomation.Settings;
using Sdl.TranslationStudio.LanguageCloud;
using Sdl.LanguagePlatform.Core;
using Sdl.LanguagePlatform.TranslationMemory;
using Sdl.LanguagePlatform.TranslationMemoryApi;
using Sdl.LanguagePlatform.Core.Tokenization;
using System.Collections.Generic;
using Sdl.FileTypeSupport.Filters.Xml.Dita.Settings;
using Sdl.FileTypeSupport.Framework.Core.Settings;
using Sdl.ProjectAutomation.AutomaticTasks;
using System.IO;
using System;
namespace AutoTrados
{
class Program
{
static void Main(string[] args)
{
try
{
string projectName = "MySDLProject";
string projectPath = @"C:\Users\Felix\Documents\Studio 2024\Projects\";
string sourceLanguageCode = "en-US";
string[] targetLanguageCodes = { "fr-FR", "zh-CN" }; // target language array
// initialize language object
Language sourceLanguage = new Language(sourceLanguageCode);
// initialize target language array
Language[] targetLanguages = new Language[targetLanguageCodes.Length];
for (int i = 0; i < targetLanguageCodes.Length; i++)
{
targetLanguages[i] = new Language(targetLanguageCodes[i]);
}
string localProjectFolder = Path.Combine(projectPath, projectName);
if (!Directory.Exists(localProjectFolder))
{
Directory.CreateDirectory(localProjectFolder);
}
// Project Info
ProjectInfo info = new ProjectInfo
{
Name = projectName,
Description = "First trial project.",
SourceLanguage = sourceLanguage,
TargetLanguages = targetLanguages,
DueDate = DateTime.Now.AddDays(3),
LocalProjectFolder = localProjectFolder,
};
FileBasedProject newProject = new FileBasedProject(info);
Console.WriteLine("Project initialized successfully.");
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
Console.WriteLine($"Stack Trace: {ex.StackTrace}");
}
Console.WriteLine("Press Enter to exit.");
Console.ReadLine();
}
}
}
it shows the errors:
2024-12-12 21:00:45,001 ERROR Sdl.Desktop.Platform.Perpetual.PerpetualLicense - Error initializing perpetual license
Sdl.Core.PluginFramework.PluginFrameworkException: No Application specific plug-in directory found.
at Sdl.Core.PluginFramework.DefaultPluginLocator..ctor()
at Sdl.Core.PluginFramework.PluginManager.get_DefaultPluginRegistry()
at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.get_LicensingProviderFactories()
at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.CreateProvider(ILicensingProviderConfiguration config, String preferredProviderId, ILoggerFactory loggerFactory)
at Sdl.Common.Licensing.Provider.Core.ApplicationLicenseManager.GetCurrentLicensingProvider()
at Sdl.Desktop.Platform.Perpetual.PerpetualLicense.Initialize()
Error: No Application specific plug-in directory found.
Stack Trace: at Sdl.ProjectAutomation.FileBased.FileBasedProject.GetDefaultProjectTemplateReference()
at Sdl.ProjectAutomation.FileBased.FileBasedProject..ctor(ProjectInfo projectInfo)
at AutoTrados.Program.Main(String[] args) in C:\Users\FSun1\source\repos\AutoTrados\AutoTrados\Program.cs:line 71
Press Enter to exit.