Project Dependencies Finally Work

It finally works. The last time I wrote to you on this blog was on December 8, and a lot has happened since then. I tried to do things differently than I should have, I completely messed up my sleep schedule (I slept more than I was awake, for so long because I always slept in my winter jacket, but hopefully it will be fine now), and a filling fell out. First I programmed the Form you can see in the picture.

Debugging didn’t work for me there (the program stopped somewhere other than it should have), and all of that just because I had the output configuration set to 32-bit on a 64-bit OS. The second problem was that the ItemCheck event always fired only on the second check/uncheck. In the end I completely messed up my VC# settings, because I changed various things there that I had found online about this problem. I no longer remember how I came up with it or where I read it, but I reset all the settings of VC#, created a new project, added the files to it, and it started working.

Thing 2) – I was surprised that a program which, because of exceptions, took almost a minute to start in Debug started almost instantly in Release. The problem I had been struggling with before was that, for reasons I no longer remember, I wanted to perform the check whether some projects depend on each other only once during compilation. Unfortunately, I still couldn’t come up with a suitable sorting algorithm. In the end I implemented the algorithm in a simpler form in that form – if you try to check a project for which it would then be impossible to determine, in its dependency chain, which one depends on which, it immediately warns you and won’t let you check it.

After that I came up with the method that sorts the projects according to how they depend on each other, and I also slightly adjusted the compile command so that it can compile any number of projects. Finally, I played around a bit with XML and found out that in .NET you can’t use the method xpath.Evaluate("boolean(path)"); you have to select the node with the xdoc.SelectSingleNode method and then check whether it is null.

I’m attaching the source code of the form, but there isn’t much in it; the main logic is elsewhere, and there are really only a handful of lines. And what am I working on now? Now I’m moving on to startup projects – that is, which compiled exe files should be launched after a successful compilation. It can be either the project of the most recently edited file/one fixed project/several fixed projects. I hope I won’t spend my entire youth on it like I did on the project dependencies and the problems I had to solve there.

Categories

Leave a Reply