Refactored the project file to support multiple target frameworks and added conditional ItemGroups. Updated several package versions for net8.0 and net9.0 targets to ensure compatibility while keeping net7.0 dependencies unchanged.