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

moq is not compatible with System.Threading.Tasks.Extensions 4.5.3 or 4.5.4 #1107

Closed
alejandromoncayo opened this issue Nov 24, 2020 · 3 comments
Milestone

Comments

@alejandromoncayo
Copy link

Nuget gallery dependency states it should be compatible:
https://www.nuget.org/packages/Moq/4.15.1
"System.Threading.Tasks.Extensions (>= 4.5.1)"

But on a project with System.Threading.Tasks.Extensions 4.5.3 or 4.5.4 it fails with the following error:
Message:
Initialization method Trizetto.Cap.Application.Tests.Cache.CacheServiceTests.Setup threw exception. System.TypeInitializationException: The type initializer for 'Moq.DefaultValueProvider' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified..
Stack Trace:
LookupOrFallbackDefaultValueProvider.ctor()
EmptyDefaultValueProvider.ctor()
DefaultValueProvider.cctor()
--- End of inner exception stack trace ---
DefaultValueProvider.get_Empty()
Mock1.ctor(MockBehavior behavior, Object[] args) Mock1.ctor(MockBehavior behavior)
Mock`1.ctor()
CacheServiceTests.Setup() line 21

using the powershell, I can see that from 4.5.0 to 4.5.2 the "version" was 4.2.0.0, but on 4.5.3 it was changed to 4.2.0.1 as displayed by the following powershell script:
Write-Output "4.5.0"
([system.reflection.assembly]::loadfile("C:\Users\admin.nuget\packages\system.threading.tasks.extensions\4.5.0\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll")).FullName
Write-Output "4.5.1"
([system.reflection.assembly]::loadfile("C:\Users\admin.nuget\packages\system.threading.tasks.extensions\4.5.1\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll")).FullName
Write-Output "4.5.2"
([system.reflection.assembly]::loadfile("C:\Users\admin.nuget\packages\system.threading.tasks.extensions\4.5.2\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll")).FullName
write-output "4.5.3"
([system.reflection.assembly]::loadfile("C:\Users\admin.nuget\packages\system.threading.tasks.extensions\4.5.3\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll")).FullName
write-output "4.5.4"
([system.reflection.assembly]::loadfile("C:\Users\admin.nuget\packages\system.threading.tasks.extensions\4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll")).FullName

with the output:
4.5.0
System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
4.5.1
System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
4.5.2
System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
4.5.3
System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
4.5.4
System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

@stakx
Copy link
Contributor

stakx commented Nov 25, 2020

Seems like they'll never learn to leave the bloody assembly version alone. 😠

@alejandromoncayo have you by any chance looked at older versions of that assembly? I'm curious whether the version has been steadily increasing or whether there were instances where they went back / reset to a all-zeroes assembly version after increasing the build number like here.

Because if increasing the build number was by mistake, and they released another version where they go back to 4.2.0.0, we'd better just wait than change our dependency.

@alejandromoncayo
Copy link
Author

Seems they decided to make this change permanent , as I see all versions from 4.5.0 to 4.5.2 had the same 4.2.0.0, but both 4.5.3 and 4.5.4 have 4.2.0.1.
The 4.5.3 change was on July 8, 2019.. so it seems they are sticking to the new format.

@stakx
Copy link
Contributor

stakx commented Nov 25, 2020

Resolved by #1108.

@stakx stakx closed this as completed Nov 25, 2020
@stakx stakx added this to the 4.15.2 milestone Nov 25, 2020
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

2 participants