Skip to content

Commit 750d7e7

Browse files
committed
feat: Added Microsoft.CodeDom.Providers.DotNetCompilerPlatform as a reference, updated NuGet-packages' versions
1 parent f9c334b commit 750d7e7

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# How to create new template
2+
3+
After making any changes do:
4+
5+
1. Select Release configuration for a solution
6+
1. Select ReferenceProject in "Solution Explorer" and click "Project/Export Template..." menu item from the VS main menu
7+
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 WebAPI Application with OWIN" as a template name
9+
1. Clear checkbox "Automatically import the template into Visual Studio" if you don't want immediately import it and click Finish button
10+
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 2017\My Exported Templates" folder
11+
1. Open ReferenceProject.csproj file in any text editor and find "DocumentationFile" tag
12+
1. Replace string "%24safeprojectname%24" to "$safeprojectname$" inside it and save the file
13+
1. Replace a file "MyTemplate.vstemplate" with the one from the project folder with the same name
14+
1. Add all files from the folder to zip-archive with a name "ASP.Net WebAPI Application with OWIN.zip"
15+
1. Copy this file to "ProjectTemplates\AspNet.WebApi\ReferenceProject\ReferenceProjectVSIX\ProjectTemplates\CSharp\Web" folder and replace an existing one
16+
1. Go to VS, expand a ReferenceProjectVSIX project and double click on source.extension.vsixmanifest file
17+
1. Increase minor version number on the tab "Metadata" in the top right corner
18+
1. Rebuild the ReferenceProjectVSIX project and get "ASP.Net WebAPI Application Project Template.vsix"
19+
20+
That's all. "ASP.Net WebAPI Application Project Template.vsix" can be uploaded to VS Marketplace or installed in VS.

ProjectTemplates/AspNet.WebApi/ReferenceProject/ReferenceProject/ReferenceProject.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@
6363
<Version>2.0.0</Version>
6464
</PackageReference>
6565
<PackageReference Include="AutoMapper">
66-
<Version>7.0.1</Version>
66+
<Version>8.0.0</Version>
6767
</PackageReference>
6868
<PackageReference Include="DotNetEnv">
69-
<Version>1.1.0</Version>
69+
<Version>1.2.0</Version>
7070
</PackageReference>
7171
<PackageReference Include="IdentityModel">
72-
<Version>3.7.1</Version>
72+
<Version>3.10.2</Version>
7373
</PackageReference>
7474
<PackageReference Include="Microsoft.AspNet.WebApi" Version="5.2.6" />
7575
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.6" />
@@ -78,6 +78,9 @@
7878
<Version>5.2.6</Version>
7979
</PackageReference>
8080
<PackageReference Include="Microsoft.AspNet.WebApi.WebHost" Version="5.2.6" />
81+
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
82+
<Version>2.0.1</Version>
83+
</PackageReference>
8184
<PackageReference Include="Microsoft.Owin.Cors">
8285
<Version>4.0.0</Version>
8386
</PackageReference>
@@ -104,7 +107,7 @@
104107
<Version>4.1.0</Version>
105108
</PackageReference>
106109
<PackageReference Include="Serilog.Settings.AppSettings">
107-
<Version>2.1.2</Version>
110+
<Version>2.2.2</Version>
108111
</PackageReference>
109112
<PackageReference Include="Serilog.Sinks.File">
110113
<Version>4.0.0</Version>

ProjectTemplates/AspNet.WebApi/ReferenceProject/ReferenceProject/Web.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@
176176
</runtime>
177177
<system.codedom>
178178
<compilers>
179-
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
180-
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
179+
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
180+
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
181181
</compilers>
182182
</system.codedom>
183183
</configuration>
27 Bytes
Binary file not shown.

ProjectTemplates/AspNet.WebApi/ReferenceProject/ReferenceProjectVSIX/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="ASP.Net WebAPI Application Project Template-1" Version="1.3" Language="en-US" Publisher="Sergey Tregub" />
4+
<Identity Id="ASP.Net WebAPI Application Project Template-1" Version="1.4" Language="en-US" Publisher="Sergey Tregub" />
55
<DisplayName>ASP.Net WebAPI Application Project Template</DisplayName>
66
<Description xml:space="preserve">Project template to create production-ready RESTful service based on ASP.Net WebAPI and OWIN. It contains preconfigured DI-container, logging, CORS, JWT-bearer authentication, boilerplate code and other features</Description>
77
<MoreInfo>https://github.com/drwatson1/AspNet-WebApi</MoreInfo>

0 commit comments

Comments
 (0)