Reputation: 3
I'm building a WPF project in Visual Studio and I added a class using the File>add class technique with VS. I ended up realizing I didn't need this new class so I deleted the .cs file that it created. However, now when I try to build the project, I get an error (failure to find source file x.cs). What do I need to do so that the build doesn't expect to find the x.cs file when building?
Upvotes: 0
Views: 77
Reputation: 8591
Depending on situation there's few ways to achieve that:
Removing
To remove an item or project
- In Solution Explorer, select the item you want to remove.
- On the Edit menu, select Remove.
Deleting
To permanently delete an item
- In Solution Explorer, select the item you want to delete.
- On the Edit menu, select Delete.
Excluding
To temporarily exclude an item that represents a file
- In Solution Explorer, select the item you want to exclude.
- On the Project menu, select Exclude From Project.
Excluding Items from Deployment Projects
To exclude an item from a deployment project
- In Solution Explorer, select the file you want to exclude.
- On the Solution Explorer toolbar, select Properties.
Unloading
To temporarily unload a project from a solution
- In Solution Explorer, select the project you want to unload.
- On the Project menu, select Unload Project.
More at: Visual Studio: How to: Remove, Delete, and Exclude Items (MSDN)
Upvotes: 3