0

我编辑了我的 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

我看过这个类似的问题,但对于网络。
我的文件夹有 Namespace Provider false。

我也发现了这个问题,但没有看到任何可以解释为什么只有当我切换到 net472 时才会出现问题的东西

[更新]

我创建了一个空白表单并尝试在其上拖放控件。我用具有 System.Windows.Forms.BindingNavigator 控件的特定控件重复了该问题

实际上,即使在工具箱中单击此控件也会产生类似的错误

找不到任何资源

有趣的是,我能够从头开始创建一个支持 bindingNavigator 控件的新用户控件

我注意到新控件在其命名空间中包含文件夹名称,即使文件夹的 Namespace Provider 属性设置为 false。

好的,现在我有一个好的控制和一个坏的控制。我在视觉上看不出任何区别。是时候运行一个差异了。

4

1 回答 1

0

控件的命名空间是问题所在。

通过让控件使用它的文件夹位置给出的命名空间,我能够让它工作

于 2021-01-11T06:46:49.873 回答