0

I have created a project using a console application in C# with .NET Framework, and I would like to integrate ASP.NET MVC into this project.

While I understand that there is a .NET Core console application with MVC, I am building a project that is only supported by Windows and I want to build a self-hosted application. Therefore, I need to use .NET Framework together with the functions provided by ASP.NET MVC. Is this possible?

  • .NET Framework 4.8
  • Console application (generates .exe file)
  • ASP.NET MVC

If this is possible, does anyone know any links where I can follow to create this project?

6
  • 2
    Wait, I'm confused. What is "MVC" here? The general design pattern? ASP.NET MVC? What are you trying to do? Why do you need a view for a console app? Commented Mar 4, 2023 at 4:37
  • What do you want to do, run an ASP.NET MVC app from a server running on a console app? Or do you want to create a console app that uses the MVC pattern to do something (and if so, what)? Commented Mar 4, 2023 at 4:59
  • Also, .NET Core is supported on Windows too. Commented Mar 4, 2023 at 5:12
  • Why rely on a dying platform (.net framework) and not use current technology (.NET > 5)? Commented Mar 4, 2023 at 5:18
  • @EtiennedeMartel I am trying to build a self-hosted application and I read up that it requires a console application to build the .exe file. MVC stands for model view controller. Commented Mar 4, 2023 at 7:42

1 Answer 1

2

It's not possible.

ASP.NET MVC apps are hosted in IIS

Sign up to request clarification or add additional context in comments.

5 Comments

ASP.NET Core apps, however, can run as a standalone executable, using Kestrel for serving requests.
@EtiennedeMartel Yes, but Kestrel cannot be used in .net Framework console applications
@NineBerry Can I then build a ASP.NET MVC with .NET Framework and also produce a .exe file at the same time without relying on the Console Application?
ASP.net MVC only runs in IIS. But you can use ASP.net Core as a standalone application but only with .NET 5 or higher. When starting a new project, why rely on outdated .net Framework? .NET > 5 is the future.
@NineBerry I understand but I have a project that requires me to rely on using the .NET Framework :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.