Cannot view contents of ImmutableArray in the debugger
I have the following:
- Using Visual Studio 2017 (latest version)
- Using ImmutableArray
- Fails using .Net Framework 4.7.1 OR 4.7.2 (not .Net Core)
- Works using .Net Framework 4.7.0 or earlier.
The issue is that if I stop in the debugger and try to inspect the contents of an ImmutableArray<T>
, nothing happens.
If I try to Quickwatch the ImmutableArray<T>
, I get the following error:
error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I can fix this error by going to:
Tools -> Options -> Debugging -> General, enable "Use Managed Compatibility Mode"
Unfortunately, this mode disables some other features, so my question is:
Is there any way to get this working without using managed compatibility mode?
(I suspect this problem may be related to the fact that the 4.7.1 or later support is added to Visual Studio using a separate download.)
My sample test console app that I was using:
using System;
using System.Collections.Immutable;
using System.Linq;
namespace ConsoleApp10
{
class Program
{
static void Main()
{
var t = test();
Console.WriteLine(t.Length); // Set breakpoint here: Cannot inspect 't'.
}
static ImmutableArray<int> test()
{
return Enumerable.Range(1, 10).ToImmutableArray();
}
}
}
c# debugging visual-studio-2017 immutablearray
add a comment |
I have the following:
- Using Visual Studio 2017 (latest version)
- Using ImmutableArray
- Fails using .Net Framework 4.7.1 OR 4.7.2 (not .Net Core)
- Works using .Net Framework 4.7.0 or earlier.
The issue is that if I stop in the debugger and try to inspect the contents of an ImmutableArray<T>
, nothing happens.
If I try to Quickwatch the ImmutableArray<T>
, I get the following error:
error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I can fix this error by going to:
Tools -> Options -> Debugging -> General, enable "Use Managed Compatibility Mode"
Unfortunately, this mode disables some other features, so my question is:
Is there any way to get this working without using managed compatibility mode?
(I suspect this problem may be related to the fact that the 4.7.1 or later support is added to Visual Studio using a separate download.)
My sample test console app that I was using:
using System;
using System.Collections.Immutable;
using System.Linq;
namespace ConsoleApp10
{
class Program
{
static void Main()
{
var t = test();
Console.WriteLine(t.Length); // Set breakpoint here: Cannot inspect 't'.
}
static ImmutableArray<int> test()
{
return Enumerable.Range(1, 10).ToImmutableArray();
}
}
}
c# debugging visual-studio-2017 immutablearray
It works fine for me (I can see the contents of theImmutableArray
when debugging) and I don't haveManagedCompatibilityMode
enabled (although I'm only on 4.6.2)
– Rufus L
Nov 12 '18 at 16:35
@RufusL I just tried it on 4.6.2 and that does indeed work - so it's an issue with later versions of .Net. I've updated my question accordingly.
– Matthew Watson
Nov 12 '18 at 18:14
add a comment |
I have the following:
- Using Visual Studio 2017 (latest version)
- Using ImmutableArray
- Fails using .Net Framework 4.7.1 OR 4.7.2 (not .Net Core)
- Works using .Net Framework 4.7.0 or earlier.
The issue is that if I stop in the debugger and try to inspect the contents of an ImmutableArray<T>
, nothing happens.
If I try to Quickwatch the ImmutableArray<T>
, I get the following error:
error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I can fix this error by going to:
Tools -> Options -> Debugging -> General, enable "Use Managed Compatibility Mode"
Unfortunately, this mode disables some other features, so my question is:
Is there any way to get this working without using managed compatibility mode?
(I suspect this problem may be related to the fact that the 4.7.1 or later support is added to Visual Studio using a separate download.)
My sample test console app that I was using:
using System;
using System.Collections.Immutable;
using System.Linq;
namespace ConsoleApp10
{
class Program
{
static void Main()
{
var t = test();
Console.WriteLine(t.Length); // Set breakpoint here: Cannot inspect 't'.
}
static ImmutableArray<int> test()
{
return Enumerable.Range(1, 10).ToImmutableArray();
}
}
}
c# debugging visual-studio-2017 immutablearray
I have the following:
- Using Visual Studio 2017 (latest version)
- Using ImmutableArray
- Fails using .Net Framework 4.7.1 OR 4.7.2 (not .Net Core)
- Works using .Net Framework 4.7.0 or earlier.
The issue is that if I stop in the debugger and try to inspect the contents of an ImmutableArray<T>
, nothing happens.
If I try to Quickwatch the ImmutableArray<T>
, I get the following error:
error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I can fix this error by going to:
Tools -> Options -> Debugging -> General, enable "Use Managed Compatibility Mode"
Unfortunately, this mode disables some other features, so my question is:
Is there any way to get this working without using managed compatibility mode?
(I suspect this problem may be related to the fact that the 4.7.1 or later support is added to Visual Studio using a separate download.)
My sample test console app that I was using:
using System;
using System.Collections.Immutable;
using System.Linq;
namespace ConsoleApp10
{
class Program
{
static void Main()
{
var t = test();
Console.WriteLine(t.Length); // Set breakpoint here: Cannot inspect 't'.
}
static ImmutableArray<int> test()
{
return Enumerable.Range(1, 10).ToImmutableArray();
}
}
}
c# debugging visual-studio-2017 immutablearray
c# debugging visual-studio-2017 immutablearray
edited Nov 12 '18 at 18:17
asked Nov 12 '18 at 16:26
Matthew Watson
72.3k691176
72.3k691176
It works fine for me (I can see the contents of theImmutableArray
when debugging) and I don't haveManagedCompatibilityMode
enabled (although I'm only on 4.6.2)
– Rufus L
Nov 12 '18 at 16:35
@RufusL I just tried it on 4.6.2 and that does indeed work - so it's an issue with later versions of .Net. I've updated my question accordingly.
– Matthew Watson
Nov 12 '18 at 18:14
add a comment |
It works fine for me (I can see the contents of theImmutableArray
when debugging) and I don't haveManagedCompatibilityMode
enabled (although I'm only on 4.6.2)
– Rufus L
Nov 12 '18 at 16:35
@RufusL I just tried it on 4.6.2 and that does indeed work - so it's an issue with later versions of .Net. I've updated my question accordingly.
– Matthew Watson
Nov 12 '18 at 18:14
It works fine for me (I can see the contents of the
ImmutableArray
when debugging) and I don't have ManagedCompatibilityMode
enabled (although I'm only on 4.6.2)– Rufus L
Nov 12 '18 at 16:35
It works fine for me (I can see the contents of the
ImmutableArray
when debugging) and I don't have ManagedCompatibilityMode
enabled (although I'm only on 4.6.2)– Rufus L
Nov 12 '18 at 16:35
@RufusL I just tried it on 4.6.2 and that does indeed work - so it's an issue with later versions of .Net. I've updated my question accordingly.
– Matthew Watson
Nov 12 '18 at 18:14
@RufusL I just tried it on 4.6.2 and that does indeed work - so it's an issue with later versions of .Net. I've updated my question accordingly.
– Matthew Watson
Nov 12 '18 at 18:14
add a 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%2f53266281%2fcannot-view-contents-of-immutablearray-in-the-debugger%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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53266281%2fcannot-view-contents-of-immutablearray-in-the-debugger%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
It works fine for me (I can see the contents of the
ImmutableArray
when debugging) and I don't haveManagedCompatibilityMode
enabled (although I'm only on 4.6.2)– Rufus L
Nov 12 '18 at 16:35
@RufusL I just tried it on 4.6.2 and that does indeed work - so it's an issue with later versions of .Net. I've updated my question accordingly.
– Matthew Watson
Nov 12 '18 at 18:14