title: How to fix the Server Error(parse Error) after deploying te asp.net site
body: <p>I uploaded my asp.net application through FTP from visual studio, after deploying it is throwing runtime(Parse Error).</p>
  
  <p>I have seen several posts and tried many alternatives but none of them is working: </p>
  
  <p>After uploading, the error was:</p>
  
  <pre><code>Server Error in '/' Application.
  Parser Error
  Description: An error occurred during the parsing of a resource required to 
  service this request. Please review the following specific parse error 
  details 
  and modify your source file appropriately. 
  
  Parser Error Message: Could not load type 'SimpleEchoBot.WebApiApplication'.
  
  Source Error: 
  
  
  Line 1:  &lt;%@ Application CodeBehind="Global.asax.cs" 
  Inherits="SimpleEchoBot.WebApiApplication" Language="C#" %&gt;
  
  Source File: /global.asax    Line: 1 
  </code></pre>
  
  <p>As mentioned in this post: <a href="https://stackoverflow.com/questions/23220357/parser-error-message-could-not-load-type-webmarketing">Parser Error Message: Could not load type &#39;webmarketing&#39;</a>, I changed CodeBehind to CodeFile but a new error has been raised stating that asax.cs does not exist!</p>
  
  <pre><code>Server Error in '/' Application.
  Parser Error
  Description: An error occurred during the parsing of a resource required to 
  service this request. Please review the following specific parse error 
  details and modify your source file appropriately. 
  
  Parser Error Message: The file '/Global.asax.cs' does not exist.
  
  Source Error: 
  
  
  Line 1:  &lt;%@ Application CodeFile="Global.asax.cs" 
  Inherits="SimpleEchoBot.WebApiApplication" Language="C#" %&gt;
  
  Source File: /global.asax    Line: 1 
  
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET 
  Version:4.7.3282.0
  </code></pre>
  
  <p>At the time my plesk file manager looked like this: </p>
  
  <p><img src="https://imgur.com/RVpHlnK.jpg" alt="https://imgur.com/RVpHlnK.jpg"></p>
  
  <p>And then I uploaded Global.asax.cs file and then this error showed up:</p>
  
  <p><a href="https://i.stack.imgur.com/cO3QI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cO3QI.jpg" alt="ERROR"></a></p>
  
  <p>As shown in this post: <a href="https://stackoverflow.com/questions/11596352/parser-error-server-error-in-application">Parser Error: Server Error in &#39;/&#39; Application</a> I changed Global.asax.cs namespace such that it is equal to the inherits path in asax! </p>
  
  <p>Modified namespace code in asax.cs:</p>
  
  <p><a href="https://imgur.com/59d4IJK.jpg" rel="nofollow noreferrer">https://imgur.com/59d4IJK.jpg</a></p>
  
  <p>code in asax:</p>
  
  <pre><code>&lt;%@ Application CodeBehind="Global.asax.cs" Inherits="SimpleEchoBot.WebApiApplication" Language="C#" %&gt;
  </code></pre>
  
  <p>but still, the above "This program is blocked by group policy" error is getting raised!</p>
  
  <p>And I deployed the same application to Azure, same parse error, mentioned at the top is showing up!</p>
  
  <blockquote>
    <p>Server Error in '/' Application.
    Parser Error
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. </p>
  
  <pre><code>Parser Error Message: Could not load type 'SimpleEchoBot.WebApiApplication'.
  </code></pre>
    
    <p>Source Error: </p>
    
    <p>Line 1:  &lt;%@ Application CodeBehind="Global.asax.cs" > 
       Inherits="SimpleEchoBot.WebApiApplication" Language="C#" %></p>
    
    <p>Source File: /global.asax    Line: 1 </p>
    
    <p>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0</p>
  </blockquote>
  
  <p>Edit: As requested by jessehouwing, here are the Bin folder Screenshots:</p>
  
  <p><a href="https://i.stack.imgur.com/MlaXt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MlaXt.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/Ru1de.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ru1de.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/Bvd0q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bvd0q.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/vlPL8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vlPL8.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/0fwN9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0fwN9.jpg" alt="enter image description here"></a></p>
  
  <p>As @jeesehouwing comment mentioned, I tried to precompile the website and upload, but while precompiling I received few errors:</p>
  
  <pre><code>System.AggregateException: One or more errors occurred. ---&gt; 
  System.Exception: Publish failed due to build errors. Check the error list 
  for more details.
     --- End of inner exception stack trace ---
     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean 
   includeTaskCanceledExceptions)
     at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, 
  CancellationToken cancellationToken)
     at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish. 
  &lt;&gt;c__DisplayClass40_0.&lt;PublishAsync&gt;b__2()
     at System.Threading.Tasks.Task`1.InnerInvoke()
      at System.Threading.Tasks.Task.Execute()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task 
  task) atSystem.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)atMicrosoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.&lt;RunPublishTaskAsync&gt;d__88.MoveNext()
   ---&gt; (Inner Exception #0) System.Exception: Publish failed due to build errors. 
   Check the error list for more details.&lt;---
  </code></pre>