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

unable to mock in unittesting on windows app? #79

Closed
Charlemagne65 opened this issue Dec 20, 2013 · 4 comments
Closed

unable to mock in unittesting on windows app? #79

Charlemagne65 opened this issue Dec 20, 2013 · 4 comments

Comments

@Charlemagne65
Copy link

Install-Package : Could not install package 'Moq 4.2.1312.1622'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5.1', but the package does not contain any assembly references or content file
s that are compatible with that framework. For more information, contact the package author.
At line:1 char:1

  • Install-Package Moq
  • - CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    - FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
    
    

I would like using moq in a Windows Store App. But this is the message I get from the NUGet PM.

What is going wrong?

@Charlemagne65
Copy link
Author

Sorry this was my command to the NUGet console:

PM> Install-Package Moq

Installing 'Moq 4.2.1312.1622'.
Successfully installed 'Moq 4.2.1312.1622'.
Adding 'Moq 4.2.1312.1622' to Generator.
Uninstalling 'Moq 4.2.1312.1622'.
Successfully uninstalled 'Moq 4.2.1312.1622'.
Install failed. Rolling back...

@kzu
Copy link
Member

kzu commented Dec 20, 2013

Windows Store apps do not support dynamic code emitting (which is what Moq and all other dynamic proxy-based frameworks use), as noted in MSDN: http://msdn.microsoft.com/en-US/library/windows/apps/hh441595(v=vs.110).aspx

So Moq4 cannot support this platform.

@kzu kzu closed this as completed Dec 20, 2013
@Charlemagne65
Copy link
Author

Ok,

what are my alternatives besides writing my mocking classes manually?

@stakx
Copy link
Contributor

stakx commented Dec 29, 2017

@Chakotay - this issue is super old, but just for the record, Moq 5 will likely support this scenario.

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

3 participants