System.Resources.MissingManifestResourceException 关于从 .netcore3.1 到框架 4.7.2 的滚动 sdk 项目
System.Resources.MissingManifestResourceException on rolling sdk project from .netcore3.1 to framework 4.7.2
我编辑了我的 SDK 样式项目,将 TargetFramework netcoreapp3.1 更改为 net472
项目构建没有错误
但是我有以下运行时间错误
System.Resources.MissingManifestResourceException
HResult=0x80131532
Message=Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Snap.UI.UnitabCostingMethodControl.resources" was correctly embedded or linked into assembly "Snap.UI" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Source=mscorlib
StackTrace:
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at Snap.UI.UnitabCostingMethodControl.InitializeComponent() in D:\devnet10\SBD.Common\SnapInUI\Controls\UnitabCostingMethodControl.Designer.cs:line 516
at Snap.UI.UnitabCostingMethodControl..ctor() in D:\devnet10\SBD.Common\SnapInUI\Controls\UnitabCostingMethodControl.cs:line 16
at Snap.UI.frmVivUniversal.InitializeComponent() in D:\devnet10\SBD.Common\SnapInUI\frmUniversal.designer.cs:line 419
at Snap.UI.frmVivUniversal..ctor() in D:\devnet10\SBD.Common\SnapInUI\frmUniversal.cs:line 20
at Snap.Main.Form1.loadUniversalJob(String connectionstring) in D:\devnet10\SBD.Common\Main\Form1.cs:line 40
at Snap.Main.Form1.button3_Click(Object sender, EventArgs e) in D:\devnet10\SBD.Common\Main\Form1.cs:line 93
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Snap.Main.Program.Main() in D:\devnet10\SBD.Common\Main\Program.cs:line 18
我查看了 this question,它类似但适用于网络。
我的文件夹的命名空间提供程序为 false。
我也找到了 this question 但没有看到任何可以解释为什么只有当我切换到 net472 时才会出现问题的内容
[更新]
我创建了一个空白表单并尝试将控件拖放到上面。我用具有 System.Windows.Forms.BindingNavigator 控件
的特定控件重复了该问题
事实上,即使在工具箱中点击这个控件也会产生类似的错误
有趣的是,我能够从头开始创建一个支持 bindingNavigator 控件的新用户控件
我注意到新控件在其命名空间中包含文件夹名称,即使文件夹的命名空间提供程序 属性 设置为 false。
好的,现在我有一个好的控制和一个不好的控制。我在视觉上看不出任何区别。是时候 运行 差异了。
控件的命名空间是问题所在。
我可以通过让控件使用它的文件夹位置给定的名称空间来让它工作
我编辑了我的 SDK 样式项目,将 TargetFramework netcoreapp3.1 更改为 net472 项目构建没有错误 但是我有以下运行时间错误
System.Resources.MissingManifestResourceException
HResult=0x80131532
Message=Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Snap.UI.UnitabCostingMethodControl.resources" was correctly embedded or linked into assembly "Snap.UI" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Source=mscorlib
StackTrace:
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at Snap.UI.UnitabCostingMethodControl.InitializeComponent() in D:\devnet10\SBD.Common\SnapInUI\Controls\UnitabCostingMethodControl.Designer.cs:line 516
at Snap.UI.UnitabCostingMethodControl..ctor() in D:\devnet10\SBD.Common\SnapInUI\Controls\UnitabCostingMethodControl.cs:line 16
at Snap.UI.frmVivUniversal.InitializeComponent() in D:\devnet10\SBD.Common\SnapInUI\frmUniversal.designer.cs:line 419
at Snap.UI.frmVivUniversal..ctor() in D:\devnet10\SBD.Common\SnapInUI\frmUniversal.cs:line 20
at Snap.Main.Form1.loadUniversalJob(String connectionstring) in D:\devnet10\SBD.Common\Main\Form1.cs:line 40
at Snap.Main.Form1.button3_Click(Object sender, EventArgs e) in D:\devnet10\SBD.Common\Main\Form1.cs:line 93
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Snap.Main.Program.Main() in D:\devnet10\SBD.Common\Main\Program.cs:line 18
我查看了 this question,它类似但适用于网络。
我的文件夹的命名空间提供程序为 false。
我也找到了 this question 但没有看到任何可以解释为什么只有当我切换到 net472 时才会出现问题的内容
[更新]
我创建了一个空白表单并尝试将控件拖放到上面。我用具有 System.Windows.Forms.BindingNavigator 控件
的特定控件重复了该问题事实上,即使在工具箱中点击这个控件也会产生类似的错误
有趣的是,我能够从头开始创建一个支持 bindingNavigator 控件的新用户控件
我注意到新控件在其命名空间中包含文件夹名称,即使文件夹的命名空间提供程序 属性 设置为 false。
好的,现在我有一个好的控制和一个不好的控制。我在视觉上看不出任何区别。是时候 运行 差异了。
控件的命名空间是问题所在。
我可以通过让控件使用它的文件夹位置给定的名称空间来让它工作