How to generate resource file (.resx and designer.cs) in mac vs code #27115
-
Refer to this docs, it only teach on vs, not vs code, is any method can do the same thing in mac env? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Workaround
@davidortinau how can use this native into VS Code? Why there isn't a Microsoft extension like C# Dev Kit? |
Beta Was this translation helpful? Give feedback.
-
Not sure if this something related or VS Code extensions, by default the If you want to create it on VSCode during build, you can add the following instructions in your <ItemGroup>
<EmbeddedResource Update="Resources\Localization\AppResources.resx">
<Generator>MSBuild:Compile</Generator>
<StronglyTypedLanguage>CSharp</StronglyTypedLanguage>
<StronglyTypedNamespace>MauiApp.Resources.Localization</StronglyTypedNamespace>
<StronglyTypedFileName>$(IntermediateOutputPath)\Resource.Designer.cs</StronglyTypedFileName>
<StronglyTypedClassName>AppResources</StronglyTypedClassName>
</EmbeddedResource>
<Compile Include="$(IntermediateOutputPath)\Resource.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>false</DesignTime>
<DependentUpon>Resources\Localization\AppResources.resx</DependentUpon>
</Compile>
</ItemGroup> |
Beta Was this translation helpful? Give feedback.
-
perfect, but there is a warning during build: any idea please? @pictos @davidortinau |
Beta Was this translation helpful? Give feedback.
Not sure if this something related or VS Code extensions, by default the
Resource.Designer
file is generated duringDesignTimeBuild
and VScode doesn't have it.If you want to create it on VSCode during build, you can add the following instructions in your
csproj
, it will generate theAppResources
file in obj folder and include it in the build proccess.