Zubair Munir
Zubair Munir

Reputation: 478

Xamarin forms Resources designer.cs not creating using visual studio mac

enter image description hereI'm facing a strange issue I have created a brand new xamarin forms project and i'm trying to adding Resource file in the shared project but when i add the Resource file then .resx extenshion file is created Like AppResources.resx creates but the code behind like AppResource.designer.cs not creating

Things that i have tried.

  1. I have try multiple time and clean rebuild the project.
  2. Create new project and try to again add resource file.
  3. use custom tool to build the resource.

enter image description here

Upvotes: 1

Views: 698

Answers (1)

ToolmakerSteve
ToolmakerSteve

Reputation: 21263

To manually fix the csproj, so it generates AppResources.designer.cs from AppResources.resx, follow these steps:

  <ItemGroup>
    <Compile Update="Resx\AppResources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>AppResources.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Update="Resx\AppResources.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>AppResources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
  • Save the csproj file.
  • Open your solution.

Upvotes: 1

Related Questions