First of all, here's my scenario: We get daily handoffs for a container project. I have created a tool that prepares the original files (always in a certain folder named yyyy-mm-dd), then adds that folder to an existing Studio project, pre-translates them and then creates a translation package.
This used to work.
Now that I have updated to 2017 SR1, the package creation fails. Sort of. When I open the project in Studio, I can see the task. Opening the project file in an XML editor I can also see the package task:
<ProjectPackageCreation PackageName="[myPackageName]" Comment="" PackageGuid="9e660153-2c7e-4990-95a3-befb6ac63a52" Guid="515d1e47-ffdc-42e3-9048-e7c289bf7746" Status="InProgress" PercentComplete="0" Path="Packages\Out\[packageName].sdlppx">
<Tasks>
<TaskRef TaskGuid="974a5ec3-6193-419c-ae94-31f95f9e13ee" />
</Tasks>
<Files>
<TaskFileRef TaskFileGuid="12128ca1-b963-4811-960f-7ee4391c1615" />
<TaskFileRef TaskFileGuid="4e00475c-ff31-4c44-bbd9-d1798894cf55" />
</Files>
<Result Guid="00000000-0000-0000-0000-000000000000" />
</ProjectPackageCreation>
What is rather strange here is the status and PercentComplete. As you can see, the package is 0% complete and in progress, no error message.
This is how I create the package:
var projectPackage = _project.CreateProjectPackage(
"Translate",
"Übersetzer",
tag,
tGuids);
var packageName = $"{_project.GetProjectInfo().Name}_{tag.Year}_{tag.Month:00}_{tag.Day:00}.sdlppx";
var options = new ProjectPackageCreationOptions
{
IncludeAutoSuggestDictionaries = false,
IncludeExistingReports = false,
IncludeMainTranslationMemories = true,
IncludeReports = false,
IncludeTermbases = false,
RecomputeAnalysisStatistics = false,
RemoveAutomatedTranslationProviders = true,
RemoveServerBasedTranslationMemories = true,
ProjectTranslationMemoryOptions = ProjectTranslationMemoryPackageOptions.UseExisting
};
var projectPackage = _project.CreateProjectPackage(
newTask.Id,
packageName,
"",
options);
try
{
while (projectPackage.Status == PackageStatus.InProgress)
{
Thread.Sleep(500);
}
var newTask = _project.CreateManualTask(
_project.SavePackageAs(projectPackage.PackageId, packagePfad);
_project.Save();
//...
The code then throws an exception at .SavePackageAs with a FileNotFound exception. But it should not reach that code as long as the package is still in progress.
Can anyone enlighten me what is going on here? Is package creation API broken in SR1 or what?
Best,
Andreas