Process.Start throwing Class not registered exception in C#

蹲街弑〆低调 提交于 2021-01-29 09:11:35

问题


I have created an application in wpf which is working fine on win7 but on Win8 it shows below exception I'm trying to open directory in explorer by passing directory path.

System.ComponentModel.Win32Exception (0x80004005): Class not registered

   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)

   at System.Diagnostics.Process.Start()

   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)

   at Myapp.RunFile()

I'm also getting below error

Myapp.exe - Entry Point Not Found

The procedure entry point RangeMapFree could not be located in the dynamic link library

C:\Windows\system32\wer.dll. 

is there any way to resolve above?

thanks.


回答1:


It might be that you are missing wer.dll.

I suggest you go to this link and try to install the dll :)

http://www.dll-files.com/dllindex/dll-files.shtml?wer




回答2:


For the first problem: Class not registered when executing Process.Start.

Do you start your Visual Studio environment as Administrator? (Rightclick on shortcut => Properties => Shortcut => Advanced) Some people do this to be able to use some stuff in development (like writing to the registry).

Try restarting your VS-environment as the normal user (Example: press WIN-button, type "Visual" and press Visual Studio here).

Are you able to do the Process.Start function now?



来源:https://stackoverflow.com/questions/27498523/process-start-throwing-class-not-registered-exception-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!