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

Application goes to "No symbol loaded" mode and pops up an exception when stop running application #72241

Closed
Cassie-Li01 opened this issue Jul 15, 2022 · 5 comments

Comments

@Cassie-Li01
Copy link

Description

System.TypeLoadException
HResult=0x80131522
Message=Could not load type 'System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller' from assembly 'Microsoft.Win32.SystemEvents, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' due to value type mismatch.
Source=Microsoft.Win32.SystemEvents
StackTrace:
at Interop.Kernel32.GetProcAddress(IntPtr hModule, String lpProcName)
at Microsoft.Win32.SystemEvents.get_DefWndProc()
at Microsoft.Win32.SystemEvents.Dispose()
at Microsoft.Win32.SystemEvents.WindowThreadProc()

Reproduction Steps

  1. Create a .Net 7.0 application (.NET version is .NET 7.0.100-rc.1.22364.25)
  2. Run the application and stop it

Expected behavior

Stop application normally

Actual behavior

Application goes to "No symbol loaded" mode and pops up an exception
image
bug

Regression?

Yes, it is a regression issue, cannot repro in .Net 7.0.100-preview.7.22357.5

Known Workarounds

No response

Configuration

No response

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 15, 2022
@ghost
Copy link

ghost commented Jul 15, 2022

Tagging subscribers to this area: @dotnet/area-microsoft-win32
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

System.TypeLoadException
HResult=0x80131522
Message=Could not load type 'System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller' from assembly 'Microsoft.Win32.SystemEvents, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' due to value type mismatch.
Source=Microsoft.Win32.SystemEvents
StackTrace:
at Interop.Kernel32.GetProcAddress(IntPtr hModule, String lpProcName)
at Microsoft.Win32.SystemEvents.get_DefWndProc()
at Microsoft.Win32.SystemEvents.Dispose()
at Microsoft.Win32.SystemEvents.WindowThreadProc()

Reproduction Steps

  1. Create a .Net 7.0 application (.NET version is .NET 7.0.100-rc.1.22364.25)
  2. Run the application and stop it

Expected behavior

Stop application normally

Actual behavior

Application goes to "No symbol loaded" mode and pops up an exception
image
bug

Regression?

Yes, it is a regression issue, cannot repro in .Net 7.0.100-preview.7.22357.5

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: Cassie-Li01
Assignees: -
Labels:

area-Microsoft.Win32

Milestone: -

@danmoseley
Copy link
Member

Moving to interop as nothing changed here.

@AaronRobinsonMSFT
Copy link
Member

This is because of the breaking change in the marshaller shapes introduced between Preview 7 and RC1. The solution is to stay within the same version of the SDK and implementation. If using RC1, then RC1 of WinForms should be used - mixing Preview 7 and RC1 will result in the above issues.

@jkoritzinsky or @elinor-fung may have another mitigation but this is a known break.

See #70859 for the API changes.

@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Jul 15, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 7.0.0 milestone Jul 15, 2022
@AaronRobinsonMSFT
Copy link
Member

Closing this as it will be sorted once WindowsDesktop moves onto RC1.

@Cassie-Li01
Copy link
Author

This issue is fixed on .NET latest 7.0.100-rc.1.22368.21 version from main branch. Screenshot as below:
fixed

@ghost ghost locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants