Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhino.inside/dotnet/SampleUnitTests does not work #82

Open
mennodeij opened this issue Mar 20, 2023 · 3 comments
Open

rhino.inside/dotnet/SampleUnitTests does not work #82

mennodeij opened this issue Mar 20, 2023 · 3 comments

Comments

@mennodeij
Copy link

I have cloned rhino developer samples inside visual studio 2019 (16.11.3) starting from the opening dialog to clone a project.
Then opened the Rhino.Inside SampleUnitTests & built it, without making any changes (even though the readme.txt suggests to make changes, all these were already done or set correctly).

When I use the Visual Studio built-in unit test running facilities, I first get an error that Grasshopper.dll is not found. I see that all the NuGet packages (rhino.inside, rhinowindows, grasshopper, rhinocommon) are installed in the %USER%.nuget\packages directory, but the dependent DLL's are not copied over to the directory where the unit test runner can find them. So, I copied over all dependent DLLs from nuget packages into the build output directory. Then I get a different error (see below), and I am stuck trying to solve this.

I was hoping to just clone, build and run the unit tests project without any hassle.

System.DllNotFoundException
Unable to load DLL 'RhinoLibrary': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Rhino.Runtime.InProcess.RhinoCore.InternalStartup(Int32 argc, String[] argv, StartupInfo& info, IntPtr hostWnd)
   at Rhino.Runtime.InProcess.RhinoCore..ctor(String[] args, WindowStyle windowStyle, IntPtr hostWnd)
   at Rhino.Test.GrasshopperSingleton.InitializeCore() in D:\zandbak\rhino-developer-samples\rhino.inside\dotnet\SampleUnitTests\GrasshopperTests\GrasshopperFixture.cs:line 148
   at Rhino.Test.GrasshopperSingleton..ctor() in D:\zandbak\rhino-developer-samples\rhino.inside\dotnet\SampleUnitTests\GrasshopperTests\GrasshopperFixture.cs:line 117
   at Rhino.Test.GrasshopperSingleton.get_Instance() in D:\zandbak\rhino-developer-samples\rhino.inside\dotnet\SampleUnitTests\GrasshopperTests\GrasshopperFixture.cs:line 90
   at Rhino.Test.GHFileFixture..ctor(String filePath) in D:\zandbak\rhino-developer-samples\rhino.inside\dotnet\SampleUnitTests\GrasshopperTests\GrasshopperFixture.cs:line 24
   at SampleGHTests.PrimitivesFixture..ctor() in D:\zandbak\rhino-developer-samples\rhino.inside\dotnet\SampleUnitTests\GrasshopperTests\TestPrimitives.cs:line 17
@mennodeij
Copy link
Author

The rhino.inside/dotnet/Convert sample does work for me, so there is nothing wrong with the setup AFAICS 🙂

@mennodeij
Copy link
Author

Hmm.. after running the Convert sample, I rebuilt the UnitTests sample and now it works.
Is it possible that Rhino.Inside needs to run at least once prior to using it in the unit tests? Otherwise, this can be filed & closed as unreproducible.

@mennodeij
Copy link
Author

Might even be an xUnit issue - when I select menu Test > Run all tests, the tests work. When I run a specific test by clicking its icon next to the code, it doesn't work. I may have mixed these two methods willy nilly, expecting them to do the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant