I'm trying to add a component link to the Component link field of a page metadata using event system. I'm not sure why but its throwing an error asking for -16 at the end of the link which is a component.
A ComponentLinkField.value is a Component so I just set that to the Component Object I have.
When I go to save the page.Metadata it throws the following error where tcm:7-12361 is the component ID.
Invalid context Publication specified in URI: tcm:7-12361. Expecting: 16.
ComponentLinkField newCompLink = (ComponentLinkField)metadata[GetConfigKey("PageMetadataFieldName")];
newCompLink.Value = newLocalizedComp;
page.Metadata = metadata.ToXml();