Skip to content

Installing Costura Fody #11

Open
Open
@rukshanfonseka

Description

@rukshanfonseka

When installing Costura ie because I want to create a one binary. The project won't compile as it fails to understand Tr in the XAML.

Activity

rukshanfonseka

rukshanfonseka commented on Nov 9, 2023

@rukshanfonseka
Author

I think this is because the version of Fody is newer when Costura is installed and so the project fails to compile.

self-assigned this
on Nov 15, 2023
added
wontfixThis will not be worked on
documentationImprovements or additions to documentation
and removed
bugSomething isn't working
wontfixThis will not be worked on
on Nov 23, 2023
codingseb

codingseb commented on Nov 23, 2023

@codingseb
Owner

Apparently this is due to the fact that : To use Tr in xaml without namespace we need to export a namespace in the standard xaml namespace. This is done in the file AddWPFXAMLStandardNameSpace.cs

This only works when we use the corresponding assembly in an another assembly.

So as Costura repack all assemblies in one we need to access Tr with a namespace again in all xaml that will be repack in the same assembly by costura.

So with costura you need to replace all your Tr and other xaml markups defined in CodingSeb.Localization.WPF.

<Window x:Class="..."
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="..."
        xmlns:loc="clr-namespace:CodingSeb.Localization.WPF"> 
       <TextBlock Text="{loc:Tr TextId}" />
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @codingseb@rukshanfonseka

      Issue actions

        Installing Costura Fody · Issue #11 · codingseb/Localization