在"Session.Resources.Strings"类型上找不到匹配的构造函数.您可以使用Arguments或FactoryMethod指令来构造此类型. [英] No matching constructor found on type 'Session.Resources.Strings'. You can use the Arguments or FactoryMethod directives to construct this type.

查看:588
本文介绍了在"Session.Resources.Strings"类型上找不到匹配的构造函数.您可以使用Arguments或FactoryMethod指令来构造此类型.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2010(4.0.30319 SP1 Rel)中遇到了一个奇怪的问题,甚至不确定从哪里开始.

I've got a strange problem with Visual Studio 2010 (4.0.30319 SP1 Rel) and not even sure where to start on it.

我有一个相当简单的WPF解决方案,它并没有做任何与众不同的事情(MVVM Light,Moq,SVN,System.Diagnostics.Contracts等),但是偶尔我会得到以下编译器错误.

I've got a fairly simple WPF solution, that doesn't do anything out of the ordinary (MVVM Light, Moq, SVN, System.Diagnostics.Contracts, etc.), but every once in a while I get the following compiler error.

在"Session.Resources.Strings"类型上找不到匹配的构造函数.您可以使用Arguments或FactoryMethod指令来构造此类型.

No matching constructor found on type 'Session.Resources.Strings'. You can use the Arguments or FactoryMethod directives to construct this type.

由于某种原因,它找不到我的resx生成的代码的构造函数.我正在使用PublicResXFileCodeGenerator.通常,我必须进行完全重建才能使问题消失.当我查看SVN时,它看起来不像 文件已更改.我实际上是否在resx中添加了一些内容,似乎也都没有受到影响.我已经包含了生成的代码,只是为了您可以看到构造函数,该构造函数是Internal(不像我期望的那样公开),但是 应该很好.我已经使用了一个月,但是我希望有人知道解决方法.

For some reason, it can't find the constructor of the generated code for my resx.  I am using the PublicResXFileCodeGenerator.  Usually, I have to do a full rebuild to make the problem go away.  When I look in SVN, it doesn't look like the file has changed.  It also doesn't seem to be affected by whether I actually add something to the resx or not.  I've included the generated code, just so you can see the constructor, which is Internal (not public like I would have expected), but should be fine.  I've been living with this for a month, but I'm hoping somebody knows of a workaround.

//--------------------------------------------- ---------------------------------
//<自动生成的>
//    该代码是由工具生成的.
//    运行时版本:4.0.30319.586
//
//    对该文件所做的更改可能会导致不正确的行为,并且如果
将丢失 //    代码将重新生成.
//</自动生成的>
//------------------------------------------------ ------------------------------

命名空间Session.Resources {
   使用系统;
    
    
    ///< summary>
    ///  一个强类型的资源类,用于查找本地化的字符串等.
    ///</summary>
    //此类是由StronglyTypedResourceBuilder
自动生成的     //通过ResGen或Visual Studio之类的工具进行类.
    //要添加或删除成员,请编辑.ResX文件,然后重新运行ResGen
    //使用/str选项,或重建您的VS项目.
    [global :: System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder","4.0.0.0")]
    [global :: System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global :: System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
   公共类字符串{
       
      私有静态全局:: System.Resources.ResourceManager resourceMan;
       
      私有静态global :: System.Globalization.CultureInfo resourceCulture;
       
       [global :: System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance","CA1811:AvoidUndrawnPrivateCode"))]
      内部Strings(){
       }
       
       ///< summary>
       ///  返回此类使用的缓存的ResourceManager实例.
       ///</summary>
       [global :: System.ComponentModel.EditorBrowsableAttribute(global :: System.ComponentModel.EditorBrowsableState.Advanced)]
      公共静态全局:: System.Resources.ResourceManager ResourceManager {
          得到{
                             if(object.ReferenceEquals(resourceMan,null)){
                    global :: System.Resources.ResourceManager temp =新的global :: System.Resources.ResourceManager("Session.Resources.Strings",typeof(Strings.Assembly);
                    resourceMan = temp;
                             }
                            返回resourceMan;
           }
       }

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.586
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Session.Resources {
    using System;
    
    
    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class Strings {
        
        private static global::System.Resources.ResourceManager resourceMan;
        
        private static global::System.Globalization.CultureInfo resourceCulture;
        
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Strings() {
        }
        
        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Session.Resources.Strings", typeof(Strings).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

在Jonas Software工作

Working at Jonas Software

推荐答案

我正在将此案例移至clr以获得更好的帮助.

I am moving this case to clr for better help.

最好的问候


这篇关于在"Session.Resources.Strings"类型上找不到匹配的构造函数.您可以使用Arguments或FactoryMethod指令来构造此类型.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆