Skip to content

Generate strongly typed resources as part of build #1855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions Engine/Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,26 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<Compile Update="Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>

<!--
This ItemGroup and PropertyGroup block is required for resource generation to work for
.NET CLI, Visual Studio and VS-Code: https://github.com/dotnet/msbuild/issues/4751
-->
<ItemGroup>
<EmbeddedResource Update="Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<!-- Tell Visual Studio that MSBuild will do the generation and run a build if resx file changes. -->
<Generator>MSBuild:Compile</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
<StronglyTypedFileName>$(IntermediateOutputPath)\Strings.Designer.cs</StronglyTypedFileName>
<StronglyTypedLanguage>CSharp</StronglyTypedLanguage>
<StronglyTypedNamespace>Microsoft.Windows.PowerShell.ScriptAnalyzer</StronglyTypedNamespace>
<StronglyTypedClassName>Strings</StronglyTypedClassName>
</EmbeddedResource>
</ItemGroup>
<!-- For VS Code/OmniSharp support, ensure that CoreResGen runs before CoreCompile -->
<PropertyGroup>
<CoreCompileDependsOn>PrepareResources;$(CompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>


<ItemGroup Condition="'$(TargetFramework)' == 'net6'">
<PackageReference Include="System.Management.Automation" Version="7.0.11" />
Expand Down
Loading