moq/labs

Can't install Moq NuGet on UWP

Closed this issue · 2 comments

Hello,

I'm currently having the problem that I can't install Moq in a UWP UnitTestApp project. It is the only project type that can be used to unit test an uwp app.

Moq says on NuGet that it is compatible with .NetStandard 1.3 which should be compatible with UWP when looking at this table: https://docs.microsoft.com/en-us/dotnet/standard/net-standard

I'm getting the following error while Installing the Package:

Restoring packages for UnitTestProject1\project.json...
System.Reflection.Emit.ILGeneration 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0.10586, but there is no run-time assembly compatible with win10-arm-aot.
System.Reflection.Emit.ILGeneration 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0.10586, but there is no run-time assembly compatible with win10-x64-aot.
System.Reflection.Emit.ILGeneration 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0.10586, but there is no run-time assembly compatible with win10-x86-aot.
Package restore failed. Rolling back package changes for 'UnitTestProject1'.
Time Elapsed: 00:00:01.3615812
========== Finished ==========

When I try to install the package System.Reflection.Emit.ILGeneration on its own I get the same error.

Greetings
Gary

kzu commented

@stakx this sounds like a legitimate issue. Once that will ultimately be solved by moq v5, but I'm not sure there's much v4 can do about it...

Also, might be worth moving to https://github.com/moq/moq4/issues