My Code
ProjectInfo info = GetProjectInfo();
ProjectTemplateReference template = new ProjectTemplateReference(@"C:\Users\wes\Documents\Studio 2014\Project Templates\Werner.sdltpl");
FileBasedProject project = new FileBasedProject(info, template);
ProjectFile[] files = project.AddFiles(new[] {@"C:\Program Files (x86)\FCT\tim_app\tim_local\Translation\OBJ_DCL-0000000109-001\OBJ_DCL-0000000109-001_EN\Export\OBJ_DCL-0000000109-001_EN.xml"});
Guid[] fileId = { files[0].Id };
project.SetFileRole(fileId, FileRole.Translatable);
TaskSequence seq = project.RunDefaultTaskSequence(fileId);
project.Save();
private ProjectInfo GetProjectInfo()
{
ProjectInfo info = new ProjectInfo
{
Name = "TIM-Connector1",
Description = "This is a programmatically created project.",
DueDate = DateTime.Now.AddDays(3)
};
info.LocalProjectFolder = @"D:\Testprojekte\SDL-Connector\Test\Projects\" + info.Name;
info.SourceLanguage = new Language(CultureInfo.GetCultureInfo("de-DE"));
Language[] trgLangs = { new Language(CultureInfo.GetCultureInfo("en-US"))};
info.TargetLanguages = trgLangs;
return info;
}
Exception
<Messages Level="Error" Message="Unexpected exception when initializing task 'Analyse': Failed to create an instance of translation provider 'sdltm.file:///C:/Users/wes/Documents/Studio 2014/Translation Memories/Werner_de_en.sdltm'.." Source="AutomaticTaskExecuter">
<ExceptionData><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Body>
<a1:ProjectApiException id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/Sdl.ProjectApi/Sdl.ProjectApi%2C%20Version%3D11.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dc28cdb26c445c888">
<ClassName id="ref-4">Sdl.ProjectApi.ProjectApiException</ClassName>
<Message id="ref-5">Unexpected exception when initializing task &#39;Analyse&#39;: Failed to create an instance of translation provider &#39;sdltm.file:///C:/Users/wes/Documents/Studio 2014/Translation Memories/Werner_de_en.sdltm&#39;..</Message>
<Data xsi:null="1"/>
<InnerException href="#ref-6"/>
<HelpURL xsi:null="1"/>
<StackTraceString id="ref-7"> bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()
bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.Execute()
bei Sdl.ProjectApi.Implementation.AutomaticTaskExecuter.Execute()</StackTraceString>
<RemoteStackTraceString xsi:null="1"/>
<RemoteStackIndex>0</RemoteStackIndex>
<ExceptionMethod id="ref-8">8
InitializeTaskImplementations
Sdl.ProjectApi.Implementation, Version=11.0.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888
Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation
Void InitializeTaskImplementations()</ExceptionMethod>
<HResult>-2146233088</HResult>
<Source id="ref-9">Sdl.ProjectApi.Implementation</Source>
<WatsonBuckets xsi:null="1"/>
</a1:ProjectApiException>
<a3:ProjectAutomationException id="ref-6" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Sdl.ProjectAutomation.Core/Sdl.ProjectAutomation.Core%2C%20Version%3D3.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dc28cdb26c445c888">
<ClassName id="ref-10">Sdl.ProjectAutomation.Core.ProjectAutomationException</ClassName>
<Message id="ref-11">Failed to create an instance of translation provider &#39;sdltm.file:///C:/Users/wes/Documents/Studio 2014/Translation Memories/Werner_de_en.sdltm&#39;.</Message>
<Data xsi:null="1"/>
<InnerException href="#ref-12"/>
<HelpURL xsi:null="1"/>
<StackTraceString id="ref-13"> bei Sdl.ProjectAutomation.FileBased.Internal.AutomationServerEvents.HandleTranslationProviderException(TranslationProviderItem translationProviderItem, Exception exception)
bei Sdl.ProjectApi.Helpers.ProjectCascadeFactory.GetTranslationProviderLanguageDirection(TranslationProviderItem translationProviderItem, LanguagePair languageDirection, Boolean performUpdate, Boolean refreshCache)
bei Sdl.ProjectApi.Helpers.ProjectCascadeFactory.CreateProjectCascadeEntries(IList`1 projectCascadeEntryDataList, LanguagePair languagePair, Boolean readOnly, Boolean refreshCache)
bei Sdl.ProjectApi.Helpers.ProjectCascadeFactory.CreateCascade(ProjectCascadeSettings projectCascadeSettings, Boolean refreshCache)
bei Sdl.ProjectApi.Helpers.LanguageDirectionHelper.CreateCascade(ILanguageDirection languageDirection, ProjectCascadeEntryDataFilterFunction filter, IComparer`1 sort, Boolean readOnly, Boolean refreshCache)
bei Sdl.ProjectApi.Helpers.LanguageDirectionHelper.CreateCascade(ILanguageDirection languageDirection, Boolean refreshCache)
bei Sdl.ProjectApi.Helpers.LanguageObjectsCache.&#60;&#62;c__DisplayClass4.&#60;GetRecognizers&#62;b__3()
bei Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetOrCreateObject(String key, Func`1 createObject)
bei Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetRecognizers(ILanguageDirection languageDirection)
bei Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageTools(ILanguageDirection languageDirection)
bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.CreateAnalysisDataStorage(ILanguageDirection languageDirection, AnalysisTaskSettings analysisSettings, TranslationMemorySettings translationMemorySettings, ILanguageObjectsCache objectsCache)
bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.GetAnalysisDataStorage(ILanguageDirection languageDirection, AnalysisTaskSettings analysisSettings, TranslationMemorySettings translationMemorySettings, ILanguageObjectsCache objectsCache)
bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.Initialize(IList`1 files)
bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX..ctor(IList`1 files)
bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.CreateAnalysisDataCollectors()
bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.InitializeTask(IExecutingAutomaticTask task)
bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()</StackTraceString>
<RemoteStackTraceString xsi:null="1"/>
<RemoteStackIndex>0</RemoteStackIndex>
<ExceptionMethod id="ref-14">8
HandleTranslationProviderException
Sdl.ProjectAutomation.FileBased, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888
Sdl.ProjectAutomation.FileBased.Internal.AutomationServerEvents
Void HandleTranslationProviderException(Sdl.ProjectApi.TranslationProviderItem, System.Exception)</ExceptionMethod>
<HResult>-2146233088</HResult>
<Source id="ref-15">Sdl.ProjectAutomation.FileBased</Source>
<WatsonBuckets xsi:null="1"/>
</a3:ProjectAutomationException>
<a5:FileLoadException id="ref-12" xmlns:a5="http://schemas.microsoft.com/clr/ns/System.IO">
<ClassName id="ref-16">System.IO.FileLoadException</ClassName>
<Message id="ref-17">Die Assembly im gemischten Modus wurde während Version v2.0.50727 der Laufzeit erstellt und kann nicht während der 4.0-Laufzeit ohne zusätzliche Konfigurationsinformationen geladen werden.</Message>
<Data xsi:null="1"/>
<InnerException xsi:null="1"/>
<HelpURL xsi:null="1"/>
<StackTraceString id="ref-18"> bei Sdl.LanguagePlatform.TranslationMemoryImpl.API.GenerateFault(Exception e)
bei Sdl.LanguagePlatform.TranslationMemoryImpl.API.GetTranslationMemories(Container container, Boolean checkPermissions)
bei Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory.FileBasedTranslationMemoryDescriptor.GetTranslationMemorySetup(Boolean checkPermissions)
bei Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory.FileBasedTranslationMemoryDescriptor.get_Id()
bei Sdl.LanguagePlatform.TranslationMemoryApi.AbstractLocalTranslationMemory.get_InternalId()
bei Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory.get_HasAdministratorPassword()
bei Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory.get_IsProtected()
bei Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemoryFactory.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore)
bei Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderManager.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore)
bei Sdl.ProjectApi.TranslationProviderCache.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore)
bei Sdl.ProjectApi.TranslationProviderCache.GetTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore, Boolean performUpdate, Boolean refreshCache)
bei Sdl.ProjectApi.Helpers.ProjectCascadeFactory.GetTranslationProviderLanguageDirection(TranslationProviderItem translationProviderItem, LanguagePair languageDirection, Boolean performUpdate, Boolean refreshCache)</StackTraceString>
<RemoteStackTraceString xsi:null="1"/>
<RemoteStackIndex>0</RemoteStackIndex>
<ExceptionMethod id="ref-19">8
GenerateFault
Sdl.LanguagePlatform.TranslationMemoryImpl, Version=1.6.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888
Sdl.LanguagePlatform.TranslationMemoryImpl.API
System.ServiceModel.FaultException`1[Sdl.LanguagePlatform.Core.FaultDescription] GenerateFault(System.Exception)</ExceptionMethod>
<HResult>-2146232799</HResult>
<Source id="ref-20">Sdl.LanguagePlatform.TranslationMemoryImpl</Source>
<WatsonBuckets xsi:null="1"/>
<FileLoad_FileName xsi:null="1"/>
<FileLoad_FusionLog xsi:null="1"/>
</a5:FileLoadException>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</ExceptionData>
</Messages>
Process in Studio
If I use the template and create a project directly in Studio with exactly the same files it still works.
Does anyone hav an idea?