<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Geoprocessing in a service cause exception. in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-geoprocessing-in-a-service-cause-exception/m-p/324#M10</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to initialize Server license, instead of Engine or Desktop, in your code since it is a web application (&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#aoinitialize.htm" title="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#aoinitialize.htm"&gt;http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#aoinitialize.htm&lt;/A&gt;&amp;nbsp;). Engine and Desktop license are one user per license mode.&lt;/P&gt;&lt;P&gt;Just FYI, it's not really recommended to use ArcObjects SDK in ASP.NET web applications. Server Object Extension would be a better option to use ArcObjects in web environment (&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#652a31ce-4f02-43b5-bba9-9db26ce231af.htm" title="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#652a31ce-4f02-43b5-bba9-9db26ce231af.htm"&gt;http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#652a31ce-4f02-43b5-bba9-9db26ce231af.htm&lt;/A&gt;&amp;nbsp;).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jul 2017 16:20:14 GMT</pubDate>
    <dc:creator>YuanLiu</dc:creator>
    <dc:date>2017-07-25T16:20:14Z</dc:date>
    <item>
      <title>Using Geoprocessing in a service cause exception.</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-geoprocessing-in-a-service-cause-exception/m-p/323#M9</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I 've created a Toolbox tool in ArcMap. It's a very simple tool designed to clip raster data. It works fun in ArcMap. And I used it in a console application. Here is the code:&lt;BR /&gt; &lt;BR /&gt;ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);&lt;BR /&gt;Geoprocessor gp = new Geoprocessor();&lt;BR /&gt;gp.AddToolbox(@"D:\Documents\ArcGIS\clipEnvelope\clipService.tbx");&lt;BR /&gt;gp.OverwriteOutput = true;&lt;BR /&gt;string rectangle = "94736.18 17841.65 97550.74 20512.60"; &lt;BR /&gt;IVariantArray parameters = new VarArrayClass();&lt;BR /&gt;parameters.Add(rectangle);&lt;BR /&gt;gp.Execute("clipRaster", parameters, null);&lt;BR /&gt; &lt;BR /&gt;The tool receive a envelope as parameter and "rectangle" in the code represent a envelope. The code works fun in console application. I used the same code in a ASP.NET Web application. And I received a COMException at the row "gp.Execute("clipRaster", parameters, null);". &lt;BR /&gt;Here is the detail of the exception:&lt;BR /&gt; &lt;BR /&gt;用户代码未处理 System.Runtime.InteropServices.COMException&lt;BR /&gt;HResult=-2147417851&lt;BR /&gt;Message=The server threw an exception。 (Exception from HRESULT:0x80010105 (RPC_E_SERVERFAULT))&lt;BR /&gt;Source=ESRI.ArcGIS.Geoprocessing&lt;BR /&gt;ErrorCode=-2147417851&lt;BR /&gt;StackTrace:&lt;BR /&gt;在 ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute(String Name, IVariantArray ipValues, ITrackCancel pTrackCancel)&lt;BR /&gt;在 ESRI.ArcGIS.Geoprocessor.Geoprocessor.Execute(String name, IVariantArray parameters, ITrackCancel trackCancel)&lt;BR /&gt;在 TINServiceTest.TINService.HelloWorld() 位置 d:\VS workspace\TINServiceTest\TINServiceTest\TINService.asmx.cs:行号 41&lt;BR /&gt;InnerException:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am developing a&amp;nbsp;ASP.NET Web application. So how can I solve the problem? I would be very grateful for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2017 04:00:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-geoprocessing-in-a-service-cause-exception/m-p/323#M9</guid>
      <dc:creator>ChangGuo</dc:creator>
      <dc:date>2017-07-24T04:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Geoprocessing in a service cause exception.</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-geoprocessing-in-a-service-cause-exception/m-p/324#M10</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to initialize Server license, instead of Engine or Desktop, in your code since it is a web application (&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#aoinitialize.htm" title="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#aoinitialize.htm"&gt;http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#aoinitialize.htm&lt;/A&gt;&amp;nbsp;). Engine and Desktop license are one user per license mode.&lt;/P&gt;&lt;P&gt;Just FYI, it's not really recommended to use ArcObjects SDK in ASP.NET web applications. Server Object Extension would be a better option to use ArcObjects in web environment (&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#652a31ce-4f02-43b5-bba9-9db26ce231af.htm" title="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#652a31ce-4f02-43b5-bba9-9db26ce231af.htm"&gt;http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#652a31ce-4f02-43b5-bba9-9db26ce231af.htm&lt;/A&gt;&amp;nbsp;).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2017 16:20:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-geoprocessing-in-a-service-cause-exception/m-p/324#M10</guid>
      <dc:creator>YuanLiu</dc:creator>
      <dc:date>2017-07-25T16:20:14Z</dc:date>
    </item>
  </channel>
</rss>

