this is my code:
LinkDataSource contentsSource = layer.getContentsSource();
contentsSource.setFileType(fileType);
layer.setContents(ImageBytes);
layer.updateModifiedContent();
psd file SmartObjectLayer exists Pupp…...using (PsdImage psd = (PsdImage)Image.Load("path/to/your/file.psd"))...opening of Psd Image. Also, code of loading image for the replacement...