Search code examples
dockerasp.net-corevisual-studio-2017asp.net-core-webapi

How do you change Docker OS Support for a .Net Core Web Application Project?


I have a .NET Core Web Application project where I chose the incorrect OS under the "Enable Docker Support" checkbox: enter image description here

How do I change this for an existing project? And to be clear, I want to target linux, not "Switch to Windows Containers..." in docker.


Solution

  • This turned out to be easy, and I did it through editing the csproj file: Changed <DockerDefaultTargetOS>Windows</DockerDefaultTargetOS> to <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> and reload.

    I am still not sure where you would do this from Visual Studio (if it possible).