Many of us use Visual Studio Code for frontend purposes, but how about using it to develop an .NET Applications?
I always use Visual Studio or Rider to develop .NET apps, but today, I’ll create a simple TODO application using Visual Studio Code to check if I’m able to create the application in a convenient way.
As first glance, we can see the “Create .NET Project” button which allows us to create an application with a few clicks.
I’ll choose standard MVC application as easiest way to test VSC in real application.
public class TodoItem
{
public string Title { get; set; }
public string Description { get; set; }
public TodoItemStatus Status { get; set; }
}
I’ve modified HomeController and added TodoItems storage as static list
public static List<TodoItem> TodoItems = [
new() {
Title = "Write new post",
Description = "Go to the pawelmajewski.com and add a new post",
Status = TodoItemStatus.New
}
];
And the result
Ok, let’s stop at this moment. I’ll write something about using Visual Studio Code and the feeling of using it instead of a dedicated IDE created for .NET applications.
As you can see, VSC doesn’t add namespace by default.
None of these options generate correct namespace automatically. The first option ends word to full “namespace” and the second one creates new namespace scope. Too bad I couldn’t find such an option to generate correct namespace with consideration for the folder structure.
I've found solutionThere are several extensions allowing create class with namespace automatically. You can read more about it Stack overflow
Summary
Visual Studio Code is amazing software with a vast amount of extensions. We can easily develop .NET applications using Visual Studio Code. There are many extensions available that make our job faster and more convenient. However, in my opinion, the usage of dedicated IDEs is a better option. I’ll stay with Rider / Visual Studio for .NET and Visual Studio Code for frontend 🙂
Using Visual Studio Code to create .NET application
Many of us use Visual Studio Code for frontend purposes, but how about using it to develop an .NET Applications?
I always use Visual Studio or Rider to develop .NET apps, but today, I’ll create a simple TODO application using Visual Studio Code to check if I’m able to create the application in a convenient way.
As first glance, we can see the “Create .NET Project” button which allows us to create an application with a few clicks.
I’ll choose standard MVC application as easiest way to test VSC in real application.
I’ve modified HomeController and added TodoItems storage as static list
And the result
Ok, let’s stop at this moment. I’ll write something about using Visual Studio Code and the feeling of using it instead of a dedicated IDE created for .NET applications.
As you can see, VSC doesn’t add namespace by default.
None of these options generate correct namespace automatically. The first option ends word to full “namespace” and the second one creates new namespace scope. Too bad I couldn’t find such an option to generate correct namespace with consideration for the folder structure.
Summary
Visual Studio Code is amazing software with a vast amount of extensions. We can easily develop .NET applications using Visual Studio Code. There are many extensions available that make our job faster and more convenient. However, in my opinion, the usage of dedicated IDEs is a better option. I’ll stay with Rider / Visual Studio for .NET and Visual Studio Code for frontend 🙂
Archives
Understanding K-Nearest-Neighbors (KNN) – Essential Machine Learning Algorithm
2024-10-06A Step-by-Step Guide to Web Scraping for Beginners
2024-07-12Categories
Meta