.net – Can i use Docker Compose in dotnet template?


I am trying to create a dotnet template using dotnet new (for Visual Studio). It mostly works fine, apart from docker compose. I tried to include a docker compose project (.dcproj) just as everything else.

When using the dotnet new command, everything works fine, the solution file is generated correctly. But if i use the template within Visual Studio, the soltuion file gets changed – and the dcproj is just removed. I could not figure out any way to preserve the dcproj when working with visual studio – I also couldn’t find any other templates that are using docker compose in that way. Is this possible? Why is Visual Studio doing that?

My template.json:

{
    "$schema": "http://json.schemastore.org/template",
    "author": "Me",
    "classifications": [ "Blazor" ],
    "identity": "BlazorApplication",
    "name": "Blazor Application",
    "description": "A pre-configured blazor project.",
    "shortName": "blazor",
    "sourceName":"BlazorApplication",
    "tags": {
      "language": "C#",
      "type": "project"
    }
  }

Leave a Reply

Your email address will not be published. Required fields are marked *