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

Closed
mrmonday opened this issue Nov 14, 2019 · 3 comments
Closed

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

mrmonday opened this issue Nov 14, 2019 · 3 comments
Assignees
Labels
output logic error A bug where the converted output behaves differently to the input code VB -> C# Specific to VB -> C# conversion

Comments

@mrmonday
Copy link
Contributor

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
@GrahamTheCoder GrahamTheCoder added output logic error A bug where the converted output behaves differently to the input code VB -> C# Specific to VB -> C# conversion labels Nov 15, 2019
@mrmonday
Copy link
Contributor Author

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

@GrahamTheCoder GrahamTheCoder added this to the 8.1.0 milestone Mar 16, 2020
@GrahamTheCoder
Copy link
Member

I believe I've fixed the namespace issue as part of #545
I'll look into the missing file issue now

@Saibamen
Copy link
Contributor

Should be fixed in release 8.0.2: https://github.com/icsharpcode/CodeConverter/releases/tag/8.0.2
Please retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
output logic error A bug where the converted output behaves differently to the input code VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

3 participants