2009-08-10 16 views
0

Ich versuche, ein PostBuildEvent in meinem SSIS-Projekt zu haben. Dies ist meine ursprüngliche .DTProj-Datei aus einem Testprojekt mit einem Testpaket.Post-Build in SSIS-Projekt

<?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> 

Ich habe versucht, das Einfügen <Postbuildevent> und es sieht aus wie diese

<?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> 

Das Postbuildevent überhaupt nicht schießen. Was mache ich hier falsch?

Antwort

1

Wer hat dir gesagt .dtproj <Postbuildevent> unterstützt? <PostBuildEvent> wird von MSBUILD-basierten Projekten unterstützt, aber .dtproj hat ein völlig anderes Schema und weiß einfach nichts über PropertyGroup- oder PostBuildEvent-Tags.

Wenn Sie nur .dtsx-Dateien nach c: \ kopieren möchten, wie in diesem Beispiel - Sie können den OutputPath in c: \ ändern, und .dtproj kopiert die .dtsx-Dateien (und -Konfigurationen) nach c: \ anstelle von bin \ directory hat es standardmäßig verwendet.

Wenn Sie eine allgemeinere Lösung benötigen, würde ich ein anderes Projekt (das <PostBuildEvent> unterstützt) zur Lösung hinzufügen und dort benutzerdefinierte Befehle definieren. Erstellen Sie dann die gesamte Lösung, anstatt nur ein .dtproj-Projekt zu erstellen.

+1

@Michael: Können Sie mich auf eine Probe zeigen, wo ich das lernen kann? Ich kann das Kopierverhalten in meiner Umgebung nicht reproduzieren. –

Verwandte Themen