Profile v5 has same issue as v4 with Unity

We use Unity to handle dependency injection within our web application. Here is the ASP.NET error page that is generated when profiled. The same application works without the profile running.

It is the same problem that v4 of the product had.

Cheers...

Robert



Server Error in '/' Application.

Bad unmanaged code entry point.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Bad unmanaged code entry point.

Source Error:


Line 230: {
Line 231: ExeConfigurationFileMap map = new ExeConfigurationFileMap() { ExeConfigFilename = unityFilePath };
Line 232: section = ConfigurationManager.OpenMappedExeConfiguration( map, ConfigurationUserLevel.None ).GetSection( "unity" ) as UnityConfigurationSection;
Line 233:
Line 234: }


Source File: D:\Projects\VS2008\MVC\SEEK\Framework\Unity\Unity.cs Line: 232

Stack Trace:


[TypeLoadException: Bad unmanaged code entry point.]
Microsoft.Practices.Unity.Configuration.UnityConfigurationSection.get_Containers() in e:\Builds\Unity\UnityTemp\Compile\Unity\Src\Unity.Configuration\ConfigurationElements\UnityConfigurationSection.cs:33

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +277
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +519
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) +36
System.Configuration.ConfigurationElement.ApplyInstanceAttributes(Object instance) +332
System.Configuration.ConfigurationElement.get_Properties() +62
System.Configuration.ConfigurationElement.Reset(ConfigurationElement parentElement) +64
System.Configuration.MgmtConfigurationRecord.CreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader) +180
System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line) +129

[ConfigurationErrorsException: An error occurred creating the configuration section handler for unity: Exception has been thrown by the target of an invocation.]
System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line) +550
System.Configuration.BaseConfigurationRecord.CreateSectionDefault(String configKey, Boolean getRuntimeObject, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object& result, Object& resultRuntimeObject) +150
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +1896
System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission) +57
System.Configuration.Configuration.GetSection(String sectionName) +16
SEEK.Unity.EnsureDefaults() in D:\Projects\VS2008\MVC\SEEK\Framework\Unity\Unity.cs:232
SEEK.Unity.set_RootPath(String value) in D:\Projects\VS2008\MVC\SEEK\Framework\Unity\Unity.cs:59
JobSeeker.Framework.UnityControllerFactory.Configure(String rootPath) in D:\Projects\VS2008\MVC\SEEK\JobSeeker\Framework\UnityControllerFactory.cs:37
JobSeeker.MvcApplication.Application_Start() in D:\Projects\VS2008\MVC\SEEK\JobSeeker\Global.asax.cs:55

[HttpException (0x80004005): An error occurred creating the configuration section handler for unity: Exception has been thrown by the target of an invocation.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +429
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +219
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +237
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +290
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +244

[HttpException (0x80004005): An error occurred creating the configuration section handler for unity: Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +468
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +687

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Robert,

    It looks like you have got the symptoms of how ANTS can change the runtime security environment. If the web application can't read the configuration, then it's probably an XmlSerializer problem. When ASP .NET does this, it creates a temporary assembly in %systemroot%\system32\config\systemprofile\LocalSettings\Temp. Granting full access to everyone on this folder may get it working again.
Sign In or Register to comment.