skip to Main Content

I have been trying to create a web project in Visual Studio 2022 but can not as application type web is missing.

I do have ASP.NET and web development feature installed but I do not get Web application as n option in project properties.

Feature
VSFeature

Project Type I create

I create a project

Application Properties

Application Properties

Update 2021-12-04
I apologize for my lack of knowledge about how VS works as I recently started using it.

Actually what i am looking for is to be able to build and publish a basic website on a Linux server with Apache.

When I try to do this in a old project I got from my colleague which is build with .NET Framework 4.5 after publishing the project in a folder I get all folders and .cshtml files which I can upload to my server how ever when I create a new project from scratch using ASP.NET Core Web App template and publish I do not get same results.

Screenshot of the published project:

Screenshot of the published folder

After comparing both projects when I check project properties on old .NET Framework project I see the type is web but the new project which is created with .NET Core is console and I can not change it to web that is why I was wondering if it had to do with this.

It is only the .NET Core template which produces "wrong files" for me even PHP Tools template creates correct project type and produces correct files which i can upload on a linux server.

2

Answers


  1. I think windows application is the web creation that you are talking about in the third photo explaining about your application properties

    Login or Signup to reply.
    1. Install the correct framework

      .NET / .NET Core is different from .NET framework, here is a link that explains the difference between both platforms. Here is another link if you need more information about the two terms. Since you’re using Apache + Linux, you should be building a dotnet web application or a dotnet core web application. From your screenshot, the project that was created is a .NET Framework Application.
      You can use bash or the command line to install it. Follow the instructions here. Then run dotnet --version to check the version to see that it installed correctly.

    2. Host it properly

      Depending on the platform you will use to host the app, you need to set up the environment properly. For Apache Linux, here is a full tutorial on how to publish and host your app. You will need a domain name too for this

    3. Razor Pages are compiled

      Razor Pages are compiled by default. You can read more about Razor Compilation here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search