Grasshopper

algorithmic modeling for Rhino

I am building a GH plug in that uses a custom WPF interface that I've compiled as an exe. When referencing it in to a C# scripting component, it works fine as long as I also include a series of other .dlls it depends on. When I try to build a GH plug-in that references the same .exe, it produces the following errors on load:

Object: LaunchWindow_Component (level 1)
{
Exception has been thrown by the target of an invocation.
TargetInvocationException
}

Object: LaunchWindow_Component (level 2)
{
Could not load file or assembly 'WPFApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
FileNotFoundException
}

I am setting the gha project to "copy local" the exe and its associated dll dependencies, and copying them into the GH libraries folder. I have tried launching GH both with and without COFF loading enabled, but these errors persist. 

The exe and GH component both are compiled against .NET 4.0. Any thoughts as to what the difference between an assembly reference in a scripting component and a gha might be? Any thoughts on how to solve? 

Views: 493

Replies to This Discussion

Hi Andrew,

Not sure if this will help, but you could try appending the dll locations to the user or system path. I've had some similar issues when referencing 3rd party dlls from a Rhino plugin vs. from the VS debugger.

Thanks for the suggestion Daniel... I think I figured it out. I think it WAS ultimately a COFF loading issue - it had to be disabled for the EXE reference to work. I thought I had successfully done this but apparently I hadn't. 

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