NSub for .Net 4.5.1?

317 views
Skip to first unread message

Tyler Smith

unread,
Nov 4, 2014, 12:27:13 AM11/4/14
to nsubs...@googlegroups.com
I tried installing NSub 1.7.2 via NuGet command line and got an error that there is not currently a version that targets .Net 4.5.1.  Is a version coming that will support 4.5.1?

Tyler

error details:

PM> Install-Package NSubstitute
Installing 'NSubstitute 1.7.2.0'.
Successfully installed 'NSubstitute 1.7.2.0'.
Adding 'NSubstitute 1.7.2.0' to LdsTools.Win8.
Uninstalling 'NSubstitute 1.7.2.0'.
Successfully uninstalled 'NSubstitute 1.7.2.0'.
Install failed. Rolling back...
Install-Package : Could not install package 'NSubstitute 1.7.2.0'. 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 files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package NSubstitute
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
 

David Tchepak

unread,
Nov 4, 2014, 12:50:49 AM11/4/14
to nsubs...@googlegroups.com
Hi Tyler,

NSubstitute doesn't support .NETCore sorry. (It does work with .NET Framework 4.5.1, but that won't help if you need .NETCore stuff.)

Regards,
David

--
You received this message because you are subscribed to the Google Groups "NSubstitute" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nsubstitute...@googlegroups.com.
To post to this group, send email to nsubs...@googlegroups.com.
Visit this group at http://groups.google.com/group/nsubstitute.
For more options, visit https://groups.google.com/d/optout.

Tyler Smith

unread,
Nov 4, 2014, 12:08:46 PM11/4/14
to nsubs...@googlegroups.com
Thanks David, do you know if is planned for a future release?  I'm working on a WSA that can only utilize .NETCore and would love to add NSub into the project.  I joined it late and there isn't a mocking framework used so most of the unit tests are hitting a web service and failing.

Tyler

David Tchepak

unread,
Nov 4, 2014, 5:40:28 PM11/4/14
to nsubs...@googlegroups.com
No plans for .NETCore support. If I recall correctly DynamicProxy (which NSub uses to do all the hard work :)) doesn't work with .NETCore (due to no Reflection.Emit?), so it would require something major to get support.

I haven't used .NETCore myself, but I think someone previously mentioned putting core app logic in a Portable Class Library, then testing that from a .NET Framework project (with NSub), while referencing that PCL from the production .NETCore app.

If it is mainly a single web service causing the problem, it might be easiest to hand-roll a test double implementation of it?

Regards,
David

Gustin G

unread,
Feb 18, 2016, 8:46:15 AM2/18/16
to NSubstitute
Still not planning to support .NET Core?

David Tchepak

unread,
Feb 18, 2016, 5:15:26 PM2/18/16
to nsubs...@googlegroups.com
Please see this github issue: https://github.com/nsubstitute/NSubstitute/pull/197

If anyone's got some time to finish off the work Alexandr's started please chime in on the issue. :)

Regards,
David

On Fri, Feb 19, 2016 at 12:46 AM, Gustin G <gus...@gmail.com> wrote:
Still not planning to support .NET Core?

--
You received this message because you are subscribed to the Google Groups "NSubstitute" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nsubstitute...@googlegroups.com.
To post to this group, send email to nsubs...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages