"Bad unmanaged code entry point"
ChristianWeyer
Posts: 6
When I try to profile my WCF service host application (this one is a console app) I get this exception:
---
System.Configuration.ConfigurationErrorsException was unhandled
Message="An error occurred creating the configuration section handler for system.serviceModel/behaviors: Bad unmanaged code entry point. (C:\\TecTeacher\\bin\\MediaConsoleHost.exe.Config line 32)"
Source="System.Configuration"
BareMessage="An error occurred creating the configuration section handler for system.serviceModel/behaviors: Bad unmanaged code entry point."
Filename="C:\\TecTeacher\\bin\\MediaConsoleHost.exe.Config"
Line=32
---
Any idea?
And yes: it works when not profiling the app
Thanks,
-Christian
---
System.Configuration.ConfigurationErrorsException was unhandled
Message="An error occurred creating the configuration section handler for system.serviceModel/behaviors: Bad unmanaged code entry point. (C:\\TecTeacher\\bin\\MediaConsoleHost.exe.Config line 32)"
Source="System.Configuration"
BareMessage="An error occurred creating the configuration section handler for system.serviceModel/behaviors: Bad unmanaged code entry point."
Filename="C:\\TecTeacher\\bin\\MediaConsoleHost.exe.Config"
Line=32
---
Any idea?
And yes: it works when not profiling the app
Thanks,
-Christian
Comments
I've seen this before and it looks like an XmlSerializer problem. The config files are deserialized by the .NET Framework, and to do this, it had to create a temporary assembly -- this is what fails sometimes.
Try granting full access to the system profile's temporary files folder and see if that helps:
C:\Windows\system32\config\systemprofile\LocalSettings\Temp
And what exactly should I grant to who?
Thanks!
You can try granting "modify" access to SYSTEM (should already have that), your own desktop logon account, and if profiling a service, the service's startup account also.
I have a similar problem: While profiling WPF application with "line level timing" precision (this is essential), I'm getting the same exception while creating certain controls defined in xaml i.e. Microsoft.Windows.Controls.Calendar. The inner exception says "Bad unmanaged code entry point: <Module>".
P.S. This only happens in case of "line level timing" precision.
P.S.S. I tried workaround described here, however (I"m running Vista), couldn't find %systemroot%\system32\config\systemprofile\localsettings\temp folder. I have C:\Windows\system32\config\systemprofile\AppData\Local, which grants full access to System account.
I have compiled the Unity application block from source code so the PDB is accurate and I still get problems.
Would be nice if Red Gate could finally fix their application... I reported this almost 18 months ago
http://www.red-gate.com/messageboard/vi ... highlight=