Ambiguity error after changing Resource (ASP.NET)

Asked

Viewed 334 times

1

I have been working on an ASP.NET MVC project for months. It is a system available in English and Portuguese, English being the default language. I do this through the use of Resources, and it was working smoothly, see image below.

inserir a descrição da imagem aqui

However, now when trying to add a new String in Translation.resx, when compiling gives class ambiguity errors.

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 inserting this new string, the visual studio created another file called Translation1.Designer.Cs. This file also has a class called Translation.

inserir a descrição da imagem aqui

So if I delete this new created file, I can compile, but the new Resource string I created is not found when I try to use in the controller.

Any idea what may have occurred or is occurring that keeps creating this file Translation1.Designer.Cs giving ambiguity?

  • This answer is very similar to what happened to you. https://social.msdn.microsoft.com/Forums/en-US/fe66fbe7-50ef-4250-bbde-6ffc545bc929/ambiguity-between-projectpropertiesresourcesgradient-and?forum=Vsexpressvcs. If you have difficulty in English, translate into Rome itself, you can understand.

  • How you created this new file?

  • I didn’t create it. It was created automatically when I added a new string in resx.

1 answer

0


As said Visual Studio create the file Translation1.Designer.Cs and this one kept giving confilito as Translation.Designer.Cs. I erased this Translation1, but it gave compilation error and lost the changes. Then I deleted the Translation.Designer.Cs and everything was resolved.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.