I have the following dockerfile, the project works fine when running through Visual Studio:
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR /app
# Copy everything
COPY . ./
RUN dotnet build Inventory.sln -c Release -o /out
The problem is when I build it. The build phase gives me this error:
C:\Program Files\dotnet\sdk\5.0.407\Microsoft.Common.CurrentVersion.targets(1217,5):
error MSB3644: The reference assemblies for .NETFramework,Version=v4.5.2 were not found.
To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework
version or retarget your application.
You can download .NET Framework Developer Packs at
https://aka.ms/msbuild/developerpacks [C:\app\InventoryInterface\InventoryInterface1.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.15
The command 'cmd /S /C dotnet build Inventory.sln -c Release -o /out' returned a non-zero code: 1
I am new to windows container and I would like to know how to fix this. I already tried to curl the framework but when I execute it, nothing happens.
Thanks in advance.
InventoryInterface1.csproj.