MS.Win32.Penimc.UnsafeNativeMethods

Hello,

I'm not very good at this, but I am having a problem with my stamps.com program.  When I try opening the program I get an error message saying, " The type initializer for " ms.win32.Penimc.UnsafeNativeMethods" threw an exception.

 

Please advise,

Jeff Hertel

 
Question Info

Last updated August 2, 2018 Views 10,530 Applies to:

Hi Jeff,

 

Thank you for posting your query in Microsoft Community.

 

Based on the issue description, it looks like you are unable to launch stamps.com program and receiving error message saying “The type initialize for ms.win32.Penimc.UnsafeNativeMethods threw an exception”.

 

To help you suggest steps to resolve the issue, I would appreciate if you could answer the following questions:

 

1.       Was the program installed successfully?

2.       What is the version of .Net Framework installed on the computer?

3.       Have you made any changes on the computer prior to the issue?

 

Looks like the "Microsoft Tablet PC Component" somehow get unregistered (according to error 0x80040154 Class not registered) or corrupted.

 

Can you check the PenIMC.dll in your .NET Framework 3.0 WPF folder at (replace C: and Windows with your settings if necessary):

 

C:\Windows\Microsoft.NET\Framework\v3.0\WPF

 

and also this if running on x64 Windows:

C:\Windows\Microsoft.NET\Framework64\v3.0\WPF

 

If the file is there, try use regsvr32 to re-register the component and see if that fix it.

 

If you're on .NET Framework 4.0 Beta 2, check it in the v4.0.21006 folder.

 

You can also try repair/re-install .NET Framework.

 

If you need further assistance reply to this post and I’d be happy to work with you on other issues related to Windows.

 

29 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

I'm having this same issue, but it's with VS2017.  I just installed it a few days from a clean HD.  I also did a repair, but to no avail.

As for your procedure, I tried it and it gives me a successful registration install, but it still gives me the same error.  What can I do from here?

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

I'm having the exact same problem with VS2015. I have been using it daily, but today I get this same error message.

I did note that a windows update was installed today (Win7).

231 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Found work-around solution here:

https://developercommunity.visualstudio.com/content/problem/55303/visual-studio-may-terminate-unexpectedly-when-runn.html

This does not solve the problem if needed at runtime.

So now problem has stopped my development.

Resolved this problem by doing a system restore.

This removed the Windows 7 Update: KB3186497 that was installed on the 14/06/2017.

Thanks Microsoft for the interruption to my work - NOT.

13 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

how do you resolve it

The type initializer for " ms.win32.Penimc.UnsafeNativeMethods" threw an exception.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

  1. Find the devenv.exe.config file. It is located in the folder <VS Install Location>\Common7\IDE.
  2. Copy devenv.exe.config to a non-protected folder, for example your Documents folder, and then create a backup copy of devenv.exe.config.
  3. Open devenv.exe.config, and modify the <AppContextSwitchOverrides> element to add “Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport=true”

47 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Thanks, that solves the problem on my dev machine :-)

I work with VS 2015 on Windows 7 64 bits. I had this issue after installing Windows Updates KB3186497 (.Net Framework 4.7) and KB3186499 (linguistic modules) - don't know wich one causes the problem.  

bfedotoff

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

It was KB3186497

10 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Wow! My restores did not go far enough back but I removed the KB3186497 update via control panel, then reinstalled an earlier version (4.6.1) and presto all my software is working again!

Affected programs include:

AutoCAD MEP: would not start

Intel Graphics card utility: would not start

Dell Precision Optimizer: would not start

This is after Dell replaced my motherboard and video cards!

Thanks a million for figuring out the cause!

7 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.