# Detect if Grasshopper Instance is RhinoCompute or not

**URL:** <https://discourse.mcneel.com/t/detect-if-grasshopper-instance-is-rhinocompute-or-not/143316>\
**Category:** Scripting\
**Tags:** windows, csharp\
**Created:** [June 1, 2022, 3:42am UTC](https://discourse.mcneel.com/t/detect-if-grasshopper-instance-is-rhinocompute-or-not/143316 "2022-06-01T03:42:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Breau1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matthew_breau1/32/614927_2.png) [@Matthew\_Breau1](https://discourse.mcneel.com/u/Matthew_Breau1)\
**Post date:** [June 1, 2022, 3:42am UTC](https://discourse.mcneel.com/t/detect-if-grasshopper-instance-is-rhinocompute-or-not/143316/1 "2022-06-01T03:42:54Z")

</div>

I’m working on a plugin that writes out a file as it is loaded during Grasshopper initial boot up (via a “PriorityLoad()” method). However, I noticed that on some computers, it writes two files!

After a lot of debugging, I traced this to Hops, specifically the “Launch Local Rhino Compute” option that Hops adds to the “Preferences” ➡ “Solver” menu. It seems like a second copy of Grasshopper launches in the background, which includes loading the plugin and therefore writing a second file.

 ![Hops boot option](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/2/1/921ddc190a7f3d1d7bf834879b2952f601484304.png)

So my question is… Is there any way to detect whether the current Grasshopper context is being related within a Rhino Compute instance?

---

<div class="post-metadata">

**Author:** ![Matthew\_Breau1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matthew_breau1/32/614927_2.png) [@Matthew\_Breau1](https://discourse.mcneel.com/u/Matthew_Breau1)\
**Post date:** [June 1, 2022, 4:29am UTC](https://discourse.mcneel.com/t/detect-if-grasshopper-instance-is-rhinocompute-or-not/143316/2 "2022-06-01T04:29:24Z")

</div>

I actually solved it, leaving this here for others:

This code

```auto
Rhino.Runtime.HostUtils.RunningAsRhinoInside;
Rhino.Runtime.HostUtils.RunningInRhino; 
string processName = "";
System.Version processVersion;
Rhino.Runtime.HostUtils.GetCurrentProcessInfo(out processName, out processVersion);

```

Will result in these values for the “real” Grasshopper load:

```auto
  "RunningAsRhinoInside": false,
  "RunningInRhino": true,
  "ProcessName": "Rhino",
  "ProcessVersion": "7.18.22124.3001"

```

But results in this for the “Rhino Compute” Grasshopper load:

```auto
  "RunningAsRhinoInside": true,
  "RunningInRhino": true,
  "ProcessName": "compute.geometry",
  "ProcessVersion": "1.0.0.0"

```
