mcneel / rhino.inside

Sample Projects for Rhino.Inside
MIT License
382 stars 169 forks source link

RhinoLibrary loading #248

Closed corbane closed 4 years ago

corbane commented 4 years ago

Hello,

It's a bit catastrophic, the examples don't work. suddenly it does not explain much.

They will search on NuGet, RhinoCommon.dll, Grasshopper.dll, ... and even RhinoInside. Is that normal ?

In the file DotNet/RhinoInside/Resolver.cs, line 39 double.TryParse(children[i], out double d) fails depending on the country. use for example double.TryParse("7.0", NumberStyles.Any, CultureInfo.InvariantCulture , out double b)

I only managed to make it work DotNet/WinFormsApp, the others fail, often due to RhinoLibrary loading which applications cannot find.

why RhinoInside.dll is not directly in Rhino's directory ? (C:\Program Files\Rhino 7 WIP)

sbaer commented 4 years ago

Please report a single issue at a time. I'm going to assume this issue is to tune up double.TryParse in the resolver to work with InvariantCulture.

If there is a different issue that you would like me to address, please create a new github issue. Thanks 👍

corbane commented 4 years ago

Not really,

The issue is rather a request: "Simplify loading of RhinoLibrary and RhinoCore"

Depending on the country or the installation AppDomain.CurrentDomain.AssemblyResolve += ... fail

corbane commented 4 years ago

You are right, The problem is mainly double.TryParse The page https://github.com/mcneel/Rhino.Inside-Workshop/wiki/Sample-1 allowed me to understand that I have to change the RhinoInside of NuGet by a modified version for my system on each project.

so i replace the line https://github.com/mcneel/rhino.inside/blob/master/DotNet/RhinoInside/Resolver.cs#L39 by

if(children[i][0] == '7' && children[i][1] == '.')
sbaer commented 4 years ago

I'm reopening this as we just need to fix a TryParse and publish new nuget packages for Rhino.Inside