Error creating new Project after Studio 2022 SR1 (source and target languages empty)

Hello Developers, i hope you're all fine.

I have a console application used to create projects on demand.

When I create the project, my project has no source or target languages defined.

I use the code found in examples and I updated it to reflects recents SR1 changes in API (here  and here).

This is the code I use to build Project info:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
public ProjectInfo ImpostaProgetto()
{
ProjectInfo info = new ProjectInfo();
info.Name = this.myParams.nomeProgetto;
info.LocalProjectFolder = this.myParams.projectFolder;
info.SourceLanguage = LanguageRegistryApi.Instance.GetLanguage("it-IT");
Language[] targLangs = new Language[] { (LanguageRegistryApi.Instance.GetLanguage("en-US")) };
info.TargetLanguages = targLangs;
return info
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

and this is the code that creates the project

Fullscreen
1
2
3
ProjectInfo infoProj = ImpostaProgetto();
FileBasedProject newProject = new FileBasedProject(infoProj);
newProject.Save();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

So far nothing complicated, but:

- "newProject" object has source and target languages empty (while the Projecting object has them correctly set)

- the project folder and .sdlproj file get created correctly, but with no language attributes inside the xml (.sdlproj) file and no language folders.

I added reference to Sdl.Core.Globalization.Async along with Sdl.Core.Globalization.

 

Can anyone tell me what am I doing wrong?

Using Trados Studio 2022 SR1 - 17.1.6.16252

Thanks

emoji