Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have an MXD that I would like to publish to an ArcGIS server using C# ArcObjects (preferably as an MSD). I have been unable to find anything regarding this. Essentially I would like to implement the following ArcPy code in ArcObjects:

arcpy.mapping.ConvertToMSD()
arcpy.mapping.PublishMSDToServer()

Any help would be appreciated! Thanks!

share|improve this question
    
Where do you set that? I cannot find it. –  user2974 May 14 '11 at 8:57

2 Answers 2

Unfortunately, there's no ArcObjects way to do this. You're going to need to do a mixed C#/Python solution to get what you're aiming for.

share|improve this answer
    
Thanks for your answer. I seem to have picked the combo all right. No time aware in ArcPy and no publishing in ArcObjects! –  Eddie Jesinsky Feb 10 '11 at 20:37

I was going to suggest using the esriCartoXUI.MapOptimizationAppExtension to convert to an msd, but I don't see any documentation for it. If you figure that part out, I think you can publish the msd by using the AgsServerConnection to get a reference to IServerObjectAdmin3. Then use the methods on it to create a new "configuration".

share|improve this answer
1  
Thanks, looking at that it looks like it will be bit of an ordeal to figure out. For now I think I'm going to call a mini arcpy script directly from .NET like so –  Eddie Jesinsky Feb 10 '11 at 15:41
    
Yeah that looks much simpler, please post your code when you are done (there's nothing wrong with answering your own question). –  Kirk Kuykendall Feb 10 '11 at 16:29
    
I was able to publish the .NET executable to a toolbox and call the python code directly as shown above. However, my current problem is that I suspect that arcpy.mapping.PublishMSDToServer() contains a bug or some undocumented requirement, as when publishing manually, my MSD works correctly, but publishing through that procedure causes incorrect paths to be created and the published MSD does not work. I'm hoping it is some sort of environment setting rather than a bug, so I'm hoping to get some sort of confirmation from ESRI. –  Eddie Jesinsky Feb 14 '11 at 13:47
    
I was able to get it working by forcing absolute path names in the mxd when using a geodatabase, or by using the sde as the source instead. –  Eddie Jesinsky Feb 14 '11 at 17:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.