0

I'm trying to publish my ASP.NET Core 5 MVC application from Visual Studio to IIS Web Server (on VPS). But all my Areas folders, Cshtml files, view components etc, have not been published - only the wwwroot folder and its contents have been uploaded to the server. I saw about project.json, but .NET 5 doesn't use it anymore.

PS: when I try publishing clicking directly from the "Area" folder selected, the files are published, but the .Cs files are published too.

How can I fix it?

On publishing to Microsoft Azure, everything goes fine. But to my VPS it is not working as I would like to.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Guto Barroso
  • 131
  • 1
  • 12
  • If my reply is helpful, please accept it as answer(click on the mark option beside the reply to toggle it from greyed out to fill in.), see https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Jason Pan Aug 30 '21 at 04:04

1 Answers1

1

The easiest way is open scm site, check the publish file under D:/home/site/wwwroot. And compare the structure of deployed file between azure and IIS. It should be same.

After the comparison, see if the folders or files are not included. Just modify it in the .csproj file.

Related posts:

1. Unable to find files located in my root project folder when hosted on Azure

2. dotnet core publish: include/exclude dir in output

Jason Pan
  • 15,263
  • 1
  • 14
  • 29