Jump to content

Issue with CustomDataSource

Didier Bastogne

Recommended Posts


I do have a custom c# plugin which was developped (and is working fine with Spotfire Analyst 7.11) but today I started the migration to Spotfire Analyst 10.10 and I do get a weird issue.

using the CustomDataSource in a CustomTool it works fine but when I use the same CustomDatasource via the Data/Add Data menu and choose my CustomDataSource I get this error after the prompt Dialog has been closed

InvalidOperationException at Spotfire.Dxp.Framework:

Attempt to perform an operation on an incorrect thread. Use ApplicationThread.Invoke() to invoke into the application thread. (HRESULT: 80131509)

Stack Trace:

at Spotfire.Dxp.Framework.ApplicationModel.ApplicationThread.ThrowNotOnApplicationThread()

at Spotfire.Dxp.Framework.ApplicationModel.DedicatedThreadAccessible.ValidateOnApplicationThread()

at Spotfire_KD4DM.DataSource.ConnectCore(IServiceProvider serviceProvider, DataSourcePromptMode promptMode) in C:......DataSource.cs:line 139

at Spotfire.Dxp.Data.DataSource.ConnectWithoutPrompting(IServiceProvider serviceProvider, DataSourcePromptMode promptMode, Boolean updateInternalState, DataLoadSettings loadSettings)

the error is raise at this line, in the connectCore method

protected override Spotfire.Dxp.Data.DataSourceConnection ConnectCore(IServiceProvider serviceProvider, DataSourcePromptMode promptMode)


// Retrieve the prompt service.

PromptService promptService = this.GetService(serviceProvider);


looking at the examples in the SDK or docmentation does not provide any help as it's exactly the same code everywhere..


Edit: since 10.10 there is a new property for CustomDataSources:AlwaysLoadOnApplicationThread. the default value is false but is causing issues in my case so I added this code to set it to true

/// Gets a value indicating whether this data source always should be loaded on the application thread.


protected override bool AlwaysLoadOnApplicationThread




return true;



Link to comment
Share on other sites

Since its seems to perform some operation that needs to be performed on the applicaiton thered.


Could you set theAlwaysLoadOnApplicationThread to true in your code. It should work.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...