Files are missing when publishing asp mvc core c# visual studio .net7 web application

Enes Gündoğdu 0 Reputation points
2024-11-07T07:11:27.4466667+00:00

Hello, I am developing a website on asp mvc core c# .net7 via visual studio and I have published my web page, but the files that should be in it do not come. The incoming files are as follows;

wwwroot Folder 
appsettings.development.json 
appsettings.json 
Microsoft.EntityFrameworkCore.Abstractions.dll 
Microsoft.EntityFrameworkCore.dll 
Microsoft.EntityFrameworkCore.Relational.dll 
MySqlConnector.dll 
Pomelo.EntityFrameworkCore.MySql.dll 
Portegu.dll 
Portegu.exe 
Portegu.pdb 
Portegu.runtimeconfig.json 
web.config 
X.pagedList.dll 
X.pagedList.Mvc.Core.dll 

These files are available. None of my view files are coming and when I publish my site in this way, my web page does not work. I select the following options when publishing my project to the folder;

Configuration: Release
Target Framework: net7.0
Deployment Mode: Frame dependent
Target Runtime: Portable

I have tried all other settings except these, but the files are always missing. How can I solve this problem? Did I convey my problem in detail?

Developer technologies ASP.NET ASP.NET Core
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-11-07T17:31:29.22+00:00

    the view files are compiled into the dll and not part of the publish.

    note: net 7 support ended last May, you should update to .net 8 LTS

    0 comments No comments

  2. SurferOnWww 4,631 Reputation points
    2024-11-08T01:16:36.2433333+00:00

    None of my view files are coming and when I publish my site in this way, my web page does not work.

    I guess that you mentioned the above based on your experience of .NET Framework MVC.

    In case of the .NET Framework MVC, by default, the source code of Views (i.e., .cshtml files) are deployed to the site, compiled to assemblies at the server side and the assemblies are stored in the Temporary ASP.NET Files folder in the server.

    In case of ASP.NET Core, all the files including .cshtml are complied to assemblies by Visual Studio before deployment and the assemblies are deployed to the server. Therefore, "None of my view files are coming" is right although I cannot see the reason why "my web page does not work".


  3. SurferOnWww 4,631 Reputation points
    2024-11-08T01:17:36.04+00:00

    This answer has been deleted because of duplication.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.