SSIS 项目中的后期构建
我正在尝试在我的 SSIS 项目中添加 PostBuildEvent 。 这是我的原始 .DTProj 文件,来自一个带有一个测试包的测试项目。
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ProductVersion>10.0.2531.0</ProductVersion>
<SchemaVersion>9.0.1.0</SchemaVersion>
<State>$base64$PFNvdXnRyb2xJbmZvPg==</State>
<Database>
<Name>PreBeforeDeployTest.database</Name>
<FullPath>PreBeforeDeployTest.database</FullPath>
</Database>
<Cubes />
<Dimensions />
<DataSources />
<DataSourceViews />
<MiningModels />
<Roles />
<Miscellaneous />
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<OutputPath>bin</OutputPath>
<ConnectionMappings />
<ConnectionProviderMappings />
<ConnectionSecurityMappings />
<DatabaseStorageLocations />
</Options>
</Configuration>
</Configurations>
<DTSPackages>
<DtsPackage FormatVersion="3">
<Name>TestPackage.dtsx</Name>
<FullPath>TestPackage.dtsx</FullPath>
<References />
</DtsPackage>
</DTSPackages>
</Project>
我尝试插入
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PropertyGroup>
<PostBuildEvent>copy "$(TargetDir)TestPackage.dtsx" "C:\"</PostBuildEvent>
</PropertyGroup>
<ProductVersion>10.0.2531.0</ProductVersion>
<SchemaVersion>9.0.1.0</SchemaVersion>
<State>$base64$PFNvdXnRyb2xJbmZvPg==</State>
<Database>
<Name>PreBeforeDeployTest.database</Name>
<FullPath>PreBeforeDeployTest.database</FullPath>
</Database>
<Cubes />
<Dimensions />
<DataSources />
<DataSourceViews />
<MiningModels />
<Roles />
<Miscellaneous />
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<OutputPath>bin</OutputPath>
<ConnectionMappings />
<ConnectionProviderMappings />
<ConnectionSecurityMappings />
<DatabaseStorageLocations />
</Options>
</Configuration>
</Configurations>
<DTSPackages>
<DtsPackage FormatVersion="3">
<Name>TestPackage.dtsx</Name>
<FullPath>TestPackage.dtsx</FullPath>
<References />
</DtsPackage>
</DTSPackages>
</Project>
PostBuildEvent 根本不会触发。 我在这里做错了什么?
I am trying to have a PostBuildEvent in my SSIS project. This is my original .DTProj file from a test project with one test package.
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ProductVersion>10.0.2531.0</ProductVersion>
<SchemaVersion>9.0.1.0</SchemaVersion>
<State>$base64$PFNvdXnRyb2xJbmZvPg==</State>
<Database>
<Name>PreBeforeDeployTest.database</Name>
<FullPath>PreBeforeDeployTest.database</FullPath>
</Database>
<Cubes />
<Dimensions />
<DataSources />
<DataSourceViews />
<MiningModels />
<Roles />
<Miscellaneous />
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<OutputPath>bin</OutputPath>
<ConnectionMappings />
<ConnectionProviderMappings />
<ConnectionSecurityMappings />
<DatabaseStorageLocations />
</Options>
</Configuration>
</Configurations>
<DTSPackages>
<DtsPackage FormatVersion="3">
<Name>TestPackage.dtsx</Name>
<FullPath>TestPackage.dtsx</FullPath>
<References />
</DtsPackage>
</DTSPackages>
</Project>
I have tried inserting <PostBuildEvent> and it looks like this
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PropertyGroup>
<PostBuildEvent>copy "$(TargetDir)TestPackage.dtsx" "C:\"</PostBuildEvent>
</PropertyGroup>
<ProductVersion>10.0.2531.0</ProductVersion>
<SchemaVersion>9.0.1.0</SchemaVersion>
<State>$base64$PFNvdXnRyb2xJbmZvPg==</State>
<Database>
<Name>PreBeforeDeployTest.database</Name>
<FullPath>PreBeforeDeployTest.database</FullPath>
</Database>
<Cubes />
<Dimensions />
<DataSources />
<DataSourceViews />
<MiningModels />
<Roles />
<Miscellaneous />
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<OutputPath>bin</OutputPath>
<ConnectionMappings />
<ConnectionProviderMappings />
<ConnectionSecurityMappings />
<DatabaseStorageLocations />
</Options>
</Configuration>
</Configurations>
<DTSPackages>
<DtsPackage FormatVersion="3">
<Name>TestPackage.dtsx</Name>
<FullPath>TestPackage.dtsx</FullPath>
<References />
</DtsPackage>
</DTSPackages>
</Project>
The PostBuildEvent does not fire at all. What am I doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谁告诉你 .dtproj 支持的? <构建后事件> 基于 MSBUILD 的项目支持,但 .dtproj 具有完全不同的架构,并且根本不知道 PropertyGroup 或 PostBuildEvent 标记。
如果您只想将 .dtsx 文件复制到 c:\,如本示例所示 - 您可以将 OutputPath 更改为 c:\,并且 .dtproj 会将 .dtsx 文件(和配置)复制到 c:\ 而不是 bin\默认使用的目录。
如果您需要更通用的解决方案,我会向解决方案添加一些其他项目(支持),并在那里定义自定义命令。 然后构建整个解决方案,而不是仅构建 .dtproj 项目。
Who told you .dtproj supports <PostBuildEvent>? <PostBuildEvent> is supported by MSBUILD-based projects, but .dtproj has completely different schema, and simply does not know about PropertyGroup or PostBuildEvent tags.
If you just want to copy .dtsx files to c:\, as in this sample - you can change the OutputPath to c:\, and .dtproj will copy the .dtsx files (and configs) to c:\ instead of bin\ directory it used by default.
If you need more general solution, I would add some other project (that does support <PostBuildEvent>) to the solution, and define custom commands there. Then build the whole solution, instead of building just .dtproj project.