Desired result: Get my BimlStudio project to output an SSIS package whose script tasks (or script components) use C# 6 language features.
I've got an SSIS 2014 Project with a single package that I've imported into BimlStudio
Varigence BimlStudio 5.0 (64-bit) Build 5.0.63501.0
Visual Studio Version info:
Microsoft Visual Studio Professional 2017 Version 15.9.5 VisualStudio.15.Release/15.9.5+28307.280 Microsoft .NET Framework Version 4.7.03056 Microsoft Visual Studio Tools for Applications 2017 00370-20004-06228-AA500
I'm to the point where I'm trying to compile my BimlStudio project. Not that I HAVE to, but because I'm trying to mirror the build behavior of my native SSIS 2014 project, I've change the default 64-bit MSBuild path in the .mst file from
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe
to
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\MSBuild.exe
Technically, to get C# 6 features, I don't believe this is required, but hear me out.
In BimlStudio, in the Logical or Project View pane, I right-click my project, and click Build.
In the Output pane I get the following (note error in bold):
------ Build ------ Working Directory: C:\PathToMyProject\BIMLStudioProject\output MsBuild Executable: C:\WINDOWS\system32\cmd.exe MsBuild Arguments: To replicate this build with bimlc.exe. Use the bimlc.resp file: bimlc.exe @"C:\PathToMyProject\BIMLStudioProject\output\BIMLStudioProject.mst.bimlc.resp" Microsoft Windows [Version 10.0.17134.706] (c) 2018 Microsoft Corporation. All rights reserved. C:\PathToMyProject\BIMLStudioProject\output>C:\WINDOWS\system32\chcp.com 65001 Active code page: 65001 C:\PathToMyProject\BIMLStudioProject\output>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\MSBuild.exe @"C:/_Development/Test Projects/BIML/BIMLStudioProject/output/BIMLStudioProject.mst.resp" 'C:\Program' is not recognized as an internal or external command, operable program or batch file. C:\PathToMyProject\BIMLStudioProject\output>exit %ERRORLEVEL% Build Failed
So having spaces in the path to MSBuild is "verboten"?
I tried added double quotes around the path to the MSBuild exe.
That didn't work. Maybe there's another way to do this?
It's not my primary question but any help there would be appreciated.
So, side-stepping the BimlStudio IDE limitation, I jump over to the command line and execute the following:
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\" MSBuild.exe @"C:/PathToMyProject/BIMLStudioProject/output/BIMLStudioProject.mst.resp"
And this outputs the following (scroll to bottom to view bolded errors):
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved. Build started 11/8/2019 4:12:07 PM. Project "C:\PathToMyProject\BIMLStudioProject\output\BIMLStudioProject.mst.ProjectView.bimlproj" on node 1 (default targets). BimlCompilerBuild: Message:: Biml Compiler Version 5.0.63501.0 Message:: Options: $TargetBimlScriptPrecompiledAssemblyPackagePath = $PrecompileBimlScript = False $LicenseKey = $DisplayMachineCode = False $TransformationScriptSettings = $TransformationScriptResourceAssembly = $TransformationScriptBundle = $PackageConfigurationPath = C:\PackageConfigurations $DocumentationOutputPath = C:\PathToMyProject\BIMLStudioProject\documentation $DocumentationSettings = $DocumentationTemplate = $BuildDocumentation = False $CleanOutputFolder = True $WarnAsError = False $Warn = 4 $TargetPath = C:\PathToMyProject\BIMLStudioProject\output\\ $TempPath = $WorkflowPath = $BuildOnlyWithDependencies = False @BuildOnly: @SourceFiles: ... C:\PathToMyProject\BIMLStudioProject\addedBiml\ScriptProjects\ST_4ed03a23e1db4022ad98d6615e195f26.biml ... @IncludeFiles: @TemplateFiles: @BimlDocSchemaGraphProfiles: @BundleFiles: @BundleSettings: @ResponseFiles: $SsisDeploymentModel = Project $SsasVersion = Ssas2014 $SsasTabularVersion = SsasTabular2016 $SsisVersion = Ssis2014 $SqlVersion = SqlServer2014 $DdlBuildMode = SsisPackages $SsisEncryptionPassword = $SsisExternalColumnsQueryTimeout = $ImportSsis = False $ImportSsisOptionsPath = $GetHelp = False Message:: Processing Biml Code... Message:: Running Project Transformers... Message:: Running Custom Transformers... Message:: Running Core Transformers... Message:: Emitting SQL Server Assets... Message:: 1/1 Emitting Project SagittaExtract.dtproj Message:: 1/1 Emitting Package PackageTemplate In Script Project 'ST_4ed03a23e1db4022ad98d6615e195f26': \ScriptMain.cs(129,42): error : Error:: Unexpected character '$' [C:\PathToMyProject\BIMLStudioProject\output\BIMLStudioProject.mst.ProjectView.bimlproj] In Script Project 'ST_4ed03a23e1db4022ad98d6615e195f26': \ScriptMain.cs(223,35): error : Error:: Unexpected character '$' [C:\PathToMyProject\BIMLStudioProject\output\BIMLStudioProject.mst.ProjectView.bimlproj] Done Building Project "C:\PathToMyProject\BIMLStudioProject\output\BIMLStudioProject.mst.ProjectView.bimlproj" (default targets) -- FAILED. Build FAILED.
Notice that my script task has an invalid character '$'. This would correspond with doing string interpolation (C# 6.0 language feature).
So what do I do to get C# 6 language features in my script task?
I've tried using the Biml Project's default MSBuild path and version, and adding the /toolsversion switch.
MSBuild.exe ... /tv:14.0
Then, changed to use VS 2017's 64-bit MSBuild.exe
MSBuild.exe ... /tv:15.0
Neither worked.
Any help with getting this to work would be much appreciated.
Thanks.