Generator plugin is unable to find NUnit. #806
Replies: 1 comment
-
|
The generator plugins run during the build process at a time when the runtime dependencies might not be available. Therefore the easiest approach is if your generator plugin does not depend on NUnit, just adds the necessary attributes as strings, like we do in the core nunit generator: https://github.com/reqnroll/Reqnroll/blob/main/Reqnroll.Generator/UnitTestProvider/NUnit3TestGeneratorProvider.cs#L13 You can have dependencies (even to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!
Currently iam working on some plugins. One of them is a generator plugin for making a custom NUnit Attribute.
I followed the steps from https://docs.reqnroll.net/latest/extend/plugins.html#generator-plugins but when i try to
dotnet buildthe test project i get the following error:Generation error: Message: Could not load file or assembly 'nunit.framework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb'. The system cannot find the file specified.Nunit is referenced in in the bin folder of both the Test-Project aswell as the Library. Both have the same version.
My setup is the following:
I have a Solution containing 3 Projects:
The Testproject,
the NUnitAttribute Library
and the GeneratorPlugin
The Generator Plugin has a reference to the NUnitAttribute project and the test project has a reference of the GeneratorPlugin project with the
ReqnrollGeneratorPluginspointed at the dll in the bin folder of the GeneratorPlugin project.Using the Visual studio build works. But using the 'dotnet build' command does not work.
In the documentation it states: "If your plugin uses third party assemblies, you need to make sure that the dependencies can be found." and i think this is probably the problem case but all 3 cases are valid for my project ( or atleast i think so)
If something is not clear please ask!
Any help is welcome!
Beta Was this translation helpful? Give feedback.
All reactions