Timeline for Asynchronous creation of FeatureClass with BackgroundWorker failed
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 19, 2018 at 16:33 | comment | added | Kirk Kuykendall | Search for "threads in isolation" for more info. | |
Oct 19, 2018 at 0:10 | comment | added | Michael Stimson | If you are using ArcGIS desktop objects then yes, your problem is because of the background worker. ArcGIS is a single thread application, the objects are not thread safe. This does not mean you can't use multiple threads just that you can't pass objects over the thread boundaries... instead of BackgroundWorker use system.threading.thread with ApartmentState of STA, create a new instance as @KirkKuykendall indicates then only pass non-Esri objects over the threads; there are some exceptions to this rule, but that's another topic in itself born of a thousand facepalm moments! | |
Oct 15, 2018 at 14:40 | comment | added | danielm | But I want to know if the issue is related to specifically the BackgroundWorker thread or any alternative thread, this helps get to the root of your issue. Furthermore, any new thread in which you are using ArcObjects should be an STA thread, which BackgroundWorker does not support. | |
Oct 15, 2018 at 1:30 | history | edited | Feng Ma | CC BY-SA 4.0 |
edited body
|
Oct 15, 2018 at 1:22 | comment | added | Feng Ma | I want to create a shapefile with BackgroundWorker | |
Oct 12, 2018 at 19:36 | comment | added | danielm | What is the result if, instead of making a BackgroundWorker, you just created and started a new Thread? Be sure to set the ApartmentState to STA. | |
Oct 12, 2018 at 14:31 | comment | added | Kirk Kuykendall | Did you try using Activator.CreateInstance for your workspacefactory? resources.esri.com/help/9.3/ArcGISengine/dotnet/… | |
Oct 12, 2018 at 12:37 | history | edited | Kadir Şahbaz | CC BY-SA 4.0 |
improved formatting, added language hint
|
Oct 12, 2018 at 8:55 | history | asked | Feng Ma | CC BY-SA 4.0 |