0

I have successfully completed my first project in an ASP.NET Core application using Connector/NET Core to explore the possibility to run this application on any .NET Core

This is the tutorial

This project work correctly on http://localhost:62954/Tablename

Now I need publish the project on the windows server 2008 for sharing on the web this work

On the server I have installed dotnet-sdk-3.1.300-win-x64.exe

I have copied the folder and file from project local to remote server c:\inetpub\wwwroot\aspnetcore\mvccore

but if get on the browser the link http://mywebsite/aspnetcore/mvccore/views/tablename/Index.cshtml the return is page not found

isn't copying the local file and folders on the server enough for the project to work?

I am server administrator... maybe do I have to configure IIS?

can the new configuration create problems to the existing one on IIS?

how to do resolve this?

can you help me, please?

Chevy Mark Sunderland
  • 401
  • 2
  • 10
  • 21
  • According to this guide [Host ASP.NET Core on Windows with IIS](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1) only Windows Server 2012 and later is supported for hosting .net core applications on IIS – Pavel Anikhouski Jun 01 '20 at 16:37
  • @PavelAnikhouski hi, thanks for help. this is not good news... if there is no other possibility I ask my hosting service to upgrade from server 2008 to 2012. I developed the project on windows 10 without problem, and I didn't know that it only works on 2012 server... ;( – Chevy Mark Sunderland Jun 01 '20 at 17:03
  • Windows Server 2008 and Windows Server 2008 R2 are no longer supported by Microsoft. I'd highly recommend moving to a more recent server OS. https://www.microsoft.com/en-us/cloud-platform/windows-server-2008 – TeaBaerd Jun 01 '20 at 20:17
  • thanks but the migration to a more recent server OS my hosting provider has to do and it's not available to this – Chevy Mark Sunderland Jun 01 '20 at 20:55
  • http://mywebsite/aspnetcore/mvccore/views/tablename/Index.cshtml , is it correc url. i hope this is correct one:http://mywebsite/tablename/Index.cshtml – Always_a_learner Jun 02 '20 at 07:28
  • @Always_a_learner This type of page is not available. Description: The requested page type is not available because the administrator did not specify a manager or because access to this page type was explicitly prohibited. The extension '.cshtml' may be incorrect. Check the URL below and make sure it is spelled correctly. – Chevy Mark Sunderland Jun 02 '20 at 07:39

2 Answers2

0

You need IIS for that. But, since you have a .NET Core App, why wouldn't you use Docker to avoid environment problems? It's very easy to configure with Visual Studio 2019.

Iuri Brindeiro
  • 143
  • 1
  • 8
  • Docker? I do not know Docker, please explain. thanks – Chevy Mark Sunderland Jun 01 '20 at 18:27
  • It's not that hard to get started. You don't have to be afraid :) With docker you could avoid environment problems, since you would work with the same environment in your local machine as the application runs in production. Please, take a look: https://learn.microsoft.com/pt-br/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-3.1 – Iuri Brindeiro Jun 01 '20 at 18:35
  • But work on Windows Server 2008 R2 ? @PavelAnikhouski say windows server 2012 or later – Chevy Mark Sunderland Jun 01 '20 at 18:40
  • Actually no haha. If you really need to use it on that version of Windows, you have to use .Net Core 2.2 or lower (like says here: https://learn.microsoft.com/pt-br/dotnet/core/install/dependencies?tabs=netcore22&pivots=os-windows). After that, you can install dotnet core cli and run as a Windows service or use IIS to host it. I would prefer to use IIS. – Iuri Brindeiro Jun 01 '20 at 18:44
  • Ok. I have setting my project for run on dotnet-sdk-2.2.207-win-x64.exe for Windows Server 2008 R2 SP2, And now? How to do for run on IIS 7? i have to install dotnet-sdk-2.2.207-win-x64.exe on the server or it is enough dotnet-sdk-3.1.300-win-x64.exe? Any suggestion, please? I don't understand because not error when installing dotnet-sdk-3.1.300-win-x64.exe on Windows Server 2008 R2 SP2.... – Chevy Mark Sunderland Jun 01 '20 at 19:05
  • It might actually work, I can't prove you it doesn't work with 3.1. That's just what the doc says. You should follow this tutorial to deploy with IIS: https://learn.microsoft.com/en-US/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2 – Iuri Brindeiro Jun 01 '20 at 22:36
  • Just to know, that machine you have Windows Server 2008 R2 SP2, you have it locally or are u using some sort of cloud? – Iuri Brindeiro Jun 01 '20 at 22:38
  • using locally machine with Windows Server 2008 R2 SP2 – Chevy Mark Sunderland Jun 02 '20 at 06:46