- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
期望的结果:让我的 BimlStudio 项目输出一个 SSIS 包,其脚本任务(或脚本组件)使用 C# 6 语言功能。
我有一个 SSIS 2014 项目,其中包含一个已导入 BimlStudio 的包
Varigence BimlStudio 5.0 (64-bit)Build 5.0.63501.0
Visual Studio 版本信息:
Microsoft Visual Studio Professional 2017 Version 15.9.5VisualStudio.15.Release/15.9.5+28307.280Microsoft .NET FrameworkVersion 4.7.03056Microsoft Visual Studio Tools for Applications 2017 00370-20004-06228-AA500
我正要尝试编译我的 BimlStudio 项目。不是我必须这样做,而是因为我试图反射(reflect)我的原生 SSIS 2014 项目的构建行为,所以我更改了 .mst 文件中的默认 64 位 MSBuild 路径,从
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe
到
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.
在 BimlStudio 中,在逻辑或项目 View Pane 中,我右键单击我的项目,然后单击构建。
在“输出” Pane 中,我得到以下信息(请注意粗体错误):
------ 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
所以在 MSBuild 的路径中有空格是“verboten”?
我尝试在 MSBuild exe 的路径周围添加双引号。
那没有用。也许还有另一种方法可以做到这一点?
这不是我的主要问题,但如有任何帮助,我们将不胜感激。
因此,为了避开 BimlStudio IDE 的限制,我跳转到命令行并执行以下命令:
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\" MSBuild.exe @"C:/PathToMyProject/BIMLStudioProject/output/BIMLStudioProject.mst.resp"
这将输出以下内容(滚动到底部以查看粗体错误):
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.
请注意,我的脚本任务有一个无效字符“$”。这对应于做 string interpolation (C# 6.0 语言特性)。
那么我该怎么做才能在我的脚本任务中获得 C# 6 语言特性?
我试过使用 Biml 项目的默认 MSBuild 路径和版本,并添加/toolsversion 开关。
MSBuild.exe ... /tv:14.0
然后,改为使用VS 2017的64位MSBuild.exe
MSBuild.exe ... /tv:15.0
均无效。
如能提供帮助,我们将不胜感激。
谢谢。
最佳答案
不幸的是,Biml 编译器 (bimlc) 不支持 Roslyn(我知道这是一个 future 的目标,但存在依赖关系,我不知道当前状态,我听说很快就会有新的下降,可能会支持SQL Server 2019 版)。
我会联系 Varigence 的人员进行确认。
已经永远吸进了 window 并且很可能会永远继续吸进。是的,您可以用双引号引起来,这样 "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\MSBuild.exe"
会起作用,但是什么如果其他东西需要引号或 $Diety-help-you,你必须将它作为参数传递给 xp_cmdshell 之类的东西,它只允许整个参数中的一个项目有一对双引号......是的,方法是使用 dos 8.3 命名约定的肮脏技巧,因为它们仍然有效。
从命令行,Win+R cmd.exe
cd /d C:\
dir /x
指示命令 shell 更改驱动器并转到 C 驱动器的根目录第二条命令中的/x
displays the short names generated for non-8dot3 file names.
所以你应该看到这样的输出
C:\>dir /x
Volume in drive C has no label.
Volume Serial Number is 3AB8-1C01
Directory of C:\
10/30/2019 04:26 PM <DIR> Dropbox
03/13/2019 06:07 PM <DIR> Intel
08/25/2019 01:32 PM <DIR> javajars
10/19/2019 03:33 PM <DIR> NEVERW~1 NeverwinterNights
03/12/2019 04:34 PM <DIR> NVIDIA
08/25/2019 02:01 PM <DIR> OnMyPath
03/18/2019 10:52 PM <DIR> PerfLogs
10/14/2019 09:57 PM <DIR> PROGRA~1 Program Files
10/19/2019 03:51 PM <DIR> PROGRA~2 Program Files (x86)
11/14/2018 07:16 PM <DIR> Python27
11/14/2018 07:16 PM <DIR> PYTHON~1 Python27amd64
06/22/2019 11:17 AM <DIR> Src
06/30/2019 08:45 PM <DIR> ssisdata
10/19/2019 01:52 PM <DIR> TEMP
06/28/2019 02:21 PM <DIR> tmp
07/30/2019 06:52 AM 110,312 UkLog.dat
05/28/2019 04:25 PM <DIR> Users
10/19/2019 03:54 PM <DIR> Windows
1 File(s) 110,312 bytes
17 Dir(s) 333,863,874,560 bytes free
NeverwinterNights 和 Python27amd64 太长(超过 8 个字符),这就是它们出现在第一个“名称”列中的原因。出现“Program Files”和“Program Files (x86)”是因为它们的名称中有空格(也超过 8 个字符)。
重要的是使用替代名称。模式并不难,它是前 6 个字符,较少的空格,然后是 ~#
从 1 到 9,直到你得到超过 9 个条目。
C:\PROGRA~2>dir /x mic*
Volume in drive C has no label.
Volume Serial Number is 3AB8-1C01
Directory of C:\PROGRA~2
02/21/2018 06:00 AM <DIR> MICROS~2 Microsoft Analysis Services
03/16/2018 02:17 AM <DIR> MICROS~2.NET Microsoft ASP.NET
06/22/2019 01:24 PM <DIR> MI7DE1~1 Microsoft Azure Storage Explorer
04/24/2019 06:48 PM <DIR> MICROS~4 Microsoft Help Viewer
03/01/2018 12:36 PM <DIR> MIF5BA~1 Microsoft Office
09/12/2018 04:35 PM <DIR> MI29F1~1 Microsoft OneDrive
10/24/2018 06:12 AM <DIR> MICROS~3 Microsoft SDKs
01/19/2019 10:48 AM <DIR> MI9950~1 Microsoft Silverlight
07/11/2019 08:10 PM <DIR> MICROS~1 Microsoft SQL Server
04/24/2019 06:50 PM <DIR> MIEFB9~1 Microsoft SQL Server Management Studio 18
11/14/2018 07:17 PM <DIR> MIB055~1 Microsoft Visual Studio
02/21/2018 06:02 AM <DIR> MICROS~2.0 Microsoft Visual Studio 10.0
05/28/2019 04:33 PM <DIR> MICROS~3.0 Microsoft Visual Studio 11.0
05/28/2019 04:33 PM <DIR> MICROS~4.0 Microsoft Visual Studio 12.0
05/28/2019 04:33 PM <DIR> MICROS~1.0 Microsoft Visual Studio 14.0
10/24/2018 06:07 AM <DIR> MIFDD6~1 Microsoft Web Tools
05/28/2019 07:23 PM <DIR> Microsoft.NET
0 File(s) 0 bytes
17 Dir(s) 333,865,095,168 bytes free
我敢肯定替代名称的工作原理已经被记录在案......25 年前 - 我认为这种废话出现在 Windows 95 中,但说真的,见鬼去吧。
因此,您正在寻找位于 x86 文件夹中的构建。不要让 Tab 完成帮助您更改目录,因为它将使用全名而不是短名。所以 cd progra~2
泡沫、冲洗、重复,直到您到达包含可执行文件的文件夹。长文件名无关紧要,因此路径中的 Professional 不会中断,它只是空格,但最终,您将位于带有 .exe 的文件夹中,然后您将获取路径。我采取了懒惰的方式,只是让 dir 使用 dir/s/b msbuild.exe
C:\PROGRA~2\MIB055~1\2017\Enterprise\MSBuild\15.0\Bin>dir /s /b MSBuild.exe
C:\PROGRA~2\MIB055~1\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
C:\PROGRA~2\MIB055~1\2017\Enterprise\MSBuild\15.0\Bin\amd64\MSBuild.exe
此时,您应该能够将这些路径中的任何一个通过管道传输到 BimlStudio 中的 MSBuild,然后将它们保存到 .resp 文件中,看看是否解决了路径中的空间问题。
今天我了解到您可以在 SSIS 脚本任务和组件中使用 6.0 功能。
public void Main()
{
string name = "mark";
string v = $"Hello, {name}!";
bool fireagain = false;
Dts.Events.FireInformation(0, "Really worked", v, string.Empty, 0, ref fireagain);
Dts.TaskResult = (int)ScriptResults.Success;
}
在我的输出窗口中
Information: 0x0 at Script Task, Really worked: Hello, mark!
注意:尝试将 Roslyn 功能添加到脚本任务可以 effectively disable Script Task debugging
关于c# - 如何让 BIML 编译器允许脚本任务、脚本组件中的 c#6 语言功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58775698/
我有一个项目将数据从 MySQL 数据库移动到 SQL2012 中的数据库。现在没有什么特别的,只是直接推送数据。我通过 ODBC 访问 MySQL 实例,SQL DB 是一个 OLE 连接。生成包时
当我使用 GetDropAndCreateDdl 为表生成 CREATE 脚本时,我得到的列数据类型与实际数据类型不同。 这会导致包验证错误,“错误输出的属性与其对应数据源列的属性不匹配”,验证状态为
我正在尝试通过 BIML 将脚本任务添加到我的 SSIS 包中。这是怎么做的?我添加了以下内容,但 ScriptTaskProjectName 无法解析。
ssis 中的数据转换任务不允许重复使用现有列以便于自动映射到目标。 所以我编写了一个 foreach 列并评估了数据类型,将其动态添加到列集合中。 我注意到 DataType 和 Length 是必
我是 Biml 新手,最近使用 Visual Studio 2019 中的管理扩展功能安装了它,但我在栏中找不到它,如下所示: 最佳答案 当前版本的 BIMLExpress (5.0.64108.0)
如何使用 BID 和 BIML 在 SQL Server 2008 中勾选模糊查找转换 (FLT) 对象中的复选框。我假设它将输出列添加到输出路径,我不知道?我希望我的输出是 查找列=属性 查找列=
我是 Biml 新手,最近使用 Visual Studio 2019 中的管理扩展功能安装了它,但我在栏中找不到它,如下所示: 最佳答案 当前版本的 BIMLExpress (5.0.64108.0)
我正在将现有的SSIS包生成框架迁移到BIML,面临迁移以下逻辑的任务。 该框架(用 C# 编写)基于元数据创建一个 OLE DB 源。然后,在实例化数据源之后,它会查看输出列。如果存在某些列 - 框
我正在使用 BIML 构建多个 SSIS 包,我必须在日期间隔之间从 OLE DB 源中检索数据。这是将要生成包的 xml: "> )" ConnectionName="AS
我正在使用 BIML 为 SSIS 动态创建加载包,以将数据从 Informix 加载到 SQL Server。问题是这个 BIML 代码产生了下面的 SQL SELECT FROM SELECT
我使用以下 BIML 脚本根据源数据库创建每个表的列列表。我还添加了 dwh_timestamp 列。我使用此脚本创建目标表,添加元数据列。
从 BIML 生成 SSIS 包很常见。但是有什么方法可以从 SSIS 包生成 BIML 吗?因此我们可以重用旧的 SSIS 包而无需编写新的 BIML。 最佳答案 有一种方法可以用 BimlOnli
我正在尝试使用 BIML 生成自动暂存区域。源数据库为Progress,通过ODBC连接。 我正在使用以下演练: https://www.cathrinewilhelmsen.net/2015/07/
我遇到这样一种情况,我的主 biml 生成 150 个执行包任务。我需要生成序列容器,以便它们每个都在主包中为每个序列容器保存 (150/10)15 个执行包任务。 能否请您帮我找到合适的解决方案,欢
完成 BIML 脚本(使用 BIDS SQL Server 2008)创建 SSIS 包后,您只需右键单击 BIML 文件并单击“生成 SSIS 包”。 我如何通过代码生成 SSIS 包,例如C# 还
到目前为止,我已成功使用 BIML 自动生成 SSIS 包(从 CSV 到 SQL Server)。但是我在平面文件格式中有 Varchar(MAX) 列时遇到了问题。 问题是如果我定义了一个 类型的
大多数人都知道,每当将带有临时表的存储过程用作 OleDbSource 时,SSIS 都很难读取元数据。以前,这可以通过添加 SET FMTONLY OFF 轻松防止;在 EXEC 语句之前。这样做的
是否可以为 ScriptComponentProject 设置 .NET Framework 版本? ? 当前默认为 .NET 4 ,但我希望它是 .NET 4.6.1 我查看了 ScriptComp
我致力于创建 biml。从中生成 ssis 包。构建 SSIS 项目,然后在服务器上部署 ispac 文件。 但是这些所有手动步骤都可以自动化吗? 我可以使用命令行从 biml 生成 ssis 吗?除
我刚刚接触 BIML 并编写了一些脚本来创建一些 DTSX 包。一般来说,大多数事情都在起作用。但有一件事让我发疯。 我有一个 ODBC 源 (PostgreSQL)。从那里我使用 ODBC 源从表中
我是一名优秀的程序员,十分优秀!