How to add a file to a particular project
Note, this article has been moved to the official DevExpress Support Center site. Please refer to the moved article as it might have further updates or additional comments. Thank you.
public void AddFileToProject(string projectName, string filePath)
This method adds the specified file to the project with the given name. The project must be open in Visual Studio and be part of the active solution.
Parameters of the method:
The name of the project to add to.
The path of the file to add.
Consider the following solution structure:
In this case, you will add the Class2.cs file into the ClassLibrary1 project. Here’s a call to add a file:
After that, you will see that the new file is added into the project:
To add a file that depends on another file, see the corresponding topic.—– Products: DXCore Versions: 12.1 and up VS IDEs: any Updated: Oct/31/2012 ID: D027