# How to run rhino compute with token in the C# code?

**URL:** <https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324>\
**Category:** compute.rhino3d\
**Tags:** windows, mac\
**Created:** [February 10, 2025, 5:21pm UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324 "2025-02-10T17:21:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ke1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ke1/32/648516_2.png) [@ke1](https://discourse.mcneel.com/u/ke1)\
**Post date:** [February 10, 2025, 5:21pm UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/1 "2025-02-10T17:21:41Z")

</div>

Hi,

I cloned Rhino Compute repo [GitHub - mcneel/compute.rhino3d: REST geometry server based on RhinoCommon and headless Rhino](https://github.com/mcneel/compute.rhino3d) and tried to run it at my local with rhino token but it can’t load. From the screenshot you can see that the token was set in env variable and loaded properly but it seems rhino component can’t load. Any ideas how to fix?

Thanks

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/e/a/7ea38fac56f823a58b6b83d3769fe797e982a048.png)

---

<div class="post-metadata">

**Author:** ![AndyPayne](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andypayne/32/611612_2.png) [@AndyPayne](https://discourse.mcneel.com/u/AndyPayne)\
**Post date:** [February 10, 2025, 8:59pm UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/2 "2025-02-10T20:59:14Z")

</div>

Do you have Rhino installed on this machine? Are you running this on Windows Server? Or just a regular Windows desktop?

---

<div class="post-metadata">

**Author:** ![ke1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ke1/32/648516_2.png) [@ke1](https://discourse.mcneel.com/u/ke1)\
**Post date:** [February 11, 2025, 5:57am UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/3 "2025-02-11T05:57:29Z")

</div>

Rhino was installed from [https://www.rhino3d.com/www-api/download/direct/?slug=rhino-for-windows/8/latest](https://www.rhino3d.com/www-api/download/direct/?slug=rhino-for-windows/8/latest) on Windows desktop.

I tried it on windows server as well. the same result.

---

<div class="post-metadata">

**Author:** ![AndyPayne](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andypayne/32/611612_2.png) [@AndyPayne](https://discourse.mcneel.com/u/AndyPayne)\
**Post date:** [February 12, 2025, 3:54pm UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/4 "2025-02-12T15:54:48Z")

</div>

When you run the Rhino app on your Windows desktop, does it start normally (or do you get a licensing error)?

---

<div class="post-metadata">

**Author:** ![ke1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ke1/32/648516_2.png) [@ke1](https://discourse.mcneel.com/u/ke1)\
**Post date:** [February 13, 2025, 7:14am UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/5 "2025-02-13T07:14:00Z")

</div>

I always got a license error. RHINO\_TOKEN was properly set in environment variables

 ![image (2)](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/7/7/177861d6d43e3f6586e2dac7e6a6d686a35fbad6.png)

---

<div class="post-metadata">

**Author:** ![AndyPayne](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andypayne/32/611612_2.png) [@AndyPayne](https://discourse.mcneel.com/u/AndyPayne)\
**Post date:** [February 13, 2025, 7:42pm UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/6 "2025-02-13T19:42:06Z")

</div>

Ok. The RHINO\_TOKEN variable is really only used for [core-hour billing](https://developer.rhino3d.com/guides/compute/core-hour-billing/) purposes and that only takes effect when you are running on a machine with Windows Server (ie. Virtual Machine). To run on a desktop, you will need a standard Rhino license. This can be an eval version, or just a standard Rhino license. The reason your Rhino.Compute is failing is because it can’t find a license when it’s trying to load the core Rhino libraries.

---

<div class="post-metadata">

**Author:** ![ke1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ke1/32/648516_2.png) [@ke1](https://discourse.mcneel.com/u/ke1)\
**Post date:** [February 13, 2025, 8:34pm UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/7 "2025-02-13T20:34:22Z")

</div>

it is running on a windows server installed with the build from the installation script. How would rhino use RHINO\_TOKEN on windows server?

---

<div class="post-metadata">

**Author:** ![AndyPayne](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andypayne/32/611612_2.png) [@AndyPayne](https://discourse.mcneel.com/u/AndyPayne)\
**Post date:** [February 13, 2025, 8:53pm UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/8 "2025-02-13T20:53:13Z")

</div>

If you’re running on a Windows Server, then whenever Rhino starts up, it first checks for the environment variable and authenticates it before proceeding. My guess is that you may not have set the environment variable correctly (if Rhino itself is not starting). Follow the steps at the bottom of this [guide](https://developer.rhino3d.com/guides/compute/core-hour-billing/#using-core-hour-billing) to reset the environment variable using the correct auth token.

---

<div class="post-metadata">

**Author:** ![ke1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ke1/32/648516_2.png) [@ke1](https://discourse.mcneel.com/u/ke1)\
**Post date:** [February 14, 2025, 6:01am UTC](https://discourse.mcneel.com/t/how-to-run-rhino-compute-with-token-in-the-c-code/199324/9 "2025-02-14T06:01:17Z")

</div>

Thanks Andy. It’s fixed now by uninstalling everything and ran the first script from the installation page

$F=“/bootstrap\_step-1.zip”;T="(Env:temp)\tmp([convert]::tostring((get-random 65535),16).padleft(4,‘0’)).tmp"; New-Item -ItemType Directory -Path $T; iwr -useb [https://raw.githubusercontent.com/mcneel/compute.rhino3d/8.x/script/production/bootstrap\_step-1.zip](https://raw.githubusercontent.com/mcneel/compute.rhino3d/8.x/script/production/bootstrap_step-1.zip) -outfile $T$F; Expand-Archive $T$F -DestinationPath $T; Remove-Item $T$F;& “$T\bootstrap\_step-1\boostrap\_step-1.ps1”
