.NET Core application debug error: “Unable to set the next statement. This file does not exactly match the...
up vote
2
down vote
favorite
While debugging a .NET Core console application in VS 2017, I'm unable to make an edit and then set the next statement. It gives me the error mentioned in the title:
For example, if I set the breakpoint where indicated by the comment, then debug, and modify the string in the first line directly above the breakpoint, I get the error:
static void Main(string args)
{
string x = "foo"; // modify this after debug breaks.
string y = "bar"; // breakpoint here
}
NOTE: this works as expected in a .NET Framework console application.
When I google the title of this OP, I get zero results, even if I split the two sentences from the error message into separate quoted strings. When I google without quotes, I get a number of results that don't provide an an answer. For example, this one is similar in that it starts out with "Unable to set the next statement" but then the rest is different. This one is also similar but again is different after the first sentence.
What is causing this?
c# .net visual-studio debugging visual-studio-2017
add a comment |
up vote
2
down vote
favorite
While debugging a .NET Core console application in VS 2017, I'm unable to make an edit and then set the next statement. It gives me the error mentioned in the title:
For example, if I set the breakpoint where indicated by the comment, then debug, and modify the string in the first line directly above the breakpoint, I get the error:
static void Main(string args)
{
string x = "foo"; // modify this after debug breaks.
string y = "bar"; // breakpoint here
}
NOTE: this works as expected in a .NET Framework console application.
When I google the title of this OP, I get zero results, even if I split the two sentences from the error message into separate quoted strings. When I google without quotes, I get a number of results that don't provide an an answer. For example, this one is similar in that it starts out with "Unable to set the next statement" but then the rest is different. This one is also similar but again is different after the first sentence.
What is causing this?
c# .net visual-studio debugging visual-studio-2017
Just a hunch, but have you tried toggling your "Enable Edit and Continue" debug option? I really have no idea if that's related, but something I'd check.
– itsme86
Nov 19 at 16:51
Thanks for the suggestion. I just tried it and it didn't change the behavior.
– rory.ap
Nov 19 at 17:14
Are you directly modifying the code, or modifying "x" in the Immediate Window? I am not sure of your original problem, but maybe that would be a helpful workaround? You should be able to type 'x = "newFoo"' in the Immediate Window.
– Cardi DeMonaco Jr
Nov 19 at 17:57
1
I'm directly modifying it. Your workaround didn't work but it did lead me to another workaround, which was to set the next line first and then modify the value ofx
. It doesn't work when I modifyx
and then try to set the next line.
– rory.ap
Nov 20 at 13:10
Can anyone repro this? Or is it just me?
– rory.ap
Nov 20 at 13:10
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
While debugging a .NET Core console application in VS 2017, I'm unable to make an edit and then set the next statement. It gives me the error mentioned in the title:
For example, if I set the breakpoint where indicated by the comment, then debug, and modify the string in the first line directly above the breakpoint, I get the error:
static void Main(string args)
{
string x = "foo"; // modify this after debug breaks.
string y = "bar"; // breakpoint here
}
NOTE: this works as expected in a .NET Framework console application.
When I google the title of this OP, I get zero results, even if I split the two sentences from the error message into separate quoted strings. When I google without quotes, I get a number of results that don't provide an an answer. For example, this one is similar in that it starts out with "Unable to set the next statement" but then the rest is different. This one is also similar but again is different after the first sentence.
What is causing this?
c# .net visual-studio debugging visual-studio-2017
While debugging a .NET Core console application in VS 2017, I'm unable to make an edit and then set the next statement. It gives me the error mentioned in the title:
For example, if I set the breakpoint where indicated by the comment, then debug, and modify the string in the first line directly above the breakpoint, I get the error:
static void Main(string args)
{
string x = "foo"; // modify this after debug breaks.
string y = "bar"; // breakpoint here
}
NOTE: this works as expected in a .NET Framework console application.
When I google the title of this OP, I get zero results, even if I split the two sentences from the error message into separate quoted strings. When I google without quotes, I get a number of results that don't provide an an answer. For example, this one is similar in that it starts out with "Unable to set the next statement" but then the rest is different. This one is also similar but again is different after the first sentence.
What is causing this?
c# .net visual-studio debugging visual-studio-2017
c# .net visual-studio debugging visual-studio-2017
edited Nov 19 at 16:14
itsme86
16.2k32948
16.2k32948
asked Nov 19 at 16:00
rory.ap
23.3k63998
23.3k63998
Just a hunch, but have you tried toggling your "Enable Edit and Continue" debug option? I really have no idea if that's related, but something I'd check.
– itsme86
Nov 19 at 16:51
Thanks for the suggestion. I just tried it and it didn't change the behavior.
– rory.ap
Nov 19 at 17:14
Are you directly modifying the code, or modifying "x" in the Immediate Window? I am not sure of your original problem, but maybe that would be a helpful workaround? You should be able to type 'x = "newFoo"' in the Immediate Window.
– Cardi DeMonaco Jr
Nov 19 at 17:57
1
I'm directly modifying it. Your workaround didn't work but it did lead me to another workaround, which was to set the next line first and then modify the value ofx
. It doesn't work when I modifyx
and then try to set the next line.
– rory.ap
Nov 20 at 13:10
Can anyone repro this? Or is it just me?
– rory.ap
Nov 20 at 13:10
add a comment |
Just a hunch, but have you tried toggling your "Enable Edit and Continue" debug option? I really have no idea if that's related, but something I'd check.
– itsme86
Nov 19 at 16:51
Thanks for the suggestion. I just tried it and it didn't change the behavior.
– rory.ap
Nov 19 at 17:14
Are you directly modifying the code, or modifying "x" in the Immediate Window? I am not sure of your original problem, but maybe that would be a helpful workaround? You should be able to type 'x = "newFoo"' in the Immediate Window.
– Cardi DeMonaco Jr
Nov 19 at 17:57
1
I'm directly modifying it. Your workaround didn't work but it did lead me to another workaround, which was to set the next line first and then modify the value ofx
. It doesn't work when I modifyx
and then try to set the next line.
– rory.ap
Nov 20 at 13:10
Can anyone repro this? Or is it just me?
– rory.ap
Nov 20 at 13:10
Just a hunch, but have you tried toggling your "Enable Edit and Continue" debug option? I really have no idea if that's related, but something I'd check.
– itsme86
Nov 19 at 16:51
Just a hunch, but have you tried toggling your "Enable Edit and Continue" debug option? I really have no idea if that's related, but something I'd check.
– itsme86
Nov 19 at 16:51
Thanks for the suggestion. I just tried it and it didn't change the behavior.
– rory.ap
Nov 19 at 17:14
Thanks for the suggestion. I just tried it and it didn't change the behavior.
– rory.ap
Nov 19 at 17:14
Are you directly modifying the code, or modifying "x" in the Immediate Window? I am not sure of your original problem, but maybe that would be a helpful workaround? You should be able to type 'x = "newFoo"' in the Immediate Window.
– Cardi DeMonaco Jr
Nov 19 at 17:57
Are you directly modifying the code, or modifying "x" in the Immediate Window? I am not sure of your original problem, but maybe that would be a helpful workaround? You should be able to type 'x = "newFoo"' in the Immediate Window.
– Cardi DeMonaco Jr
Nov 19 at 17:57
1
1
I'm directly modifying it. Your workaround didn't work but it did lead me to another workaround, which was to set the next line first and then modify the value of
x
. It doesn't work when I modify x
and then try to set the next line.– rory.ap
Nov 20 at 13:10
I'm directly modifying it. Your workaround didn't work but it did lead me to another workaround, which was to set the next line first and then modify the value of
x
. It doesn't work when I modify x
and then try to set the next line.– rory.ap
Nov 20 at 13:10
Can anyone repro this? Or is it just me?
– rory.ap
Nov 20 at 13:10
Can anyone repro this? Or is it just me?
– rory.ap
Nov 20 at 13:10
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f53378442%2fnet-core-application-debug-error-unable-to-set-the-next-statement-this-file%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
Just a hunch, but have you tried toggling your "Enable Edit and Continue" debug option? I really have no idea if that's related, but something I'd check.
– itsme86
Nov 19 at 16:51
Thanks for the suggestion. I just tried it and it didn't change the behavior.
– rory.ap
Nov 19 at 17:14
Are you directly modifying the code, or modifying "x" in the Immediate Window? I am not sure of your original problem, but maybe that would be a helpful workaround? You should be able to type 'x = "newFoo"' in the Immediate Window.
– Cardi DeMonaco Jr
Nov 19 at 17:57
1
I'm directly modifying it. Your workaround didn't work but it did lead me to another workaround, which was to set the next line first and then modify the value of
x
. It doesn't work when I modifyx
and then try to set the next line.– rory.ap
Nov 20 at 13:10
Can anyone repro this? Or is it just me?
– rory.ap
Nov 20 at 13:10