I am currently working on containerizing an asp.net .net framework web application.
Most of it is functioning correctly. However, I have encountered an issue where my .ts files are not being compiled for some reason.
The build process runs smoothly in an Azure DevOps Pipeline but fails in the docker environment.
Upon checking the logs from the Azure DevOps build, I noticed the following entries...
Processing resource file "My Project\Resources.resx" into "obj\Prod\Resources.resources".
PreComputeCompileTypeScriptWithTSConfig:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsc.exe --project "D:\a\1\s\MyProject\tsconfig.json" --listEmittedFiles --listFiles --noEmit
CompileTypeScriptWithTSConfig:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsc.exe --project "D:\a\1\s\MyProject\tsconfig.json" --listEmittedFiles
WebCompile:
...
However, in my docker build, the log shows...
Processing resource file "My Project\Resources.resx" into "obj\Prod\Resources.resources".
WebCompile:
...
It appears that the typescript part is being skipped.
I am unsure about the necessary steps to rectify this issue as it was automatically taken care of in Azure DevOps without any additional configuration.
This is the msbuild command executed by Azure DevOps Pipeline...
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\msbuild.exe" "D:\a\1\s\MyProject.sln" /nologo /nr:false /dl:CentralLogger,"D:\a\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=D:\a\1\s"*ForwardingLogger,"D:\a\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /m /p:MvcBuildViews=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="D:\a\1\a\\" /p:platform="any cpu" /p:configuration="prod"
And here is the command utilized in my Dockerfile
msbuild ./MyProject.sln -target:MyProject -p:TargetFrameworkVersion=v4.7.2 -p:Configuration=prod -p:DeployIisAppPath='Default Web Site' -m -p:MvcBuildViews=true -p:DeployOnBuild=false -p:PackageAsSingleFile=true /p:OutDir=/artifacts /t:Package
The Azure DevOps command seems to have more parameters defined, and I am unsure which specific one triggers the typescript compilation or if it's related to the msbuild options at all.
My Dockerfile uses the following base image...
mcr.microsoft.com/dotnet/framework/sdk:4.7.2
In case it's relevant, this is my tsconfig.json settings
{
"compilerOptions": {
"typeRoots": ["scripts/typings"],
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"module": "none"
}
}
If you require any additional information to provide a better understanding, please let me know. My project file is too extensive to include entirely, but I can share relevant sections if needed.