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 breaks ASP.NET Core xUnit.net project for Core 1.0 Web API application #284

Closed
gerryLowry opened this issue Sep 7, 2016 · 6 comments

Comments

@gerryLowry
Copy link

moq does not seem to be happy with “Microsoft.NETCore.App”.

EXAMPLE CODE:
.zip https://github.com/gerryLowry/RawCoreAPIxUnit
~ .zip https://github.com/gerryLowry/EF_Core_testing_experiments

BEFORE adding moq from
Source: https://www.myget.org/F/aspnet-contrib/api/v3/index.json

 {
 “version”: “1.0.0-*”,
 “testRunner”: “xunit”,
 “dependencies”: {
  “xunit”: “2.2.0-beta2-build3300”,
   “RawCoreAPIxUnit”: “1.0.0-*”,
   “dotnet-test-xunit”: “2.2.0-preview2-build1029”
  },
 “frameworks”: {
 “netcoreapp1.0”: {
 “dependencies”: {
 “Microsoft.NETCore.App”: {
 “type”: “platform”,
 “version”: “1.0.0”
 }
 }
 }
 }
 }

added “moq.netcore”: “4.4.0-beta8”,

RESULT:

Retrieving package ‘moq.netcore 4.4.0-beta8’ from ‘asp-net contrib’.

GET https://myget-2e16.kxcdn.com/artifacts/aspnet-contrib/nuget/v3/flatcontainer/moq.netcore/4.4.0-beta8/moq.netcore.4.4.0-beta8.nupkg

OK https://myget-2e16.kxcdn.com/artifacts/aspnet-contrib/nuget/v3/flatcontainer/moq.netcore/4.4.0-beta8/moq.netcore.4.4.0-beta8.nupkg 1117ms

Installing moq.netcore 4.4.0-beta8.

Installing NuGet package moq.netcore.4.4.0-beta8.

Successfully installed ‘moq.netcore 4.4.0-beta8’ to RawCoreAPIxUnit.Tests
Executing nuget actions took 2.45 sec
========== Finished ==========

Time Elapsed: 00:00:10.1729156

PATH=.\node_modules.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Program Files\dotnet\dotnet.exe restore “C:_vs2015_default\Projects\RawCoreAPIxUnit.vs\restore.dg”
log : Restoring packages for C:_vs2015_default\Projects\RawCoreAPIxUnit\src\RawCoreAPIxUnit.Tests\project.json…

*error: Package moq.netcore 4.4.0-beta8 is not compatible with netcoreapp1.0 *

(.NETCoreApp,Version=v1.0). Package moq.netcore 4.4.0-beta8 supports:

error: – dotnet (.NETPlatform,Version=v5.0)
error: – net35 (.NETFramework,Version=v3.5)
error: – net40 (.NETFramework,Version=v4.0)
error: – sl5 (Silverlight,Version=v5.0)
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.

log : Writing lock file to disk. Path: C:_vs2015_default\Projects\RawCoreAPIxUnit\src\RawCoreAPIxUnit.Tests\project.lock.json
log : C:_vs2015_default\Projects\RawCoreAPIxUnit\src\RawCoreAPIxUnit.Tests\RawCoreAPIxUnit.Tests.xproj
log : Restore failed in 7958ms.
Errors in C:_vs2015_default\Projects\RawCoreAPIxUnit\src\RawCoreAPIxUnit.Tests\RawCoreAPIxUnit.Tests.xproj
Package moq.netcore 4.4.0-beta8 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package moq.netcore 4.4.0-beta8 supports:
– dotnet (.NETPlatform,Version=v5.0)
– net35 (.NETFramework,Version=v3.5)
– net40 (.NETFramework,Version=v4.0)
– sl5 (Silverlight,Version=v5.0)

One or more packages are incompatible with .NETCoreApp,Version=v1.0.

{
“version”: “1.0.0-”,
“testRunner”: “xunit”,
“dependencies”: {
“xunit”: “2.2.0-beta2-build3300”,
“RawCoreAPIxUnit”: “1.0.0-
”,
“moq.netcore”: “4.4.0-beta8”,
“dotnet-test-xunit”: “2.2.0-preview2-build1029”
},
“frameworks”: {
“netcoreapp1.0”: {
“dependencies”: {
“Microsoft.NETCore.App”: {
“type”: “platform”,
“version”: “1.0.0”
}
}
}
}
}


Reference:
http://dotnetliberty.com/index.php/2016/02/22/moq-on-net-core/

@jeremymeng
Copy link
Contributor

@gerryLowry could you please try "Moq" instead of "moq.netcore"? The latest version supporting .NET Standard is 4.6.38-alpha.

@gerryLowry
Copy link
Author

Thank you, Jeremy ... this rebuilt clean:

{
  "version": "1.0.0-*",
  "testRunner": "xunit",
  "dependencies": {
    "xunit": "2.2.0-beta2-build3300",
    "Moq": "4.6.36-*",
    "RawCoreAPIxUnit": "1.0.0-*",
    "dotnet-test-xunit": "2.2.0-preview2-build1029"
  },
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        }
      }
    }
  }
}

FWIW, the real challenge is to know what works together and what does not.

i will report back later; i assume "Moq": "4.6.36-*" is stable, n'est-ce pas?

@jeremymeng
Copy link
Contributor

i assume "Moq": "4.6.36-*" is stable, n'est-ce pas?

4.6.38-alpha is the latest. It fixed a packaging issue for the net45 platform. There are no changes though regarding .NET Standard support.

@kzu
Copy link
Member

kzu commented Feb 21, 2017

Support for .NET core is now in stable, version 4.6.0!

Thanks @jeremymeng 👍

@kzu kzu closed this as completed Feb 21, 2017
@neman
Copy link

neman commented Feb 23, 2017

Is 4.6.0 typo, I can only see 4.7.0 on nuget.org?

@kzu
Copy link
Member

kzu commented Feb 23, 2017 via email

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

4 participants