KulaGGin
KulaGGin

Reputation: 1249

WPF XAML Could not load file or assembly 'AssemblyName, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified

I'm going through a book Mastering WPF and I'm trying to make one simple view with a converter work using MVVM pattern: W

When I try to run it, I get this exception:

System.Windows.Markup.XamlParseException: ''Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '12' and line position '44'.'

FileNotFoundException: Could not load file or assembly 'Kulagin.Mastering WPF.Converters, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

enter image description here

I don't understand why it tries to find a file Kulagin.Mastering WPF.Converters. It's not a file, only a namespace.

In the file BitRateView.xaml if I remove Converter={StaticResource EnumToBoolConverter}, ConverterParameter=Sixteen} from RadioButton controls: enter image description here

The exception doesn't get thrown and application runs but isn't working as intended because there's no converter hooked anymore. I read through all the code but I can't find what is causing this exception. All the references seem fine and it should work, but it doesn't.

Here's the solution with the exception: https://github.com/KulaGGin/MasteringWPF

All the other projects and classes are there because the author is showing how to build a framework and I'm following it.

Upvotes: 1

Views: 3209

Answers (1)

Frenchy
Frenchy

Reputation: 17027

Kulagin.Mastering WPF.Converters is a DLL

In the project Kulagin.Mastering WPF, see in the section Reference, the converters are in another Dll, so you have to reference it, because you are using a converter

it misses the reference to Kulagin.Mastering WPF.Converters

Add it..

Upvotes: 1

Related Questions