title: VS2017/Angular 7 upgrade deployment error (Development Mode)
body: <p>I did some development in AngularJs a couple years back and really liked it so I  decided to start trying to migrate to a newer version.  It didn't make sense to me to move to Angular 6 given that Angular 7 is out, but the Visual Studio template is still currently using V6.</p>
  
  <p>I have been following this article (<a href="https://www.talkingdotnet.com/create-an-angular-7-app-with-visual-studio-2017/" rel="nofollow noreferrer">https://www.talkingdotnet.com/create-an-angular-7-app-with-visual-studio-2017/</a>) to upgrade the default VS template to V7, but I run into issues when I deploy the application to my web hosting provider.   If I create a new Angular V6 application with the template, it will deploy and run fine.   I can upgrade the V6 template application to V7 using the article I mentioned above and it will run fine in VS locally, but throws the following error when deployed:</p>
  
  <p><strong>ERROR:</strong><br>
  The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.<a href="https://i.stack.imgur.com/iAx7c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iAx7c.png" alt="enter image description here"></a></p>
  
  <p><strong>What I have tried:</strong></p>
  
  <p><strong>1)</strong>  I tried changing the ASPNETCORE_ENVIRONMENT variable that is on the Debug tab in the project's properties dialog (From 'Development' to 'Production').   I get the same error.<a href="https://i.stack.imgur.com/9cseo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9cseo.png" alt="enter image description here"></a></p>
  
  <p><strong>2)</strong> I tried changing the environment.ts file's production property to true so that both, environment.ts and environment.prod.ts were both true so to rule out it using the wrong version.   This also results in the same error.<br>
  <a href="https://i.stack.imgur.com/ZR8ue.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZR8ue.png" alt="enter image description here"></a></p>
  
  <p><strong>3)</strong>  I tried using a WinDiff to show all the file differences between the 'ClientApp' folders, comparing V6 and V7.  As this is the only thing I changed from when it works and when it doesn't.  The only differences that look questionable to me are:  main.ts, angular.json, and app.module.ts.   I have included pics of each of those differences (Red is V6, yellow is V7).   I have no idea what else to try at this point, but I did notice that the pathing structure from V6 to V7 isn't the same and is showing in the angular.json image listed.  I'm not sure if this could be the issue or not, but again, the app runs fine on V7 locally in VS so I question that being the cause, but not sure really.</p>
  
  <ul>
  <li><p>main.ts</p>
  
  <p><a href="https://i.stack.imgur.com/fSRtj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fSRtj.png" alt="enter image description here"></a></p></li>
  <li><p>angular.json</p>
  
  <p><a href="https://i.stack.imgur.com/vKqQY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vKqQY.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/CB1as.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CB1as.png" alt="enter image description here"></a></p></li>
  <li><p>app.module.ts</p>
  
  <p><a href="https://i.stack.imgur.com/pN81I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pN81I.png" alt="enter image description here"></a></p></li>
  </ul>
  
  <p>Any help would be greatly appreciated.</p>