FreddieMercury
FreddieMercury

Reputation: 191

How do I make sure a my csproj file is included in my check-in within VS TFS?

I was instructed to delete an cshtml file from a View folder and then include my csproj file with my checked-in changes in VS TFS.

However, the csproj file does not show up under included changes in my Team Explorer Pending changes because nothing was done to it. From what my instructor said, apparently deleting a file requires the csproj file to be pushed, too.

I followed directions for how to locate my csproj file, but I can't figure out how to include it within my check-in.

Can anyone explain how to do this? Also, what connection does the csproj have to a deleted file change?

Upvotes: 0

Views: 1162

Answers (1)

ProgrammingLlama
ProgrammingLlama

Reputation: 38767

For .NET Framework* projects, the list of files in the project is stored within your .csproj file (you can open it with Notepad or similar and take a look at it, but don't edit it unless you know what you're doing).

The problem you have described is because when you add or remove a file from the project, it doesn't automatically save the project file. You can force it to save the project file in a couple of ways:

  1. Press Ctrl+Shift+S (Save All) to force everything to be saved.
  2. Rebuild the project, which will cause it to be saved.

Now if you go into TFS, you should see the file has changed and be able to save those changes.


*.NET Core and .NET Standard projects include all files in the project folder unless excluded, vs .NET Framework projects where they are excluded until included in the project file.

Upvotes: 2

Related Questions