I have the following code in App.xaml:
<Application x:Class="PcgTools.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PcgTools.ViewModels"
xmlns:res="clr-namespace:PcgTools.Resources"
StartupUri="MainWindow.xaml"
Startup="Application_Startup">
<Application.Resources>
<ResourceDictionary>
...
<res:Strings x:Key="LocStrings"/>
</ResourceDictionary>
</Application.Resources>
</Application>
(The ... are some lines which I removed to make the example cleaner).
When I run the application I get the following error (directly after trying to run/debug): (translated from Dutch so might not be 100% literally equal):
There has not been found a matching constructor in type PcgTools.Resources.Strings. You can use the instruction Arguments or FactoryMethod, to create this type.
There is a constructor in file Strings.Designer.cs:
namespace PcgTools.Resources {
...
public class Strings {
...
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute
("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Strings() {
}
However, it is generated so I cannot even change it.
Btw, without changing the code has worked (about a week ago), but then about 30% of the time when debugging it gave this error and after trying again this exception did not occur.