Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMain: Could not load type 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter' from assembly 'System.Runtime.Serialization.Formatters'. #894

Open
only-ctrlCV opened this issue Jan 3, 2024 · 6 comments

Comments

@only-ctrlCV
Copy link

此错误的实例(1)

1。 隐藏调用堆栈

at System.RuntimeTypeHandle.g____PInvoke|78_0(UInt16* name, Int32 throwOnError, Int32 ignoreCase, StackCrawlMarkHandle stackMark, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack type, ObjectHandleOnStack keepalive)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Resources.ResourceReader.InitializeBinaryFormatter()
at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)
at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.ResourceReader.LoadObject(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.RuntimeResourceSet.ReadValue(ResourceReader reader, Int32 dataPos, Boolean isString, ResourceLocator& locator)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at SlimDX.Resources.get_BlackIcon()
at SlimDX.Windows.RenderForm.Construct(String text)
at SlimDX.Windows.RenderForm..ctor()
at InvokeStub_RenderForm..ctor(Object, Object, IntPtr*)
at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

有关此错误的帮助

未能找到与此错误相关的帮助主题。 检查 Windows 窗体设计时错误列表

有关此错误的论坛帖子

在 MSDN 论坛中搜索与此错误相关的帖子

@cosocc
Copy link

cosocc commented Feb 26, 2024

I had the same problem

@only-ctrlCV
Copy link
Author

I had the same problem

need vpn download something from cloud,but i gave up

@cosocc
Copy link

cosocc commented Feb 27, 2024

I had the same problem

need vpn download something from cloud,but i gave up

What do you need? I can download it
The project requires Version=4.0.1.0, but the existing version in the .NET Framework is 8.0.224.6711.

@JevLOMCN
Copy link
Contributor

https://www.lomcn.net/wiki/index.php/Getting_Started

@meacher0
Copy link
Contributor

Trying to open CMain.s in Designer Mode is the only thing I see that causes this.
My best guess is that Visual Studio cant open that in designer because it loads all the MirScenes (i think?) so it doesnt work. AMain.cs does open because all the required resources are referenced as a resource inside the application(?).

Anyway, I think "right-click > view code" on CMain.cs is the solution?
(Rather than trying to add that "System.Runtime.Serialization.Formatters.Binary.BinaryFormatter" from NuGet)

@lymegg
Copy link

lymegg commented Sep 12, 2024

This issue arises because SlimDX utilizes the System.Runtime.Serialization.Formatters.Binary.BinaryFormatter method, which has been disabled in .NET 8. As a result, the form cannot be opened. However, I am unsure how to resolve this and am waiting for an expert to provide a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants