A.Darwaz
A.Darwaz

Reputation: 43

Class inclusion error in visual studio

I am currently working in visual studio developing a text based game. I had a namespace conflict with a class.
I had a class name which was Clothing and namespace which also named Clothing. To get around this issue I renamed the namespace clothes instead of clothing and then all the drama started. My csproj file did not update the namespace references in the folders whenever i try to build i get the following error.

[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\Shirts\Shirt.cs'.
[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\ClothingEnum.cs'.
[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\Cloaks\Cloak.cs'.
[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\Boots\JackBoot.cs'.
...

If i look in these directories the files exist but are empty. The actual files are in ...\src\Items\Equipment\Apparel\ Clothes\Boots... and they are included in the csproj file. But these files are also there.

In essence what I'm asking is how do I remove these unused references/dependencies/whatever they are from the csproj file.

Manually deleting the xml references in csproj file just causes my project to fail loading.

Upvotes: 1

Views: 74

Answers (1)

Peter Tsrunchev
Peter Tsrunchev

Reputation: 51

I don't get why you renamed your folders after you renamed the namespaces - that is unnecessary, in my opinion.

You can remove the cs files from the solution explorer with "Exclude from project"and then add the new ones with "Add -> Existing item"

Upvotes: 1

Related Questions