xamarin / app-crm

MIT License
385 stars 249 forks source link

Editing the Localization.TextResources.resx file causes namespace for TextResources to change #116

Open jgold6 opened 6 years ago

jgold6 commented 6 years ago

If you edit the TextResources.resx files, than any code that refers to TextResources fails to compile with: Error CS0103: The name 'TextResources' does not exist in the current context (CS0103) (XamarinCRM)

I noted that the namespace in TextResources.Designer.cs file is XamarinCRM.Localization but this namespace is in no "using" statement anywhere where TextResources is referenced in code.

Adding "using XamarinCRM.Localization" to all files that reference TextResources resolves the issue.

jgold6 commented 6 years ago

I see this is because the generated TextResources.designer.cs file does have namespace XamarinCRM initially, but this gets changed to XamarinCRM.Localization when the resx file is changed and saved and the designer.cs file is regenerated on save.

I suspect this might have been that the TextResources.resx file was moved into the Localization folder and the designer.cs file was not regenerated before committing to source control. So when the TextResources.designer.cs is regenerated on save after an edit, the namespace is based on the location of the TextResources.resx file, thus getting the new namespace XamarinCRM.Localization after the resx file is edited and saved

jgold6 commented 6 years ago

Pull request to fix issue: #117