I am new to replication development and I am trying to use RMO to control some replication info, so maybe this is a stupid question.
I am using RMO to manage some publications with C#. I have the following code that works for transactional publication.
ServerConnection connection = new ServerConnection("MyServer");
connection.Connect();
TransPublication publication = new TransPublication();
publication.ConnectionContext = connection;
publication.Name = "Snapshot Test";
publication.DatabaseName = "DBTEST";
publication.Description = "This is a test description";
publication.Type = PublicationType.Snapshot;
publication.FtpLogin = "anonymous";
publication.SnapshotMethod = InitialSyncType.ConcurrentNative;
publication.Attributes |= PublicationAttributes.AllowPull;
publication.Attributes |= PublicationAttributes.AllowPush;
publication.Create();
connection.Disconnect();
When I try to run this and set the publication as snapshot, I got this error:
A concurrent snapshot is not allowed for snapshot publications.
Changed database context to 'DBTEST'.
I am confused because even though it shows that error, I can see my publication in DB.
Do I need to set any other property? If this is not the proper way to set a snapshot publication, can someone guide me the right way?
Thank y'all