Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9130425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:57:49+00:00 2026-06-17T07:57:49+00:00

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

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:57:50+00:00Added an answer on June 17, 2026 at 7:57 am

    Does your PcgTools.Resources.Strings class have a public default constructor? I think it’s complaining that it can’t create the object because it can’t find a matching constructor and since you’re not using Arguments, it’s looking for a default constructor (one with no arguments). The constructor needs to be public, not internal or private.

    Since the code is generated, you’ll need to find some way around this. Using the FactoryMethods thing might work. To do that, set up another class like

    namespace PcgTools.Resources
    {
        public static class StringResourceHelper
        {
            public static strings GetStringResources()
            {
                return new Resources.Strings();
            }
        }
    }
    

    then in your XAML you can do:

    <res:Strings x:FactoryMethod="res:StringResourceHelper.GetStringResources" 
                 x:Key="LocStrings"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In App.xaml I have the following code: <Application xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=FJW.App> <Application.Resources> <!-- Resources
I have the following proof of concept: XAML window: <Window x:Class=WpfApplication1.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow
I have the following set of code in my App.xaml: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary
In App.xaml, I have the following code: <Application.Resources> <Style x:Key=LabelTemplate TargetType={x:Type Label}> <Setter Property=Height
I've defined a DataTemplate in a ResourceDictionary 'style1.xaml': <ResourceDictionary xmlns:toolkit=clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml > <DataTemplate
I have the following code in my App.xaml.cs private void App_Start(object sender, StartupEventArgs e)
In my App.xaml file, I have the following code to allow double-decker column headers
I'm developing a Windows Phone app. I have the following XAML code: <Grid x:Name=ContentPanel
i have the following code defining the gui of my app class Ui (object):
I have the following code: public class App { public static void main(String[] args)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.