Closed baoshenyi closed 5 years ago
That's because Moq targets several different platforms. Visual Studio doesn't show anything in that combo-box in such cases, nothing we can do about that. Please file a report with the Visual Studio team if this bothers you. :-)
Thank you, Stakx. Do you have which moq and smocks version works with .net framework 4.6.2? Thanks again. Shenyi
Do you have which moq and smocks version works with .net framework 4.6.2?
See the "Dependencies" section on the NuGet package page for Moq: https://www.nuget.org/packages/Moq.
Unless you're using an ancient version of Moq, .NET 4.6.2 will be supported (regardless of whether VS presents you an empty target framework combo-box or not).
I am using Moq 4.10.1, Smocks 0.7.3 that works well on my machine (has following .net core installed), but my coworker had issues with build so I like to double check it with you. In case, moq requires some .net core sdk which may not be installed on his machine.
C:\Users\Shenyi.bao>dotnet --info .NET Core SDK (reflecting any global.json): Version: 2.2.105 Commit: 7cecb35b92
Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.2.105\
Host (useful for support): Version: 2.2.3 Commit: 6b8ad509b6
.NET Core SDKs installed: 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.505 [C:\Program Files\dotnet\sdk] 2.2.105 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Just take a look at the <TargetFramework>
or <TargetFrameworks>
elements of the various .csproj
files, that'll tell you exactly which frameworks are targeted and therefore which .NET Core SDKs / .NET Framework targeting packs you need to have installed.
Targeting Framework Missing / Empty Visual Studio 2017 and I download this version, which it works on my project with nuget package. https://github.com/moq/moq4/releases/tag/v4.10.1
Thanks,
Shenyi