Friday, March 30, 2012

'Log' is not a member of 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel'.

I have been developing a large SSIS project and it uses scripts extensively.

During development, i encountered no problems.

However, when i tried executing them on a server (windows server 2003), i was given this error for all the scripts:

Here is a brief log:

PackageStart,servername,network\login,PkgName,{A6778813-1F3A-4133-A00C-6F02AC8CC8B1},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:26 PM,3/10/2006 5:24:26 PM,0,0x,Beginning of package execution.

OnError,servername,network\login,PkgName,Rename Error Files,{8d38e1b7-44e8-419e-963e-c689edd0be2c},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:30 PM,3/10/2006 5:24:30 PM,7,0x,Error 30456: 'Variables' is not a member of 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel'.
Line 26 Columns 51-63
Line Text: Dim DaysToKeepErrorFile As Integer = CInt(Dts.Variables("vDaysToKeepErrorFiles").Value.ToString)

OnError,servername,network\login,PkgName,Rename Error Files,{8d38e1b7-44e8-419e-963e-c689edd0be2c},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:30 PM,3/10/2006 5:24:30 PM,7,0x,Error 30456: 'Log' is not a member of 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel'.
Line 49 Columns 25-31
Line Text: Dts.Log(MaintenanceMsg, 0, ZeroByte)

OnError,servername,network\login,PkgName,Rename Error Files,{8d38e1b7-44e8-419e-963e-c689edd0be2c},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:30 PM,3/10/2006 5:24:30 PM,7,0x,Error 30456: 'Log' is not a member of 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel'.
Line 55 Columns 17-23
Line Text: Dts.Log("Script Error:" + ex.Message, 0, ZeroByte)

OnError,servername,network\login,PkgName,Rename Error Files,{8d38e1b7-44e8-419e-963e-c689edd0be2c},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:30 PM,3/10/2006 5:24:30 PM,5,0x,The script files failed to load.
PackageEnd,servername,network\login,PkgName,{A6778813-1F3A-4133-A00C-6F02AC8CC8B1},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:30 PM,3/10/2006 5:24:30 PM,1,0x,End of package execution.

I've been using the same scripts for months in development and testing. Both dev and test server has SQL 2005 and SSIS installed.

What causes this?

Seems very strange, as obvious Log is a method of the ScriptObjectModel class.

Can you logon to the server anbd built a test package on the server and try running it there an then in BIDS, obviously using a script task a Log.

Has this ever worked on the problem server, or is it a recent failure? Are the good and bad machines running the same service pack? I am not clear on what machines work and fail and if failures relate to some or all machines.

|||

If you find it strange, imagine me! haha...

Do i need VS2005 installed on the server to open the VBA window to edit the script? I got this error when trying :

--

Cannot show the editor for this task.

ADDITIONAL INFORMATION:

The operation could not be completed. (Microsoft.VisualBasic.Vsa.DT)

1. I've checked the assembly versions of Microsoft.SqlServer.ManagedDTS.dll and microsoft.sqlserver.scripttask.dll on the server and my machine, they're the same. 9.0.242.0

2. This is the first time we're trying to deploy on the server. It has worked fine on four other machines : 2 desktops and 2 laptops.

3. The server is running SP1 the good machines aren't. I figured this shouldn't be a problem as SP1 should be 'backward compatible'. I'll try to get SP1 on the good machines just to eliminate the problem, but it'll take some time, which i don't have.

Any other ideas?

|||

Things have gotten more interesting.

My package has multiple scripts and i discovered that some work, and some dont!

What makes it interesting is that each of these scripts are identitical (i copied and pasted the original script i wrote), except for name and variable values.

If the script's content is identical, and both use dts.log and dts.variables object, why is it that one works and one doesnt?

What on earth could be causing this?

Another question:

where is the reference 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel' referenced from? its not part of the references i see in the VSA ide but i see it in the package xml. I couldn't find it in the windows\assembly folder either. Anybody knows ANYTHING about this issue?

|||

Well, i've got it solved.

I copied a working script, deleted the bad ones and pasted them in again. I think the important step is after pasting the copied script task, i opened the script in the editor and closed it. Somehow, this seemed to work. Although it still doesn't solve the mystery of why it worked on some machines but failed on others. The only difference is the server was running Windows Server 2003 and the development was winxp.

So to anyone whos reusing scripts, i suggest opening the 'design script' window and closing it after pasting, just to be safe and make sure SSIS precompiles everything properly.

No comments:

Post a Comment