I've started a new .net 5 web app in vs 2019 with docker support. When I try to run it it throws the error "No valid value was specified for docker build context". Google isn't turning up anything on this. Anyone know how to fix this?
When I click on the error it takes me to this block of code in the container.targets file located at C:\Users\user\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.11.1\build. It references the line where <ContainerBuildAndLaunch starts.
<Target Name="ContainerBuildAndLaunch"> <PropertyGroup> <LaunchContainer>false</LaunchContainer> <LaunchContainer Condition="Exists('$(ContainerSemaphoreFilePath)')">true</LaunchContainer> <ContainerDevelopmentMode Condition="'$(LaunchContainer)' != 'true'">Regular</ContainerDevelopmentMode> <!-- If we aren't building with intent to launch, always do full build --> </PropertyGroup> <ContainerBuildAndLaunch LaunchContainer="$(LaunchContainer)" Dockerfiles="@(Dockerfile)" ContainerDevelopmentMode="$(ContainerDevelopmentMode)" IntermediateOutputPath="$(ContainerIntermediateOutputPath)" ProjectCapability="@(ProjectCapability)" ProjectFilePath="$(MSBuildProjectFullPath)" NuGetPackageFolders="$(NuGetPackageFolders)" NuGetPackageRoot="$(NuGetPackageRoot)" TargetFramework="$(TargetFramework)" TargetFrameworkIdentifier="$(TargetFrameworkIdentifier)" TargetPath="$(TargetPath)" ErrorLogFilePath="$(ContainerSemaphoreFilePath)" DockerLabelBuiltImages="$(DockerLabelBuiltImages)" ProjectTypeGuids="$(ProjectTypeGuids)" OutputType="$(OutputType)" DevEnvDir="$(DevEnvDir)" VisualStudioVersion="$(VisualStudioVersion)" ContainersToolsVersion="$(ContainersToolsVersion)" AzureFunctionsVersion="$(AzureFunctionsVersion)" FunctionsExecutionModel="$(FunctionsExecutionModel)" ActiveDebugProfile="$(ActiveDebugProfile)" DockerfileFile="$(DockerfileFile)" DockerDefaultDockerfile="$(DockerDefaultDockerfile)" DockerfileBuildArguments="$(DockerfileBuildArguments)" DockerfileContext="$(DockerfileContext)" DockerDefaultContext="$(DockerDefaultContext)" DockerfileRepository="$(DockerfileRepository)" DockerfileRunArguments="$(DockerfileRunArguments)" ContainerVsDbgPath="$(ContainerVsDbgPath)" DockerImageLabel="$(DockerImageLabel)" DockerImageLabels="$(DockerImageLabels)" DockerIncludeDefaultImageLabels="$(DockerIncludeDefaultImageLabels)" DockerDefaultImageLabels="$(DockerDefaultImageLabels)" DockerfileRunEnvironmentFiles="$(DockerfileRunEnvironmentFiles)" DockerfileStage="$(DockerfileStage)" DockerfileFastModeStage="$(DockerfileFastModeStage)" DockerfileTag="$(DockerfileTag)" DockerDefaultTag="$(DockerDefaultTag)" DockerfileTargetOS="$(DockerfileTargetOS)" DockerDefaultTargetOS="$(DockerDefaultTargetOS)" UserSecretsId="$(UserSecretsId)" DockerDebuggeeArguments="$(DockerDebuggeeArguments)" DockerDebuggeeKillProgram="$(DockerDebuggeeKillProgram)" DockerDebuggeeProgram="$(DockerDebuggeeProgram)" DockerDebuggeeWorkingDirectory="$(DockerDebuggeeWorkingDirectory)" DockerFastModeProjectMountDirectory="$(DockerFastModeProjectMountDirectory)" BlazorStaticWebAssetsManifest="$(_GeneratedStaticWebAssetsDevelopmentManifest)"> <Output TaskParameter="DockerfilesOut" ItemName="_Dockerfile" /> </ContainerBuildAndLaunch> </Target> Update: When I reopened this solution file I noticed in the output from the Container Tools in visual studio, the last line output was...
========== Verifying Docker OS ========== Verifying that Docker Desktop's operating system mode matches the project's target operating system... Docker Desktop's operating system mode matches the project's target operating system. A non-critical error occurred while getting the container(s) ready. Your project(s) will continue to function normally. The error was: No valid value was specified for Docker build context. It says that the project will function normally but clearly it doesn't.
