NSubstitute -3.x 'ValueType' is defined in an assembly that is not referenced. You must add a reference to...
I am struggling to find a reason behind this error in my code:
ApplicationServiceTestsTest.cs(29, 13): error CS0012: The
type 'ValueType' is defined in an assembly that is not referenced. You
must add a reference to assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The code line is:
repo.GetCoveredCards(Arg.Is(cifCode)).Returns(Task.FromResult(new GetCustomerCCPlusResponse()
{
CreditCardPlus = new { card1, card2 }
}));
Tools, framework and Package
.net framework 4.6.1
Visual Studio 2015 using MSBuild 14.
NSubstitute 3.1.0
It seems like when I use NSubstitute version 1.10.0 and it has worked really well.
Now the question is why am I getting this error with the latest version of NSubstitute?
c# .net nsubstitute
|
show 1 more comment
I am struggling to find a reason behind this error in my code:
ApplicationServiceTestsTest.cs(29, 13): error CS0012: The
type 'ValueType' is defined in an assembly that is not referenced. You
must add a reference to assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The code line is:
repo.GetCoveredCards(Arg.Is(cifCode)).Returns(Task.FromResult(new GetCustomerCCPlusResponse()
{
CreditCardPlus = new { card1, card2 }
}));
Tools, framework and Package
.net framework 4.6.1
Visual Studio 2015 using MSBuild 14.
NSubstitute 3.1.0
It seems like when I use NSubstitute version 1.10.0 and it has worked really well.
Now the question is why am I getting this error with the latest version of NSubstitute?
c# .net nsubstitute
seems like you chose the .net standard version of their library - perhaps there is a version more compatible for you?
– JohnB
Nov 20 '18 at 1:20
No, the target framework, where I am installing this package is 4.6.1. Hence it should not haev referred standard at all. I could not see any dependency added by the system.
– codebased
Nov 20 '18 at 1:40
1
can you post the csproj xml?
– JohnB
Nov 20 '18 at 1:43
check out the dependencies here - nuget.org/packages/NSubstitute/3.1.0 You are certainly missing out something in the dependencies, thus leading to an error
– Mrinal Kamboj
Nov 20 '18 at 5:39
NSubstitute version 1.10.0did not have any dependency
– Mrinal Kamboj
Nov 20 '18 at 5:51
|
show 1 more comment
I am struggling to find a reason behind this error in my code:
ApplicationServiceTestsTest.cs(29, 13): error CS0012: The
type 'ValueType' is defined in an assembly that is not referenced. You
must add a reference to assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The code line is:
repo.GetCoveredCards(Arg.Is(cifCode)).Returns(Task.FromResult(new GetCustomerCCPlusResponse()
{
CreditCardPlus = new { card1, card2 }
}));
Tools, framework and Package
.net framework 4.6.1
Visual Studio 2015 using MSBuild 14.
NSubstitute 3.1.0
It seems like when I use NSubstitute version 1.10.0 and it has worked really well.
Now the question is why am I getting this error with the latest version of NSubstitute?
c# .net nsubstitute
I am struggling to find a reason behind this error in my code:
ApplicationServiceTestsTest.cs(29, 13): error CS0012: The
type 'ValueType' is defined in an assembly that is not referenced. You
must add a reference to assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The code line is:
repo.GetCoveredCards(Arg.Is(cifCode)).Returns(Task.FromResult(new GetCustomerCCPlusResponse()
{
CreditCardPlus = new { card1, card2 }
}));
Tools, framework and Package
.net framework 4.6.1
Visual Studio 2015 using MSBuild 14.
NSubstitute 3.1.0
It seems like when I use NSubstitute version 1.10.0 and it has worked really well.
Now the question is why am I getting this error with the latest version of NSubstitute?
c# .net nsubstitute
c# .net nsubstitute
edited Nov 20 '18 at 1:40
codebased
asked Nov 20 '18 at 1:08
codebasedcodebased
4,71833059
4,71833059
seems like you chose the .net standard version of their library - perhaps there is a version more compatible for you?
– JohnB
Nov 20 '18 at 1:20
No, the target framework, where I am installing this package is 4.6.1. Hence it should not haev referred standard at all. I could not see any dependency added by the system.
– codebased
Nov 20 '18 at 1:40
1
can you post the csproj xml?
– JohnB
Nov 20 '18 at 1:43
check out the dependencies here - nuget.org/packages/NSubstitute/3.1.0 You are certainly missing out something in the dependencies, thus leading to an error
– Mrinal Kamboj
Nov 20 '18 at 5:39
NSubstitute version 1.10.0did not have any dependency
– Mrinal Kamboj
Nov 20 '18 at 5:51
|
show 1 more comment
seems like you chose the .net standard version of their library - perhaps there is a version more compatible for you?
– JohnB
Nov 20 '18 at 1:20
No, the target framework, where I am installing this package is 4.6.1. Hence it should not haev referred standard at all. I could not see any dependency added by the system.
– codebased
Nov 20 '18 at 1:40
1
can you post the csproj xml?
– JohnB
Nov 20 '18 at 1:43
check out the dependencies here - nuget.org/packages/NSubstitute/3.1.0 You are certainly missing out something in the dependencies, thus leading to an error
– Mrinal Kamboj
Nov 20 '18 at 5:39
NSubstitute version 1.10.0did not have any dependency
– Mrinal Kamboj
Nov 20 '18 at 5:51
seems like you chose the .net standard version of their library - perhaps there is a version more compatible for you?
– JohnB
Nov 20 '18 at 1:20
seems like you chose the .net standard version of their library - perhaps there is a version more compatible for you?
– JohnB
Nov 20 '18 at 1:20
No, the target framework, where I am installing this package is 4.6.1. Hence it should not haev referred standard at all. I could not see any dependency added by the system.
– codebased
Nov 20 '18 at 1:40
No, the target framework, where I am installing this package is 4.6.1. Hence it should not haev referred standard at all. I could not see any dependency added by the system.
– codebased
Nov 20 '18 at 1:40
1
1
can you post the csproj xml?
– JohnB
Nov 20 '18 at 1:43
can you post the csproj xml?
– JohnB
Nov 20 '18 at 1:43
check out the dependencies here - nuget.org/packages/NSubstitute/3.1.0 You are certainly missing out something in the dependencies, thus leading to an error
– Mrinal Kamboj
Nov 20 '18 at 5:39
check out the dependencies here - nuget.org/packages/NSubstitute/3.1.0 You are certainly missing out something in the dependencies, thus leading to an error
– Mrinal Kamboj
Nov 20 '18 at 5:39
NSubstitute version 1.10.0 did not have any dependency– Mrinal Kamboj
Nov 20 '18 at 5:51
NSubstitute version 1.10.0 did not have any dependency– Mrinal Kamboj
Nov 20 '18 at 5:51
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384826%2fnsubstitute-3-x-valuetype-is-defined-in-an-assembly-that-is-not-referenced-y%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384826%2fnsubstitute-3-x-valuetype-is-defined-in-an-assembly-that-is-not-referenced-y%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
seems like you chose the .net standard version of their library - perhaps there is a version more compatible for you?
– JohnB
Nov 20 '18 at 1:20
No, the target framework, where I am installing this package is 4.6.1. Hence it should not haev referred standard at all. I could not see any dependency added by the system.
– codebased
Nov 20 '18 at 1:40
1
can you post the csproj xml?
– JohnB
Nov 20 '18 at 1:43
check out the dependencies here - nuget.org/packages/NSubstitute/3.1.0 You are certainly missing out something in the dependencies, thus leading to an error
– Mrinal Kamboj
Nov 20 '18 at 5:39
NSubstitute version 1.10.0did not have any dependency– Mrinal Kamboj
Nov 20 '18 at 5:51