deriven

Create MSD in 10.2

Discussion created by deriven on Jun 27, 2014
Latest reply on Jul 1, 2014 by deriven
Background:
In 10.0, I'm able to create a map service in less than 2 seconds with ArcObjects.NET.  My software has clients all over the US that got very used to new map services up within 10 seconds.  They are able to receive new analysis layers quickly.

Problem:
With 10.1 and now 10.2, the ability to create a map service has been taken away from ArcObjects.NET (in a matter of speaking).  I have to use ArcPy and/or REST API.  I'd be fine with that.  But it now takes 25-35 seconds to create a map service.  8 seconds of that is the initialization of Python.  The rest comes from setting up the SD draft, then to stage SD, then to publish.

What I've noticed is that 10.2 still uses MSD files.  And the REST API can create a service with the right service description, which needs an MSD file.  So if I could create an MSD file from my MXD and make one REST call, that would be considerably faster.

But .. the MSDHelper class in ArcObjects doesn't want to work.  I can instantiate it.  But when I attempt to use the Open method, it fails every time.  Regardless of license initialization.  The error received is:

Exception from HRESULT: 0x80040353
ESRI.ArcGIS.Carto
   at ESRI.ArcGIS.Carto.MSDHelperClass.Open(String Path)
   at ArcGisLab.Program.Main(String[] args) in c:\Projects\Lab\ArcGisLab\Program.cs:line 32
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

The MXD file exists and has been published successfully with ArcPy.

Question:
Is MSDHelper deprecated?  If not, how can I use it?  Or how can I create an MSD file in ArcObjects.NET?  I do NOT want to call Python within .NET.

Outcomes