title: method does not work after publication (asp.net-core)
body: <p>I have a method that does not work after publication on Windows Server 2016.</p>
  
  <p>ASP.NET CORE 2.0 - MVC</p>
  
  <p>Publish method: File system.</p>
  
  <p>So my reputation is low and i cant added image...</p>
  
  <p>I have DataBase with table:</p>
  
  <pre><code> ETP_Main (ETP_MainId , ..., ... )
   ETP_Title (ETP_TitleId, ETP_MainId, ..., ... )
   and etc.
  </code></pre>
  
  <p>Structure my project:</p>
  
  <p>Page:</p>
  
  <p>View Index (have some links)  </p>
  
  <pre><code>&lt;a asp-action="ControlPage" asp-route-
  id="ETP_MainId"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>View ControlPage </p>
  
  <pre><code> @model GiproApp.Models.Repository.ViewModel                    
  
  &lt;form asp-action="CreateWordFile" asp-route-id="@Model.Mains.ETP_MainId"&gt;
      &lt;input type="submit" class="btn btn-info" value="Dowload"&gt;
  &lt;/form&gt; 
  
  //***code***
  </code></pre>
  
  <p>i have one controller:</p>
  
  <pre><code>namespace GiproApp.Controllers
  {
     public class ETPController : Controller
     {
        private readonly DataBaseContext _context;
     }
  
     //***code*** 
  
     [HttpGet]
      public async Task&lt;IActionResult&gt; ControlPage(int id)
      {
          ETP_Main main = await _context.ETP_Mains.SingleOrDefaultAsync(m =&gt; m.ETP_MainId == id);
     //***code***
      }
  </code></pre>
  
  <hr>
  
  <p><strong>Does not work method CreateWordFile</strong></p>
  
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; CreateWordFile(int id)
  {
     ETP_Main main = await _context.ETP_Mains.SingleOrDefaultAsync(m =&gt; m.ETP_MainId == id);
  
     var webRoot = _env.WebRootPath;
     var pathEtp = Path.Combine(webRoot, "files", "Etp.docx");
     var pathDoc = Path.Combine(webRoot, "files", "Doc.docx");
  
     using (WordprocessingDocument wEtp = WordprocessingDocument.Open(pathEtp, true))
     {
         string docText = null;
  
         using (StreamReader sr = new StreamReader(wEtp.MainDocumentPart.GetStream()))
         {
             docText = sr.ReadToEnd();
             sr.Close();
         }
  
         if (title.ObjName != null) docText = Regex.Replace(docText, "AKEY0", title.ObjName);
              else docText = Regex.Replace(docText, "AKEY0", " ");
                  //***code***
  
  
         using (WordprocessingDocument wDoc = WordprocessingDocument.Open(pathDoc, true))
         {
             using (StreamWriter sw = new StreamWriter(wDoc.MainDocumentPart.GetStream(FileMode.Create)))
             {
                 sw.Write(docText);
                 sw.Close();
              }
          }
      }
      return RedirectToAction(nameof(Dowload));
      }
  </code></pre>
  
  <hr>
  
  <p>method Dowload work.</p>
  
  <pre><code>    [HttpPost]    
      public IActionResult Dowload()
      {
          var webRoot = _env.WebRootPath;
          var pathDoc = Path.Combine(webRoot, "files", "Doc.docx");
          return base.PhysicalFile(pathDoc, "application/msword", "Doc.docx");
      }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>http://192.168.0.158/ETP/CreateWordFile/30 
  HTTP 404 NOT FOUND
  </code></pre>
  
  <p>It should not refer to: CreateWordFile/30 </p>
  
  <p>It should download the file.</p>
  
  <p>my NuGet: </p>
  
  <pre><code>DocumentFormat.OpenXml
  jQuery
  Microsoft.AspNetCore.All
  Microsoft.AspNetCore.Server.IISIntegration
  Microsoft.VisualStudio.Web.CodeGeneration.Design
  </code></pre>
  
  <p>When I run the program on the local machine it all works.
  Why does not work after publication?</p>