You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Title>ASP.Net Core RESTful Service Template</Title>
8
+
<Authors>Sergey Tregub</Authors>
9
+
<Description>Project template to create production-ready RESTful service based on ASP.Net Core v3.1 or 5.0. It contains preconfigured DI-container, logging, CORS, some boilerplate code and other features</Description>
Copy file name to clipboardExpand all lines: ProjectTemplates/How to create a new template.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,11 @@
2
2
3
3
After making any changes do:
4
4
5
+
**Create a VSIX project template:**
5
6
1. Select Release configuration for a solution
6
7
1. Select ReferenceProject in "Solution Explorer" and click "Project/Export Template..." menu item from the VS main menu
7
8
1. In the appeared dialog box select "Project template" option and "ReferenceProject" in the combobox below and click Next
8
-
1. Set the value `ASP.Net Core RESTful Service` as a template name and the `Project template to create production-ready RESTful service based on ASP.Net Core v3.1. It contains preconfigured DI-container, logging, CORS, some boilerplate code and other features` as a description
9
+
1. Set the value `ASP.Net Core RESTful Service` as a template name and the `Project template to create production-ready RESTful service based on ASP.Net Core v3.1 or 5.0. It contains preconfigured DI-container, logging, CORS, some boilerplate code and other features` as a description
9
10
1. Don't foget to replace .Net Core version in the description above to the appropriate one.
10
11
1. Clear checkbox "Automatically import the template into Visual Studio" if you don't want immediately import it and click Finish button
11
12
1. Extract all files from the created zip-archive to any folder as you want. Typically, the file can be found in `C:\Users\<YOU>\Documents\Visual Studio 2019\My Exported Templates` folder
@@ -28,4 +29,16 @@ After making any changes do:
28
29
1. Add Release Notes
29
30
1. Rebuild the ReferenceProjectVSIX project and get "ASP.Net Core RESTful Service Template.vsix"
30
31
32
+
**Create a .Net Core Custom template**
33
+
1. Open the `DrWatson1.ProjectTemplate.RestAPI.csproj`
34
+
1. Update a package version in the `PackageVersion` tag
35
+
1. Update a description in the `Description` tag when needed
36
+
1. Update release notes in the `PackageReleaseNotes` tag
37
+
1. Open a command prompt and go to the "ProjectTemplates" folder
<IdentityId="ASP.Net Core RESTful Service Template-1"Version="2.5"Language="en-US"Publisher="Sergey Tregub" />
5
-
<DisplayName>ASP.Net Core 3.1 RESTful Service Template</DisplayName>
6
-
<Descriptionxml:space="preserve">Project template to create production-ready RESTful service based on ASP.Net Core 3.1. It contains preconfigured DI-container, logging, CORS, some boilerplate code and other features</Description>
4
+
<IdentityId="ASP.Net Core RESTful Service Template-1"Version="2.6"Language="en-US"Publisher="Sergey Tregub" />
5
+
<DisplayName>ASP.Net Core 3.1/5.0 RESTful Service Template</DisplayName>
6
+
<Descriptionxml:space="preserve">Project template to create production-ready RESTful service based on ASP.Net Core 3.1 or 5.0. It contains preconfigured DI-container, logging, CORS, some boilerplate code and other features</Description>
Copy file name to clipboardExpand all lines: README.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# ASP.Net Core RESTful Service Template
2
2
3
-
The repository contains a ready to use preconfigured project template for MS Visual Studio 2017 and 2019 to create fully functional production-ready cross-platform RESTful services based on ASP.Net Core 3.1.
3
+
The repository contains a ready to use preconfigured project template for MS Visual Studio 2017 and 2019 to create fully functional production-ready cross-platform RESTful services based on ASP.Net Core 3.1/5.0.
4
4
5
5
> Note 1. ASP.NET Core 3.0 has many breaking changes against version 2.2. If you want to use v2.2 or earlier, please, check out one of the previous releases, starting from [version 1.3](https://github.com/drwatson1/AspNet-Core-REST-Service/releases/tag/v1.3) or earlier.
6
6
>
@@ -24,7 +24,7 @@ Let me know, what do you think. Any suggestions and bug reports are very appreci
24
24
25
25
# Getting Started
26
26
27
-
27
+
## Using Visual Studio
28
28
1. Install the extension from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sergey-tregub.asp-net-core-restful-service-template#overview) or download and install the latest version from [GitHub](https://github.com/drwatson1/AspNet-Core-REST-Service/releases/latest). Also, you can install it from Visual Studio. To do so click on "Tools/Extensions and Updates..." menu item, then select "Online/Visual Studio Marketplace/Templates" on the left pane, search for "ASP.Net Core RESTful Service Template," select it and click "Download" button. Please note! The latest version of the template is targeted to the .Net Core 3.1. If you need a template for 2.x version use one of the previous version of the template.
29
29
1. Restart Visual Studio
30
30
1. Click on "File/New Project..." menu item
@@ -34,6 +34,25 @@ Let me know, what do you think. Any suggestions and bug reports are very appreci
34
34
1. Open a browser and navigate to [http://localhost:5000/swagger](http://localhost:5000/swagger) to see an API documentation
35
35
1. Play around with the API. Try to add a new product or update one
36
36
37
+
## Using command line
38
+
39
+
1. Install the template:
40
+
```
41
+
dotnet new -i DrWatson1.ProjectTemplate.RestAPI
42
+
```
43
+
2. Create a project:
44
+
```
45
+
dotnet new rest-api -n ASPNetCoreService
46
+
```
47
+
It creates a new project "ASPNetCoreService" in the corresponding subfolder.
48
+
Replace the "ASPNetCoreService" with a desired name.
49
+
3. Run the project:
50
+
```
51
+
dotnet run
52
+
```
53
+
4. Open a browser and navigate to [http://localhost:5000/swagger](http://localhost:5000/swagger) to see an API documentation
54
+
5. Play around with the API. Try to add a new product or update one
55
+
37
56
Visit project [Wiki](https://github.com/drwatson1/AspNet-Core-REST-Service/wiki) pages to learn more about the template.
38
57
39
58
Have fun and happy hacking!
@@ -42,6 +61,7 @@ Have fun and happy hacking!
42
61
43
62
|Date | Version | Release Notes |
44
63
|-----|---------|---------------|
64
+
|2021-05-03|2.6|<p>- Support of .Net 5.0<p>- Add `dotnet new` custom template
45
65
|2021-03-07|2.5|<p>- Minor fixes |
46
66
|2021-02-27|2.4|<p>- Improve logging |
47
67
|2021-02-23|2.3|<p>- Load .env before Serilog initialization to make it possible to use environment variables in Serilog configuration options<p>- Catch and log unhandled exceptions <p>- Update NuGet packages to the latest versions|
0 commit comments