I edited my SDK style project to change from TargetFramework netcoreapp3.1 to net472
The project builds without errors
However I have following runtime error
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:devnet10SBD.CommonSnapInUIControlsUnitabCostingMethodControl.Designer.cs:line 516
at Snap.UI.UnitabCostingMethodControl..ctor() in D:devnet10SBD.CommonSnapInUIControlsUnitabCostingMethodControl.cs:line 16
at Snap.UI.frmVivUniversal.InitializeComponent() in D:devnet10SBD.CommonSnapInUIfrmUniversal.designer.cs:line 419
at Snap.UI.frmVivUniversal..ctor() in D:devnet10SBD.CommonSnapInUIfrmUniversal.cs:line 20
at Snap.Main.Form1.loadUniversalJob(String connectionstring) in D:devnet10SBD.CommonMainForm1.cs:line 40
at Snap.Main.Form1.button3_Click(Object sender, EventArgs e) in D:devnet10SBD.CommonMainForm1.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:devnet10SBD.CommonMainProgram.cs:line 18
I have looked at this question which is similar but for web.
My folders have Namespace Provider false.
I also found this question but have not seen anything that would explain why the problem only occurs when I switch to net472
[Update]
I created a blank form and experimented with dragging and dropping controls on to it. I repeated the problem with a particular control that had a System.Windows.Forms.BindingNavigator control
Indeed even clicking on this control in the toolbox generates a similar error
Interestingly I was able to create a new user control from scratch which would support the bindingNavigator control
I noticed that the new control included the folder name in it's namespace, even though the folder's Namespace Provider property was set to false.
OK , now I have a good control and a bad control. I cant see any difference visually. Time to run a diff.
question from:
https://stackoverflow.com/questions/65660778/system-resources-missingmanifestresourceexception-on-rolling-sdk-project-from-n 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…