I cannot understand the workspace/ project relationship

I have tried several times to become comfortable with PIO.
I am a noob to PIO and have been hard at it with Arduino 2. In any case I decided to move over to VS code. It looks fantastic. However things are turning very sour…
My workspace has several but similar projects. I was having trouble just compiling one and not all of the projects. One of the projects ( call it project_A) I have committed about two weeks work and all was well.
I then focused on another of the project in the workspace (call it project_B). I used the success of project_A to create project_B. Project B was a multi module created on Arduino.
I was trying to rebuild all the cpp and .h files into PIO. I was having library and path issues so had to put that project_B on hold.
Then all the same compiler problems started appearing in project_A.
The env is ESP32, using the common wifi and ESPAsyncWebServer libraries. The compiler errors seem to focus on not having access to header files in ESP8266WiFi.
I removed project_B from the workspace, however project_A will no longer compile with the error message referring to ESP8266WiFi… Her is the include statements for the library
// Import required libraries
#include <Arduino.h>
#ifdef ESP32
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#include <arduinoJson.h>
#else
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <Hash.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#endif.
Even if I comment out the includes in the #else directive not thing changes with the errors after compile. Thank you anyone, in advance.

I don’t really use the concept of workspaces, I just open the folder my project is in. I only work on one project at a time and close the project by closing the folder then opening up another folder to work on another project. I have not had any problems at all doing this.
To create a project I copy and paste the folder using my file manager (not platformio) then rename it, then open it it up from platformio. I have created projects via platformio home also with no problem.
So maybe try this and see what your results are.
There is a lot to platformio so don’t expect to understand everything in a day. PIO is worth the investment in time.

Same here. I just open folders.