2016-04-03 10 views
1

zu lösen, wenn ich SSIS-Paket leite diesen Fehler:Wie „mongodb.driver“ Fehler in SSIS-Paket

Skriptkomponente eine Ausnahme in Benutzercode gestoßen: Projektname: SC_76bc556b4d8343218e4abc8e9ea1e53 Datei kann nicht geladen werden oder Assembly 'Mongo.Driver' version = 1.8.3.9, culture = neutral, PublicKeyToken = f686731cfb9cc103 'oder eine seiner Abhängigkeiten Das System kann die angegebene Datei nicht finden.

jedoch folgte ich diesen Artikel Paket zu erstellen: https://rajendersehgal.wordpress.com/2015/07/14/data-migration-between-mssql-nosql/

I Fenster sind mit 10 und platziert Mongodb.driver.dll, MongoDB. Bson.dll im Assembly-Ordner und fügte dann Referenz hinzu, indem beide Dateien im Framework durchsucht wurden.

Jeder Rat ist nennenswert!

Antwort

1

zu lösen, dass Sie setzen müssen Mongo Treiber in GAC-Repository, see reference (Sie können andere Probleme auftreten, wie vielleicht Voraussetzung für eine starke Signatur dort)

First, download and install the C# driver. This next step is important, as there was a change that occurred with version 1.5 of the driver: the DLLs are no longer installed in the GAC (Global Assembly Cache) automatically. They must be there, however, for SSIS to be able to use them.

By default, my drivers were installed to C:\Program Files (x86)\MongoDB\CSharpDriver 1.7. You’ll want to open a CMD window in Administrator mode, and navigate to this folder. Next you’ll need GACUTIL, on my computer I found the most recent version at:

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\

A simple trick to find yours: Since you are already in the CMD window, just move to the C:\Program Files (x86) folder, and do a “dir /s gacutil.exe”. It will list all occurrences of the program, just use the one with the most recent date. Register the dlls by entering these commands:

“C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil” /i MongDB.Bson.dll

“C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil” /i MongDB.Driver.dll

Note the “ quote marks around the path are important for the CMD window to correctly separate the gacutil program from the parameters.

Once that is done, create a new SQL Server Integration Services project in SQL Server Data Tools (SSDT), what used to be called BIDS in SQL Server 2008R2 (and previous). Put a Data Flow Task on the Control Flow design surface. Then open the Data Flow Task for editing.

Next, drag and drop a Script Component transformation onto the Data Flow design surface. When prompted, change the component type to Source.