MSBUILD configuration with config /p:VisualStudioVersion=16.0
Hi
I am migrating some SSIS (with a task script in C#) +project code from SQL server 2016 to 2022
Creating the ispac happens when the code rebuild in TEAMCITY. On MSBUILD step , I am trying to put this config
MSBuild.exe Solution.sln /p:Configuration=Release /p:Platform="Any CPU" /p:VisualStudioVersion=16.0
But the compile fails.
If I do not use this config and just build with Visual Studio 2019 then it creates the ispac but on runtime, I get error the binary code of script is missing.
Would you please tell me what to do?
Thank you
Kati
Please sign in to leave a comment.
Hi Kati,
TeamCity simply wraps and executes command-line instructions on the build agent. Therefore, before troubleshooting within TeamCity, please test the build command locally on the same agent machine to verify it works outside TeamCity first.
In your case, there appear to be three main issues:
- Incorrect MSBuild version — SSIS projects, especially those containing script tasks, require the correct SQL Server Data Tools (SSDT) MSBuild targets.
- Missing SSIS Build Tools — MSBuild cannot build .dtproj projects without the appropriate SSIS extensions installed.
- Missing Script Task binary at runtime — This may indicate that the script task was not compiled properly and the script binary blob was not embedded into the .dtsx or .ispac files.
Please ensure the following:
- For SQL Server 2022, you should use Visual Studio 2022 with the latest SSDT extension. So install Visual Studio 2022, along with SSDT and the SSIS extension, on the TeamCity build agent.
- Verify that the build command runs successfully when executed directly on the agent machine before running it through TeamCity.
- In TeamCity, use MSBuild from Visual Studio 2022 with the parameter /p:VisualStudioVersion=17.0.
- If necessary, consider using devenv.com instead of MSBuild to build SSIS solutions.
- Perform a clean and rebuild of the solution to ensure script binaries are generated and embedded correctly.
- Review the build logs carefully for any errors.
If the build works locally on the agent machine but still fails within TeamCity, please collect the teamcity-agent.log and the build logs and share them with us for further investigation.
Large files can be uploaded via https://uploads.jetbrains.com/. Please let us know the exact id after the upload.
Best Regards,
Tom