Grasshopper

algorithmic modeling for Rhino

Dear all,

I'd really appreciate your help with this problem because I am completely stuck:

I am attempting to read a Json file in my GH component using the code:

openStudioStandards = JsonConvert.DeserializeObject<string>("C:\\Users\\szilasia\\Documents\\Honeybee\\resources\\OpenStudio_Standards.json");

To do so I need to add the reference:

using Newtonsoft.Json, to get the JsonConvert object seen here: http://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonConv...

The code builds successfully in Visual Studio, however as soon as I launch Grasshopper I get the following error seen in the first picture.

Why I am I getting this error I have no idea, the dll for Newtonsoft.Json is in the bin folder with the Grasshopper assembly file. You can see more information here in the reference properties.

Views: 958

Replies to This Discussion

Have you set GrasshopperDeveloper path?

I you hahavn't,you should set one,or copy gha and dll to the Libraries folder.

Thanks Panda, You're awesome!

Using the Developer Settings didn't work but copying the Dll to the library folder did! 

Why does Grasshopper require the dll in the Library folder? 

It's not just Grasshopper that requires the file that is being referenced to be in the root folder of the DLL that is referencing it. It's pretty standard amongst all software. 

Yes, setting the GrasshopperDeveloper path rarely works, but even then its just a temporary fix. You would have to ship that Newtonsoft.Json.dll along with your dlls. 


RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service