# Problem with FolderBrowserDialog

**URL:** <https://www.ruby-forum.com/t/problem-with-folderbrowserdialog/181106>\
**Category:** IronRuby\
**Created:** [January 5, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/problem-with-folderbrowserdialog/181106 "2010-01-05T17:07:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rambor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9de053/32.png) [@rambor](https://www.ruby-forum.com/u/rambor)\
**Post date:** [January 5, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/problem-with-folderbrowserdialog/181106/1 "2010-01-05T17:07:56Z")

</div>

Hello,

I have an interesting problem that I canÂ¹t work out.

I have a GUI app that uses FolderBrowserDialog. It works fine when I run  
it  
from the command line with ir.

When I embed IronRuby in an app, the browse window comes up, the ok,  
cancel,  
and make new folder buttons are there, but the actual browse  
functionality  
is missing. ItÂ¹s just blank where the browse bit should be. This is how  
IÂ¹ve  
called IronRuby from the app:

ScriptRuntime irruntime = IronRuby.Ruby.CreateRuntime();

```
        ScriptEngine ir = IronRuby.Ruby.GetEngine(irruntime);

        ScriptScope scope = ir.CreateScope();

        ScriptSource script = ir.CreateScriptSourceFromFile(script);

        script.Execute(scope);
```

---

<div class="post-metadata">

**Author:** ![rambor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9de053/32.png) [@rambor](https://www.ruby-forum.com/u/rambor)\
**Post date:** [January 5, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/problem-with-folderbrowserdialog/181106/2 "2010-01-05T17:31:56Z")

</div>

I seem to recall that the actual folder brower is implemented via COM,  
and that you probably need an [STAThread] attribute on your Main method.

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Robert R.  
Sent: Tuesday, January 05, 2010 8:01 AM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] Problem with FolderBrowserDialog

Hello,

I have an interesting problem that I can’t work out.

I have a GUI app that uses FolderBrowserDialog. It works fine when I run  
it from the command line with ir.

When I embed IronRuby in an app, the browse window comes up, the ok,  
cancel, and make new folder buttons are there, but the actual browse  
functionality is missing. It’s just blank where the browse bit should  
be. This is how I’ve called IronRuby from the app:

ScriptRuntime irruntime = IronRuby.Ruby.CreateRuntime();

```
        ScriptEngine ir = IronRuby.Ruby.GetEngine(irruntime);

        ScriptScope scope = ir.CreateScope();

        ScriptSource script = ir.CreateScriptSourceFromFile(script);

        script.Execute(scope);

```

---

<div class="post-metadata">

**Author:** ![rambor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9de053/32.png) [@rambor](https://www.ruby-forum.com/u/rambor)\
**Post date:** [January 5, 2010, 5:54pm UTC](https://www.ruby-forum.com/t/problem-with-folderbrowserdialog/181106/3 "2010-01-05T17:54:46Z")

</div>

That was it. It works now.
