Reputation: 1564
I'm developing an application targeting .NET Standard 1.4, using the new csproj style (not project.json), and trying to get a localizable resources file to become available throughout the project. I get compiler errors when including a resources file currently, stating that the resources member I'm trying to access is not defined. (Note: my final solution will have to be consumed by a Xamarin Android project and a UWP project)
The csproj automatically includes the resources file as follows:
<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
Did it miss a step in the generation? Why can't I access any of the members of my resources file throughout the assembly?
Upvotes: 2
Views: 3381
Reputation: 1564
.resx files generate the corresponding C# file after editing the .resx. Since I was pasting XML and not making any edits in the .resx file, the class never got generated.
Upvotes: 3