Friday, February 24, 2012

debugging script task

Hi,

I'm trying to debug a Script Task. I set a breakpoint then start debug. I always get a COM Exception error:

unhandled exception occurred in DTAttach.exe[3332]

File position not valid for new breakpoint

Can someone suggest me something?

Thanks

I have found this workaround

If you assign the result of an expression to a DTSVariable, I always get an error. If you assign the result to a varaible and then assign this variable to a dtsVariable all is fine.

e.g.

Dts.Variables("bFTPIsEmpty").Value = IIf(fs.GetFiles("*.*").Length = 0, True, False) --> ERROR

THIS WORKS FINE

IsEmpty = CBool(IIf(fs.GetFiles("*.*").Length = 0, True, False))

Dts.Variables("bFTPIsEmpty").Value = IsEmpty

|||

Was facing the same issue even after trying all of the above.

Have found workaround for this annoying problem

Everytime you get this error, right click on the problematic project in solution explorer and select 'clean' and then select 'rebuild'

Debugging should then work ok.

ta

arun

|||

I've tried both workarounds and nothing! I have not variables assignments so that it's not the issue for sure! I get this error after I choose debugger: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.SqlServer.ScriptTask.dll. Additional information: File position not valid for new breakpoint. Then I select to continue and the process ends correctly...

Just later I found that by commenting out this two declarations I had but not using, the problem went away!

Imports System.Xml

Imports System.Xml.XmlDataDocument

No comments:

Post a Comment