See
How to: Modify the Target Framework and Platform Toolset[
^].
To run .NET applications with XP you must at least
- Set the project type to x86 (not Any CPU).
- Target .NET framework 4.0 or lower (higher versions does not work with XP but are selected by default with recent VS versions).
- Ensure that the XP system on which the application is installed has the corresponding .NET framework installed
The first two settings are VisualStudio project settings (see also above link).
For the third it might be necssary to include the framework redistributable with your installer.