andreygolubkow - 2020-05-30

Hi!
When I saving the CoDeSys project with C#, I get the exception:

ArgumentNullException
Parameter: buffer

The stack trace:

   Π² _3S.CoDeSys.Utilities.WeakMulticastDelegate.Invoke(Object[] args)
   Π² _3S.CoDeSys.ObjectManager.ObjectManager.OnProjectSaving(ProjectSavingEventArgs e)
   Π² _3S.CoDeSys.ObjectManager.ObjectManager.SaveProject(Int32 nProjectHandle, Stream stream, String stStreamName)
   Π² ..(Stream )
   Π² ..( )
   Π² ..()
   Π² _3S.CoDeSys.FileCommands.FileCommandHelper.RawProjectSave(IProject project, Profile profile, String stProfileName, Boolean bCheckDifferentProfile, Boolean checkSufficientLibraryInfo)
   Π² _3S.CoDeSys.FileCommands.FileCommandHelper.SaveProjectAs(String stPath, Profile profile, String stProfileName)

Code:

//Opening 
var fileOpenCommand = ComponentManager.Singleton.CreateInstance<ICommand>(new Guid("9D09E965-6254-46fd-9C21-B27FD2E97B52"));
fileOpenCommand.ExecuteBatch(new []{@"D:\Temp\Codesys\MyProject.project"});
//Do something
//Saving
var fileSaveAsCommand = cm.CreateInstance<ICommand>(new Guid("6D0D9CC5-67A2-46fd-9D29-FDFA326321E5"));
fileSaveAsCommand.ExecuteBatch(new string[1]{@"D:\TestSaveAs.project"}); // Exception here
 

Related

Talk.ru: 1