✅ "debug executable 'location' specified in the [project] debug profile does not exist"
hello, i'm an absolute beginner with c# and am trying to work on a project for school. whenever i rebuild and try to run without debugging, visual studio gives me the error message "debug executable 'location' specified in the [project] debug profile does not exist." (location is the folder, and project is project name; i didn't list them because my professor requires it to have my full name in it and i'd prefer not to post that info online.)
this happens when i add some coding. when i remove the coding, it does open the project. i don't know what i'm doing wrong to cause this.
the project is supposed to be income tax calculator. the following is the coding i've been trying to use that causes the errors:
any and all advice appreciated, thanks so much!
17 Replies
Are you getting a build error?
Check error log to find out
View -> Error Log
It should be listed there
is that the same as error list?
Is what the same?
Oh, yes. I mean error list
okay, i wanted to make sure im looking at the right thing
its giving error CS0019
'*' cannot be applied to operands of type 'decimal' and 'double'
m
suffix indicates that the number is of type decimal
Without it, it will assume it is a doubleFloating-point numeric types - C# reference - C#
Learn about the built-in C# floating-point types: float, double, and decimal
oh, so then all the numbers need the m?
Correct
Decimal is 128-bit floating point while double is 64-bit floating point.
More bits means more precision, which is why you use decimal for currencies
okay, awesome. thanks a bunch!
its at least loading it up now, yay!
👏
No problem
...uh oh. so i tried to test it and its giving another exception. the input string '' was not in the correct format. do i need to make a new thread to ask about this? im frankly hopeless and so confused
When you feel like this thread is done, type
/close
No, it's fine
$tryparseWhen you don't know if a string is actually a number when handling user input, use
int.TryParse
(or variants, e.g. double.TryParse
)
TryParse
returns a bool
, where true
indicates successful parsing.
Remarks:
- Avoid int.Parse
if you do not know if the value parsed is definitely a number.
- Avoid Convert.ToInt32
entirely, this is an older method and Parse
should be preferred where you know the string can be parsed.
Read more hereLocalization is mostly the issue in your case
Some countries define decimals as 0.22, while other define them as 0,22 (notice comma vs dot)
But the recommended is to use TryParse, it returns a boolean whether it successfully parsed it, and the out parameter declares a variable and then sets the value to the result.
i thought the professor told us to use .x to get it to do percentages, but i could be misremembering, so i was multiplying by .x
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/method-parameters#out-parameter-modifier read more on
out
keyword hereawesome, thanks!