Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ambiguity Error after changing Resource File

I have an ASP.NET application that is available in two languages: English by default and Portuguese as second option.

Everything was working good, look this first image:

explorer before changing resource file

Then when I try to add or remove a string resource, visual studio starts to give me ambiguity errors when compiling, as those:

The namespace 'VolunteerGames.Web.Translations' already contains a definition for 'Translation'

and

Ambiguity between 'VolunteerGames.Web.Translations.Translation.ResourceManager' and 'VolunteerGames.Web.Translations.Translation.ResourceManager'

I noticed that after changing the resource in designer (Translation.resx) a new file named Translation1.Designer.cs was created. It created another class called Translation. If I delete this new file I can compile, but the new strings I just created are not found when I try to use on my controller.

enter image description here

I can't understand what's going on. I've been working for months in this project and it was all good.

like image 756
Murilo Avatar asked Aug 30 '25 18:08

Murilo


1 Answers

Because Visual Studio started to create the file Translation1.Designer.cs, and that new file conflicted with Translation.Designer.cs, and when I tried to delete it I got erros, then I deleted Translation.Designer.cs so everything is working now again.

enter image description here

like image 99
Murilo Avatar answered Sep 02 '25 08:09

Murilo