【发布时间】:2013-01-25 04:36:39
【问题描述】:
namespace PcgTools.PcgToolsResources {
using System;
... some comments
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() {
}
问题是最后一行:
internal Strings() {
}
在运行应用程序时返回 XAML 错误。上面的文件是一个生成的文件(来自strings.resx)。
我现在必须在每个资源文件更改为后更改该行:
public Strings() {
}
有谁知道要改变什么来让它由公共而不是内部自动生成?
【问题讨论】:
-
当所有属性都是静态的,为什么还需要构造函数?
-
@Palec 不确定……内部 Strings() 行是由框架生成的。我没有尝试删除它(它也是一个旧项目,所以现在我不需要对项目进行任何更改)
标签: c# wpf xaml constructor resources