moq / labs

The most popular and friendly mocking framework for .NET
MIT License
705 stars 75 forks source link

Failing to build on main #78

Open tom-mckeown-opencast opened 2 years ago

tom-mckeown-opencast commented 2 years ago

Cloning the repo and trying to build results in an error and multiple warnings:

warning NU1603: Moq.Sdk depends on Avatar (>= 42.42.42-main.434) but Avatar 42.42.42-main.434 was not found. An approximate best match of Avatar 42.42.42-main.492 was resolved.
error AV001: The current compiler uses Roslyn version 4.1.0 which is not supported yet. Please install package Microsoft.Net.Compilers.Toolset version 3.9.0 to get the latest supported compiler, or set 'EnableCompileTimeAvatars=false' in the project to switch to run-time avatars.

The warnings can be cleared up by changing the AvatarVersion in Directory.Packages.props to match the found version (42.42.42-main.492) and the initial error can be cleared by adding a reference to Microsoft.Net.Compilers.Toolset specifying the latest supported version (3.9.0).

Trying to build after fixing the initial problems results in errors with seemingly every class that implements IAvatarBehavior

error CS0246: The type or namespace name 'GetNextBehavior' could not be found (are you missing a using directive or an assembly reference?)
error CS0535: 'MockRecordingBehavior' does not implement interface member 'IAvatarBehavior.Execute(IMethodInvocation, ExecuteHandler)'

The GetNextBehavior delegate doesn't exist in this codebase, the closest I found was GetNextMockBehavior which has an additional IMock parameter which means the delegate doesn't match the ExecuteHandler for the interface.

Our open source team @opencastsoftware would like to contribute if possible but not sure where to go from here. If we can help in getting this fixed please let us know

kzu commented 1 year ago

Hi there! Thanks for your interest in contributing. The project is a bit in flux right now, will ping this thread when it's ready for taking contributions. Thanks for your patience!