<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Masaki Yamamoto</title>
    <description>The latest articles on DEV Community by Masaki Yamamoto (@nnasaki).</description>
    <link>https://dev.to/nnasaki</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F700055%2F1322e5bc-517a-4e72-a58f-37f8f8e4a6e7.png</url>
      <title>DEV Community: Masaki Yamamoto</title>
      <link>https://dev.to/nnasaki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nnasaki"/>
    <language>en</language>
    <item>
      <title>How to add a minimally configured Web API to Sitecore XM/XP 10.2</title>
      <dc:creator>Masaki Yamamoto</dc:creator>
      <pubDate>Fri, 19 Aug 2022 07:46:04 +0000</pubDate>
      <link>https://dev.to/nnasaki/how-to-add-a-minimally-configured-web-api-to-sitecore-xmxp-102-256</link>
      <guid>https://dev.to/nnasaki/how-to-add-a-minimally-configured-web-api-to-sitecore-xmxp-102-256</guid>
      <description>&lt;p&gt;There are many situations where you may want to use data stored in Sitecore XM or XP on an external site, and this step-by-step guide explains how to add a customized Web API on Sitecore XM/XP 10.2.&lt;/p&gt;

&lt;h1&gt;
  
  
  System Requirements
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Visual Studio 2019 or higher (The author's environment is Visual Studio 2022)&lt;/li&gt;
&lt;li&gt;NET Framework 4.8&lt;/li&gt;
&lt;li&gt;Windows 10&lt;/li&gt;
&lt;li&gt;Sitecore XM/XP 10.2&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Target audience
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Sitecore Developers&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Preparation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Add Sitecore to NuGet package sources
&lt;/h2&gt;

&lt;p&gt;Open Visual Studio configuration.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Quf1tFIt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/f053b0886d44-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Quf1tFIt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/f053b0886d44-20220819.png" alt="" width="679" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;select Package Sources&lt;/li&gt;
&lt;li&gt;click on +&lt;/li&gt;
&lt;li&gt;Select the added Package srouces&lt;/li&gt;
&lt;li&gt;Enter &lt;code&gt;Sitecore&lt;/code&gt; for Name and &lt;code&gt;https://sitecore.myget.org/F/sc-packages/api/v3/index.json&lt;/code&gt; for Source&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Update&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;OK&lt;/code&gt;.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--beI2qAH5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/2f1796e22c88-20220819.png" alt="" width="861" height="470"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's all.&lt;/p&gt;
&lt;h1&gt;
  
  
  Complete Repository
&lt;/h1&gt;

&lt;p&gt;Here is the completed source so you can build and try it out right away.&lt;br&gt;
&lt;a href="https://github.com/nnasaki/SimpleWebApi"&gt;https://github.com/nnasaki/SimpleWebApi&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Steps to create a new solution
&lt;/h1&gt;
&lt;h2&gt;
  
  
  Create new solution
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JpqPRB5Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/eb9102f2e587-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JpqPRB5Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/eb9102f2e587-20220819.png" alt="" width="880" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;code&gt;ASP.NET Web Application(.NET Framework)&lt;/code&gt;, note that it is not ASP.NET Core.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--daCo1FYc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/6f377d2cef4f-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--daCo1FYc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/6f377d2cef4f-20220819.png" alt="" width="880" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the Project name. Make sure again that the Framework is &lt;code&gt;.NET Framework 4.8&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BrTWOZ1U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/b425d17ef0d0-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BrTWOZ1U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/b425d17ef0d0-20220819.png" alt="" width="880" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;code&gt;Empty&lt;/code&gt; as the Project Type. Uncheck all the checkboxes on the right side.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--36RGIaF_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/fd819f250d8b-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--36RGIaF_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/fd819f250d8b-20220819.png" alt="" width="880" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press &lt;code&gt;Create&lt;/code&gt; to finish creating a new solution and project.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6THGvhYh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/27ed455e02af-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6THGvhYh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/27ed455e02af-20220819.png" alt="" width="880" height="476"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Add a NuGet package
&lt;/h2&gt;

&lt;p&gt;From Visual Studio &lt;code&gt;Tools&lt;/code&gt;, click &lt;code&gt;Package Manager Console&lt;/code&gt; under &lt;code&gt;Nuget Package Manager&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KDDRTcJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/24e194e1d86b-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KDDRTcJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/24e194e1d86b-20220819.png" alt="" width="830" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the &lt;code&gt;Package Manager Console&lt;/code&gt; appears at the bottom of the screen, type &lt;code&gt;Install-Package Sitecore.Services.Infrastructure&lt;/code&gt; !&lt;br&gt;
&lt;a href="https://storage.googleapis.com/zenn-user-upload/23547733c82a-20220819.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you see &lt;code&gt;Successfully installed&lt;/code&gt; like this, it is successful. It took about 2 minutes in my environment.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M3SfEcwM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/503e90ab549e-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M3SfEcwM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/503e90ab549e-20220819.png" alt="" width="796" height="380"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Add controllers
&lt;/h2&gt;

&lt;p&gt;Add a folder of &lt;code&gt;Controllers&lt;/code&gt; and add a class&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qN14v8Nj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/34e9f562318a-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qN14v8Nj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/34e9f562318a-20220819.png" alt="" width="880" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter &lt;code&gt;SimpleWebApiController&lt;/code&gt; and click Add &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ufr3c67---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/d27ecfbc9807-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ufr3c67---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/d27ecfbc9807-20220819.png" alt="" width="880" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the following code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Sitecore.Services.Infrastructure.Web.Http&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Web.Http&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Web.Http.Cors&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;SimpleWebApi.Controllers&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// TODO Be sure to narrow down the CORS settings in the production environment. This is all allowed.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;EnableCors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;origins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SimpleWebApiController&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ServicesApiController&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;SimpleWebApiController&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;HttpGet&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;Stats&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ok SimpleWebApi"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add route definition
&lt;/h2&gt;

&lt;p&gt;Same procedure as for the controller. Add the &lt;code&gt;Pipelines&lt;/code&gt; folder and add the &lt;code&gt;RegisterHttpRoutes&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;Enter the following code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Web.Http&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Sitecore.Pipelines&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;SimpleWebApi.Pipelines&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RegisterHttpRoutes&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PipelineArgs&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;GlobalConfiguration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Configure&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;HttpConfiguration&lt;/span&gt; &lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;routes&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Routes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapHttpRoute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SimpleWebApi.stats"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"api/simplewebapi/stats"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;controller&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"SimpleWebApi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Stats"&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add config.
&lt;/h2&gt;

&lt;p&gt;Create a hierarchical folder &lt;code&gt;App_Config\Include\ZZZZZ_CustomConfigs&lt;/code&gt; and add &lt;code&gt;SimpleWebApi.config&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1nfZEyBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/956dbe8fbbc7-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1nfZEyBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/956dbe8fbbc7-20220819.png" alt="" width="284" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the following settings&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
               xmlns:set="http://www.sitecore.net/xmlconfig/set/"
               xmlns:role="http://www.sitecore.net/xmlconfig/role/"&amp;gt;
  &amp;lt;sitecore&amp;gt;
    &amp;lt;pipelines&amp;gt;
      &amp;lt;initialize&amp;gt;
        &amp;lt;processor
           type="SimpleWebApi.Pipelines.RegisterHttpRoutes, SimpleWebApi" /&amp;gt;
      &amp;lt;/initialize&amp;gt; 
    &amp;lt;/pipelines&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deploy
&lt;/h2&gt;

&lt;p&gt;Deploy the built module&lt;/p&gt;

&lt;h3&gt;
  
  
  Add dll to bin
&lt;/h3&gt;

&lt;p&gt;Copy the &lt;code&gt;SimpleWebApi.dll&lt;/code&gt; created in the project &lt;code&gt;bin&lt;/code&gt; to &lt;code&gt;C:\inetpub\wwwroot\sitecoresc.dev.local\bin&lt;/code&gt; in IIS. Rewrite the &lt;code&gt;sitecoresc.dev.local&lt;/code&gt; part in your environment.&lt;br&gt;
! &lt;a href="https://storage.googleapis.com/zenn-user-upload/ca257d9e4861-20220819.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add configurations to include
&lt;/h3&gt;

&lt;p&gt;Copy &lt;code&gt;SimpleWebApi.config&lt;/code&gt; added to the project to &lt;code&gt;C:\inetpub\wwwroot\sitecoresc.dev.local\App_Config\Include\ZZZZZ_CustomConfigs&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uDwrjaSg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/22cb2b397f05-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uDwrjaSg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/22cb2b397f05-20220819.png" alt="" width="880" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Check the operation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Access the API
&lt;/h2&gt;

&lt;p&gt;Access the site where Sitecore is deployed using a browser.&lt;br&gt;
In this example, access &lt;code&gt;https://sitecoresc.dev.local/api/simplewebapi/stats&lt;/code&gt; and check it.&lt;/p&gt;

&lt;p&gt;If the deployment is successful, you will see a simple &lt;code&gt;"ok SimpleWebApi"&lt;/code&gt; as shown below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LvQ68PAT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/bf2be6dbcf00-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LvQ68PAT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/bf2be6dbcf00-20220819.png" alt="" width="496" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you encounter errors, please see Troubleshooting.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;As shown in this article, Sitecore can be easily customized, so please try it out.&lt;/p&gt;

&lt;h1&gt;
  
  
  Troubleshooting
&lt;/h1&gt;

&lt;p&gt;Here is a summary of the errors I encountered while trying it out and how I handled them.&lt;/p&gt;

&lt;h2&gt;
  
  
  No type was found that matches the controller named 'MinimumTest4'
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Error details.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"Message": "No HTTP resource was found that matches the request URI 'https://sitecoresc.dev.local/api/minimumtest4/stats'." , "MessageDetail": "No type was found that matches the controller named 'MinimumTest4'"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--59UiogGY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/95fde7408b22-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--59UiogGY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/95fde7408b22-20220819.png" alt="" width="880" height="41"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution.
&lt;/h3&gt;

&lt;p&gt;There are two patterns.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Controller name is incorrectly set in MapHttpRoute.
&lt;/h4&gt;

&lt;p&gt;Please check if the controller name is correct. If &lt;code&gt;MinimumTest4Controller&lt;/code&gt; is the controller name, specify up to &lt;code&gt;MinimumTest4&lt;/code&gt; without &lt;code&gt;Controller&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q6UQFgWZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/2da6703ce68a-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q6UQFgWZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/2da6703ce68a-20220819.png" alt="" width="724" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. optimizeCompilations="true" is enabled in Web.config
&lt;/h4&gt;

&lt;p&gt;In Web.config, set &lt;code&gt;&amp;lt;compilation defaultLanguage="c#" debug="true" targetFramework="4.8" optimizeCompilations="true"&amp;gt;&lt;/code&gt; like this If &lt;code&gt;optimizeCompilations&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;, set &lt;code&gt;optimizeCompilations="false"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;optimizeCompilations&lt;/code&gt; is a feature that can speed up reloading when updating modules, but new pipeline processors may not be recognized. It is usually better to set it to &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A route named 'MinimumTestApi.stats' is already in the route collection. Route names must be unique.
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Error details.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Server Error in '/' Application.
A route named 'MinimumTestApi.stats' is already in the route collection.
Parameter name: name
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: A route named 'MinimumTestApi.stats' is already in the route collection.
Parameter name: name

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hLfmrfKH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/7d1bdc143317-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hLfmrfKH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/7d1bdc143317-20220819.png" alt="" width="880" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;The definition name of &lt;code&gt;MapHttpRoute&lt;/code&gt; is shared by another module. Change the definition name of &lt;code&gt;MapHttpRoute&lt;/code&gt; in &lt;code&gt;RegisterHttpRoutes.cs&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WHKo3Ng---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/54fd16b449d9-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WHKo3Ng---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/54fd16b449d9-20220819.png" alt="" width="696" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  "Multiple types were found that match the controller named 'MinimumTestApi'
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Error Details.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"Message": "An error has occurred.", "ExceptionMessage": "Multiple types were found that match the controller named 'MinimumTestApi'. This can happen if the route that services this request ('api/minimumtest3/stats') found multiple controllers defined with the same name but differing namespaces, which is not supported. \r\n\r\nThe request for 'MinimumTestApi' has found the following matching Controllers:\r\nMinimumTest.Controllers.MinimumTestApiController\r\nMinimumTest.Controllers.MinimumTestApiController", "ExceptionType": "System.InvalidOperationException", "StackTrace":""   at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(HttpRequestMessage request)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.&amp;lt;SendAsync&amp;gt;d__15.MoveNext()"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GJJTI6xy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/830414c2e16f-20220819.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GJJTI6xy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/830414c2e16f-20220819.png" alt="" width="880" height="50"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution.
&lt;/h3&gt;

&lt;p&gt;Name resolution is not working because there is a duplicate controller class name with another module. Change the controller class name to something else.&lt;/p&gt;

</description>
      <category>sitecore</category>
      <category>aspnet</category>
    </item>
  </channel>
</rss>
