曦远 (DealiAxy)一份私人的文字刊物

StarBlog
返回文章列表折页手记阅读全文
StarBlog博客开发笔记

StarBlog Blog Development Notes (2): Environment Setup and Project Creation

Series articles Developing the StarBlog Blog Project Based on .NetCore - (1) Why Write Your Own Blog? Developing the StarBlog Blog Project Based on .NetCore - (2) Environment Setup and Project Creation ... Developing the StarBlog Blog Project Based on .NetCore - API Response Wrapping Developing the StarBlog Blog Project Based on .NetCore - Image Upload Feature Developing the StarBlog Blog Project Based on .NetCore - Authentication

曦远 (DealiAxy)约 14 分钟
目录5 个章节

Series Articles

  • Developing the StarBlog Blog Project Based on .NetCore - (1) Why Write Your Own Blog?
  • Developing the StarBlog Blog Project Based on .NetCore - (2) Environment Setup and Project Creation
  • ...
  • Developing the StarBlog Blog Project Based on .NetCore - API Response Wrapping
  • Developing the StarBlog Blog Project Based on .NetCore - Image Upload Feature
  • Developing the StarBlog Blog Project Based on .NetCore - Authentication Feature
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Related
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (1) Preparation
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (2) Page Routing
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (3) SASS and SCSS
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (4) FontAwesome Icons
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (5) Axios Network Request Encapsulation
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (6) Login Page
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (7) Main Page
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development (8) Vuex and State Management
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development: File Upload
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development: Waterfall Image List
  • Developing the StarBlog Blog Project Based on .NetCore - Frontend Development: Navigation Guards
  • ...

Preface

After the previous article (Developing the StarBlog Blog Project Based on .NetCore - (1) Why Write Your Own Blog? Pinned) was published on cnblogs and my WeChat official account, it received a lot of attention from many experts, and the code published on GitHub also gained dozens of stars. This has greatly encouraged me and given me more motivation to polish this project and write this series of blog posts well~

In fact, 60% of the articles in this series have already been completed, but most of them focus on frontend development (the admin side). As for the backend development part, because I wrote the code too quickly in the early stages and didn't take notes, I now want to write up the backend development part first and then publish them one by one.

This series of blog posts assumes that readers have basic knowledge of using the Asp.Net Core framework (both MVC and WebApi are involved). For an introduction to the Asp.Net Core framework, you can refer to my previous blog posts:

As well as the "AspNetCore Study Notes" and "AspNetCore Development Notes" series on the WeChat official account.

This article introduces the environment setup and project creation process before developing the StarBlog blog. Although it doesn't have much technical content, it's an article that has to be written. Readers can just skim through it and skip ahead~

Environment Setup

The backend of this project is based on the .Net6 version. If you haven't installed it yet, you can download it from Microsoft's official website at: https://dotnet.microsoft.com/zh-cn/download

As for the IDE, I usually prefer JetBrains' Rider. Of course, most .Net developers probably use VS (but I suggest you try Rider when you have time, it's really quite good~). Both of these are highly efficient for development. A second-tier choice is VS Code, which is fine for coding simple demo projects, but for larger projects it's still better to use Rider or VS.

Getting Started

Use an IDE or the command line to create an empty solution

I'm more used to using Rider

Creating a project with an IDE is easy, so I won't go into details. Here I'll cover the command-line approach.

First, create a directory

mkdir StarBlog

Create a solution

cd StarBlog
dotnet new sln

You can see that the file StarBlog.sln has been created in the StarBlog directory

Next, continue to create a few projects

# 一些额外的工具代码
dotnet new classlib -o StarBlog.Contrib
# 数据访问相关的代码、数据库模型等
dotnet new classlib -o StarBlog.Data
# 博客迁移(Markdown文件夹导入博客网站)工具代码
dotnet new console -o StarBlog.Migrate
# 博客网站主体项目
dotnet new web -o StarBlog.Web

For more usage of the dotnet new command, you can refer to the official documentation: https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-new

After creation is complete, the directory structure is as follows

StarBlog
├── StarBlog.Contrib
├── StarBlog.Data
├── StarBlog.Migrate
├── StarBlog.Web
└── StarBlog.sln

ok

OK, that's all for this article. The following articles will start writing code. Stay tuned~

Meanwhile, all the project code has been uploaded to GitHub. Feel free to Star/Fork!

_EOF_

StarBlog Blog Development Notes (2): Environment Setup and Project Creation

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…