I am trying to create windows image for .NET framework 4.8.
One of my project APPSeCONNECT.Database.sqlproj when getting nuget restored isn’t able to find the file.
C:appAEC.Platform.CommonAEC.Platform.DatabaseAPPSeCONNECT.DatabaseAPPSeCONNECT.Database.sqlproj(90,56):
error MSB4226: The imported project “C:Program Files (x86)Microsoft Visual Studio2022BuildToolsMSBuildMicrosoftVisualStudiov17.0SSDTMicrosoft.Data.Tools.Schema.SqlTasks.targets” was not found. Also, tried to find “MicrosoftVisualStudiov17.0SSDTMicrosoft.Data.Tools.Schema.SqlTasks.targets” in the fallback search path(s) for $(MSBuildExtensionsPath) – “C:Program Files (x86)MSBuild” . These search paths are defined in “C:Program Files (x86)Microsoft Visual Studio2022BuildToolsMSBuildCurrentBinmsbuild.exe.Config”. Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths.
Found from internet that I have to add
vs_buildtools.exe
Below is the entire docker file
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build
# Install SQL Server Data Tools (SSDT) along with Visual Studio Build Tools
RUN powershell -Command "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe;
Start-Process -FilePath vs_buildtools.exe -ArgumentList '--quiet --wait --norestart --add Microsoft.VisualStudio.Workload.DataTools --includeRecommended --includeOptional' -NoNewWindow -Wait;
Remove-Item -Force vs_buildtools.exe"
# Verify SSDT installation
RUN cmd /c "dir "C:Program Files (x86)Microsoft Visual Studio2022BuildToolsMSBuildMicrosoftVisualStudiov17.0""
# Set the working directory
WORKDIR /app
COPY AEC.Platform.Apps/AEC.BackgroundService/ /app/AEC.Platform.Apps/AEC.BackgroundService/
# Usefull to see the contents of the directory
# RUN powershell -Command "Get-ChildItem -Recurse 'C:\app'"
# Copy the common files from the parent directory
COPY AEC.Platform.Common/AEC.Platform.SDK /app/AEC.Platform.Common/AEC.Platform.SDK
COPY AEC.Platform.Common/APPSeConnect.BackgroundServices.Helpers /app/AEC.Platform.Common/APPSeConnect.BackgroundServices.Helpers
COPY AEC.Platform.Common/APPSeConnect.Cloud.Helpers /app/AEC.Platform.Common/APPSeConnect.Cloud.Helpers
COPY AEC.Platform.Common/APPSeConnect.Common /app/AEC.Platform.Common/APPSeConnect.Common
COPY AEC.Platform.Common/APPSeConnect.Data /app/AEC.Platform.Common/APPSeConnect.Data
COPY AEC.Platform.Common/AEC.Platform.Database /app/AEC.Platform.Common/AEC.Platform.Database
COPY AEC.Platform.Common/APPSeConnect.Lib /app/AEC.Platform.Common/APPSeConnect.Lib
COPY AEC.Platform.Common/APPSeConnect.RealTimeCommunication /app/AEC.Platform.Common/APPSeConnect.RealTimeCommunication
COPY AEC.Platform.Common/APPSeConnect.Security /app/AEC.Platform.Common/APPSeConnect.Security
COPY AEC.Platform.Common/Insync.Utils /app/AEC.Platform.Common/Insync.Utils
COPY AEC.Platform.Common/APPSeConnect.Data.DataClasses /app/AEC.Platform.Common/APPSeConnect.Data.DataClasses
# Restore NuGet packages
RUN powershell -Command "nuget restore 'C:\app\AEC.Platform.Apps\AEC.BackgroundService\AEC.Platform.BackgroundService.sln'"
# Build the solution in Release mode for x64 platform
RUN msbuild /app/AEC.Platform.Apps/AEC.BackgroundService /p:Configuration=Debug /p:Platform="x64"
# Use the official Microsoft .NET Framework runtime image to run the application
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime
# Set the working directory
WORKDIR /app
# Copy the build output from the build stage to the runtime stage
COPY --from=build /app/APPSeConnect.Worker.Console/x64/Debug .
# Define the entry point for the application
ENTRYPOINT ["APPSeConnect.Worker.Console.exe"]
The directory listing using cmd shows no directory named SSDT06/11/2024 11:42 PM
<DIR> .
06/11/2024 11:42 PM <DIR> ..
06/11/2024 11:42 PM <DIR> Python Tools
06/11/2024 11:42 PM <DIR> Web
06/11/2024 11:42 PM <DIR> WebApplications
Thanks.