Xamarin Android - How to rebuild Resource.designer.cs

前端 未结 16 557
孤独总比滥情好
孤独总比滥情好 2021-02-03 17:10

In Xamarin Android - How to regenerate the Resource.designer.cs

I tried to mark all the XML file\'s Build Action as \"AndroidResource\" and still the Resource.designer.c

相关标签:
16条回答
  • 2021-02-03 17:48

    In Visual Studio 2019, if you deleted Resources.Designer.cs, just right click "Resources.resx" file in solution explorer and choose "Run custom tool"

    This will recreate the file.

    "ResXFileCodeGenerator" must be set in Resources.resx file properties (but is set by default)

    0 讨论(0)
  • 2021-02-03 17:50

    The generated Resources.designer.cs class will be updated if you rebuild your project. You can find this information at: http://docs.xamarin.com/guides/android/getting_started/hello%2C_world

    0 讨论(0)
  • 2021-02-03 17:54

    It's easier than it seems...

    http://docs.xamarin.com/recipes/android/general/projects/specify_default_namespace/

    You can rename your project by using find/replace, but the resources file will use whatever is set for 'default namespace' in the Main Settings and will continue to revert to this name even if you manually edit the Resource.designer.cs file in or out of Xamarin.

    0 讨论(0)
  • 2021-02-03 17:56

    As recently as Xamarin Studio 5.6 (build 273) with Xamarin.Android 4.18.0, if you have manually deleted the Resource.designer.cs file from the project, rebuilding will regenerate Resource.designer.cs, but will not add it back into the project. So after attempting to rebuild once, the file will be present in the file system, but not in the project. To fix this, manually add the newly generated file into the Resources folder in the project.

    0 讨论(0)
  • 2021-02-03 17:57

    I faced the same issue in Visual Studio. The resource designer file is only generated when there is a change in the resource I applied following steps to generate the required resource.designer.cs file * Added a dummy image in the resources * Cleaned the project * Rebuild the project New resource.designer.cs generated.

    0 讨论(0)
  • 2021-02-03 17:58

    It happened to me a few times, and every time the problem was not coming from the generation of the file itself, but from a malformed android resource. So if that happens after you merged something from your repository, double check your android resources (colors, strings, etc), for any malformed XML code.

    0 讨论(0)
提交回复
热议问题