Red Gate forums :: View topic - "Bad unmanaged code entry point"
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 5
ANTS Performance Profiler 5 forum

"Bad unmanaged code entry point"

Search in ANTS Performance Profiler 5 forum
Post new topic   Reply to topic
Jump to:  
Author Message
ChristianWeyer



Joined: 08 Oct 2009
Posts: 4

PostPosted: Thu Oct 08, 2009 12:08 pm    Post subject: "Bad unmanaged code entry point" Reply with quote

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 Smile

Thanks,
-Christian
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6667

PostPosted: Thu Oct 08, 2009 2:05 pm    Post subject: Reply with quote

Hi Christian,

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
Back to top
View user's profile Send private message
ChristianWeyer



Joined: 08 Oct 2009
Posts: 4

PostPosted: Thu Oct 08, 2009 2:18 pm    Post subject: Reply with quote

Do you happen to know where this folder is located for Windows 7 (x64)?
And what exactly should I grant to who?

Thanks!
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6667

PostPosted: Thu Oct 08, 2009 3:24 pm    Post subject: Reply with quote

I haven't got a Win7 installation handy, but I'd imagine they still abstract the full path using environment variables, eg: %systemroot%\system32\config\systemprofile\localsettings\temp .

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.
Back to top
View user's profile Send private message
danielf



Joined: 04 May 2010
Posts: 2

PostPosted: Tue May 04, 2010 4:14 pm    Post subject: similar issue Reply with quote

Hi guys!

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.
Back to top
View user's profile Send private message
slaphead99



Joined: 10 Mar 2010
Posts: 93

PostPosted: Wed May 05, 2010 2:46 pm    Post subject: Reply with quote

In my experience, this almost always means there's a PDB file on the path that the profiler isn't happy with for various reasons (known to occur with Ajax and Unity framework pdb). So eliminate PDBs one by one until you find the culprit(s).
Back to top
View user's profile Send private message
danielf



Joined: 04 May 2010
Posts: 2

PostPosted: Wed May 05, 2010 6:00 pm    Post subject: Reply with quote

Thanks for a swift reply. It indeed was a pdb of a third party library.
Back to top
View user's profile Send private message
slaneyrw



Joined: 08 Feb 2005
Posts: 28

PostPosted: Mon May 10, 2010 3:30 am    Post subject: Reply with quote

The problems isn't with the PDB, Unity emits dymanic IL which the profiler has problems with.

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/viewtopic.php?t=8250&highlight=
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group