5 CLI Project Breakdown
Craig Oates edited this page 4 years ago

This section focuses on the source code within the console project (A.K.A DeathSocketCLI). This project provides a way to use the features in the .Net Standard 2.0 library (A.K.A. DeathSocket) without writing code.

deathsocketcli selected

Project Breakdown

This project is a traditional .Net console program, written in F#. Within the project, you will see nine files with "DeathSocketCLI.fsproj" amongst them. This is a typical ".fsproj" file you will find in most (if not all) F# projects made with Visual Studio; You should not need to ever open it. This, also, applies to "App.config", "AssemblyInfo.fs" and "packages.config". "resources.res" is another file you should not need to open but it is not a "normal" file so I will need to come back to that. "logo.ico" is the program's icon which is what people will see (in the task bar) when the program is running. Again, you should not need to open or alter this in any way. This leaves "Commands.fs", "Program.fs" and "Validation.fs" as the remaining three files. They are, also, where you will you spend most of your time.

deathsocketcli file structure

Up above, I said "resources.res" is not a "normal" file and would come back to it. The reason why is because it is a "system" file, like the ".fsproj" one, but it is not created by Visual Studio like the other system/configuration files. If anything, you have to go out of your way to make it and add it to your project. The reason it is here is because F# console programs do not cater to adding/registering an icon that well (like C#). So, it is essentially doing that -- and nothing else. (It is capable of doing other things but we don't need them.) You should not need to open the file because an icon already exists and I have already connected it. There are other things .res files can do but they are not used here. If you would like to know more about .res files, please use the links below. I should point out, though, .res files require a separate compile from the main project. It, also, needs the C++ tools bundled with Visual Studio -- which you might not have installed. So, unless I am unaware of an easier way, I do not recommend you faff around with "resources.res" or "logo.ico". The links for working with .res files are as follows: