-
Describe the BugBuilding Windows docker image with a build from the latest .NET 8 samples results in warning being emited during Steps to ReproduceUse Visual Studio 2022 17.8.0 Preview 1.0 to create a new .NET 8 Web API project with a Windows container. The sample creates a
When building image from this definition, the warning The application will be compiled into the literal Expected behavior: .NET app should be built using the value of the Other InformationOutput of
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Beta Was this translation helpful? Give feedback.
-
Since the variable is being referenced from a cmd.exe shell command, you need to use the appropriate syntax for that shell which is RUN dotnet build "ppas.csproj" -c %BUILD_CONFIGURATION% -o /app/build If you were to reference the variable outside the context of a shell command (like a |
Beta Was this translation helpful? Give feedback.
Since the variable is being referenced from a cmd.exe shell command, you need to use the appropriate syntax for that shell which is
%VAR_NAME%
, not$VAR_NAME
. So the correct instruction would be the following:If you were to reference the variable outside the context of a shell command (like a
FROM
instruction, for example), you would use$BUILD_CONFIGURATION
because that is being parsed by Docker, not cmd.exe.