mtreit
mtreit
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
If that doesn't work you might be missing a package reference.
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
Like adding the missing using.
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
Press ctrl+. (control plus period) on the offending line and it will usually suggest an auto-fix if possible.
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
That usually means you are missing a using statement at the top of the file.
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
It's at least not obviously completely borked.
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
rshwFormat thefile = rshwFormat.ReadFromFile(showtapeSegmentPaths[0]);
rshwFormat thefile = rshwFormat.ReadFromFile(showtapeSegmentPaths[0]);
Is that a camelCase type name?
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
:sku:
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
ctrl+z until it's green again 😉
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
You mangled something.
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
Not inside a method.
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
A bunch of code floating in space...
48 replies
CC#
Created by Lukified on 1/11/2025 in #help
Long string of errors
No description
48 replies
CC#
Created by LiquidPlazmid on 1/10/2025 in #help
Using File.ReadAllText in a Dependency Injected Project
Since as you saw it can change depending on how the program is invoked.
9 replies
CC#
Created by LiquidPlazmid on 1/10/2025 in #help
Using File.ReadAllText in a Dependency Injected Project
Just do something like
var jsonPath = Path.Combine(AppContext.BaseDirectory, "folder/folder2/file.json");
var jsonPath = Path.Combine(AppContext.BaseDirectory, "folder/folder2/file.json");
It's best to explicitly resolve the root path where your program lives than to rely on the current working directory.
9 replies
CC#
Created by LiquidPlazmid on 1/10/2025 in #help
Using File.ReadAllText in a Dependency Injected Project
You can use AppContext.BaseDirectory; to get the folder where the executable is and build your path from that.
9 replies
CC#
Created by LiquidPlazmid on 1/10/2025 in #help
Using File.ReadAllText in a Dependency Injected Project
The "current working directory" cwd (sometimes also called "present working directory" pwd) is the path from which the executable was invoked and that's where relative paths (you said absolute path but I think you meant relative?) are rooted from. So this code:
var currentFolder = Path.GetFullPath(".");
Console.WriteLine(currentFolder);
var currentFolder = Path.GetFullPath(".");
Console.WriteLine(currentFolder);
Will print different values depending on where you invoke the exe from.
9 replies
CC#
Created by Jonde on 1/7/2025 in #help
Best way to have a multi-window console app
You might try a framework like this which allows old-school terminal based UIs including multiple windows, menus, etc. I have not actually used it but the examples show there is a lot of possibilities (scroll down in the README for a bunch of examples of what it can do) https://github.com/gui-cs/Terminal.Gui
3 replies
CC#
Created by Faker on 1/1/2025 in #help
Resource to learn C#
Probably depends on the kind of development you are planning on doing. There is a lot of content on learn.microsoft.com: https://learn.microsoft.com/en-us/training/browse/?levels=intermediate&products=dotnet
35 replies
CC#
Created by Luna on 12/27/2024 in #help
Cannot open project
Can you open it in other tools, like a text editor?
6 replies
CC#
Created by Cheems🤡 on 11/26/2024 in #help
Facing Operating System error 3 while adding .mdf file in App_Data
I guess this was asked quite some time ago, but error code 3 generally means one of the folders in the path was not found. Are you positive this path exists? What happens if you do this in PowerShell:
dir "C:\Users\User_Name\Desktop\L.NETMVC\12 Remember Me Functionality\App_data\LoginDB.ldf"
dir "C:\Users\User_Name\Desktop\L.NETMVC\12 Remember Me Functionality\App_data\LoginDB.ldf"
3 replies