Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

File Directory Selector

Solved469 views28th August 2024
3
Yong Ting Lim [SLC] [DevOps Advocate]259 8th July 2024 0 Comments

Hi Dojo,

I am currently working on a download function in IAS.

I am trying to use FolderBrowserDialog from Systems.Windows.Forms to launch a window dialog for users to select the directory path the file should be saved in.

However, I am currently facing this error.

Script Failure (Playout Excel Script): EXIT: “Run|Something went wrong: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
at System.Windows.Forms.CommonDialog.ShowDialog()
at Playout_Excel_Script_1.Script.RunSafe(IEngine engine)
at Playout_Excel_Script_1.Script.Run(IEngine engine)” (see comment for more details)

This is the code that is used:

using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
{
folderBrowserDialog.Description = “Select a folder to save the file”;
folderBrowserDialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
{
// Get the selected path
string selectedFolderPath = folderBrowserDialog.SelectedPath;
engine.GenerateInformation(selectedFolderPath);
}
}

Could anyone assist me on this error message? or is there a better way to allow users to select directory path?

Thanks

Yong Ting Lim [SLC] [DevOps Advocate] Selected answer as best 28th August 2024

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Tom Waterbley [SLC] [DevOps Catalyst]8.89K Posted 8th July 2024 1 Comment

Hi,

FolderBrowserDialog cannot be used in an IAS, since that runs on the server and not on the client itself. Your code would try to open the FolderBrowserDialog on the DataMiner server.

What you could do instead, is using the FileSelector component from the IAS toolkit.

This page describes how to get started with the IAS Toolkit.

Yong Ting Lim [SLC] [DevOps Advocate] Selected answer as best 28th August 2024
Yong Ting Lim [SLC] [DevOps Advocate] commented 8th July 2024

Hi Tom! Thanks for your answer!
Yes, I am using the FileSelector for my uploads. However, it does not work for my downloads as I need to select a directory instead of a file. I might opt for the user to input the directory folder path in a textbox instead.

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs