Skip to content
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

VB -> C#: Localized designer files not converted #423

Open
mrmonday opened this issue Nov 14, 2019 · 1 comment
Open

VB -> C#: Localized designer files not converted #423

mrmonday opened this issue Nov 14, 2019 · 1 comment

Comments

@mrmonday
Copy link
Contributor

@mrmonday mrmonday commented Nov 14, 2019

Input code

Create a new .NET Core 3.0 library (also applies to .NET Framework, with the relevant project file). Add two resource files, Resource1.resx and Resource1.en-US.resx.

Use the following project file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Library</OutputType>
    <RootNamespace></RootNamespace>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(ProjectDir)**\*.resx;$(ProjectDir)**\*.Designer.vb</DefaultItemExcludes>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Resource1.Designer.vb">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resource1.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Resource1.resx">
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resource1.Designer.vb</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>

  <ItemGroup>
    <Compile Include="Resource1.en-US.Designer.vb">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resource1.en-US.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Resource1.en-US.resx">
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resource1.en-US.Designer.vb</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>

</Project>

Erroneous output

The file Resource1.en-US.Designer.cs is not created, despite the corresponding VB file existing. Manually creating the file causes the contents to be generated correctly.

Expected output

The designer file should exist. The non-localised one does.

Details

  • Version in use: 7.2.0
@mrmonday

This comment has been minimized.

Copy link
Contributor Author

@mrmonday mrmonday commented Nov 15, 2019

There's a related issue to this with the namespaces being different, I haven't managed to work out a test case though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.