none
VS 2010 SEHException...seems to be spreading today RRS feed

  • Question

  • A number of people report getting SEHException when debugging apps under VS2010. This seems to have started today.  Check out: http://forums.asp.net/t/1704958.aspx/1/10?p=True&t=634478097099208127

    I now get this error with the simplest of MVC 3 apps and all of the VS2010 wizard-generated apps.  Others are having the same problem.  Has some update been pushed out?

     

    Here's a typically stack trace:

    [SEHException (0x80004005): External component has thrown an exception.]
      Microsoft.Win32.Win32Native.CreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile) +0
      Microsoft.Win32.Win32Native.SafeCreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile) +29
      System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +936
      System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +82
      System.IO.StreamWriter.CreateFile(String path, Boolean append) +55
      System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) +121
      System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) +29
      System.Web.Compilation.StandardDiskBuildResultCache.SavePreservedSpecialFilesCombinedHash(Int64 hash) +116
      System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(StandardDiskBuildResultCache diskCache) +752
      System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(StandardDiskBuildResultCache diskCache) +55
      System.Web.Compilation.BuildManager.RegularAppRuntimeModeInitialize() +174
      System.Web.Compilation.BuildManager.Initialize() +261
      System.Web.Compilation.BuildManager.InitializeBuildManager() +246
      System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +530
    
    [HttpException (0x80004005): External component has thrown an exception.]
      System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9036040
      System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
      System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258

    Here's a stack trace from a console app:
    at System.Security.Policy.PEFileEvidenceFactory.GetPublisherCertificate(SafePEFileHandle peFile, ObjectHandleOnStack retCertificate)
    at System.Security.Policy.PEFileEvidenceFactory.GeneratePublisherEvidence()
    at System.Security.Policy.PEFileEvidenceFactory.GenerateEvidence(Type evidenceType)
    at System.Security.Policy.AssemblyEvidenceFactory.GenerateEvidence(Type evidenceType)
    at System.Security.Policy.Evidence.GenerateHostEvidence(Type type, Boolean hostCanGenerate)
    at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
    at System.Security.Policy.Evidence.GetHostEvidence(Type type, Boolean markDelayEvaluatedEvidenceUsed)
    at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)
    at System.Security.Policy.Evidence.GenerateHostEvidence(Type type, Boolean hostCanGenerate)
    at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
    at System.Security.Policy.Evidence.OnSerializing(StreamingContext context)


    at System.AppDomain.get_Evidence()
    at System.AppDomain.get_EvidenceNoDemand()
    at System.AppDomain.get_Evidence()
    at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
    at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
    at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
    at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
    at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
    at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
    at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
    at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
    at System.Configuration.ConfigurationManager.GetSection(String sectionName)
    at Enyim.Caching.LogManager..cctor()


     

     

    -larry

     

    Monday, August 1, 2011 8:38 PM

Answers

All replies

  • Yes - same problem - I have 2 apps, 1 web based the other just a windows application. I have not been able to trace the web app but my console app errors on the 1st text box in thedesigner

     

    #region Windows Form Designer generated code

            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.tbCordDia = new System.Windows.Forms.TextBox(); ////(App stops on this line)

    /// with error:

    System.Runtime.InteropServices.SEHException was unhandled
      Message=External component has thrown an exception.
      Source=System.Drawing
      ErrorCode=-2147467259
      StackTrace:
           at System.Drawing.SafeNativeMethods.Gdip.GdipCreateFontFromLogfontW(HandleRef hdc, Object lf, IntPtr& font)
           at System.Drawing.Font.FromLogFont(Object lf, IntPtr hdc)
           at System.Drawing.Font.FromHfont(IntPtr hfont)
           at System.Drawing.SystemFonts.get_DefaultFont()
           at System.Windows.Forms.Control.get_DefaultFont()
           at System.Windows.Forms.Control.get_Font()
           at System.Windows.Forms.Control.get_FontHeight()
           at System.Windows.Forms.TextBoxBase.get_PreferredHeight()
           at System.Windows.Forms.TextBoxBase.get_DefaultSize()
           at System.Windows.Forms.Control..ctor(Boolean autoInstallSyncContext)
           at System.Windows.Forms.TextBoxBase..ctor()
           at System.Windows.Forms.TextBox..ctor()
           at ParagonGraph.frmCheckLimits.InitializeComponent()
           at ParagonGraph.frmCheckLimits..ctor()
           at ParagonGraph.Program.Main()
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:

     

    My Web app through the same as yours:

     

    External component has thrown an exception.

    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.Runtime.InteropServices.SEHException: External component has thrown an exception.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [SEHException (0x80004005): External component has thrown an exception.]
      Microsoft.Win32.Win32Native.CreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile) +0
      Microsoft.Win32.Win32Native.SafeCreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile) +29
      System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +936
      System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +82
      System.IO.StreamWriter.CreateFile(String path, Boolean append) +55
      System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) +121
      System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) +29
      System.Web.Compilation.StandardDiskBuildResultCache.SavePreservedSpecialFilesCombinedHash(Int64 hash) +116
      System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(StandardDiskBuildResultCache diskCache) +752
      System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(StandardDiskBuildResultCache diskCache) +55
      System.Web.Compilation.BuildManager.RegularAppRuntimeModeInitialize() +174
      System.Web.Compilation.BuildManager.Initialize() +261
      System.Web.Compilation.BuildManager.InitializeBuildManager() +246
      System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +350
    
    [HttpException (0x80004005): External component has thrown an exception.]
      System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9013676
      System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
      System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258

    I have no Idea what changed
    -Rob
    • Proposed as answer by k145a Monday, August 1, 2011 9:51 PM
    Monday, August 1, 2011 9:35 PM
  • Work Around - If you need to just run the code (to get something done without debug), run without the debugger - I found my apps work if launched using Ctr -F5.
    -Rob
    Monday, August 1, 2011 10:08 PM
  • I have the same issue with WPF application. Started yesterday out of the blue. Everything OK on another machine and runs OK without debugging. Any solution?

    Stack Trace Info

     

    at Microsoft.Win32.Win32Native.CreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile)
       at Microsoft.Win32.Win32Native.SafeCreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
       at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream)
       at System.Windows.Input.Cursor..ctor(Stream cursorStream)
       at System.Windows.Controls.GridViewColumnHeader.GetCursor(Int32 cursorID)
       at System.Windows.Controls.GridViewColumnHeader.get_SplitCursor()
       at System.Windows.Controls.GridViewColumnHeader.HookupGripperEvents()
       at System.Windows.Controls.GridViewColumnHeader.OnApplyTemplate()
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.GridViewHeaderRowPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at DataClient.App.Main() in C:\Development\Eagles Basketball Club\DataClient\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    Tuesday, August 2, 2011 8:23 AM
  • I am having this same issue.

    ErrorCode=-2147467259

     

    at Microsoft.Win32.Win32Native.CreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile)
    at Microsoft.Win32.Win32Native.SafeCreateFile(String lpFileName, Int32 dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES securityAttrs, FileMode dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
    at System.IO.StreamWriter.CreateFile(String path, Boolean append)
    at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
    at System.IO.StreamWriter..ctor(String path)

     

    Tuesday, August 2, 2011 9:07 AM
  • Tuesday, August 2, 2011 10:05 AM
  • Problem solved.

     

    Thanks.


    Dave Turrell
    Tuesday, August 2, 2011 10:34 AM
  • Solved.

    Tuesday, August 2, 2011 11:02 AM
  • Bingo! Fixed the problem for me as well. Thanks!
    Tuesday, August 2, 2011 4:56 PM
  • Thank you so much

    My problem has been solved by uninstalling Trusteer Rapport

    Tuesday, August 2, 2011 9:09 PM
  • Hi Larry,

    Has your issue also been resolved with eddieyanez's suggestion?
    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 3, 2011 9:02 AM
    Moderator
  • For anyone that doesn't want to uninstall Rapport, I just received this emails from them (but haven't had chance to test it myself yet)

     

    We apologize for the inconvenience you have experienced.

    The latest version of Rapport, which is available in the following link, should resolve the conflict with Visual Studio:
    http://download.trusteer.com/NkuiAcruiKc/RapportSetup-Full_x64.exe

    Additionally, we would like to assure you there are no known issues with this version as the one described in the forum thread you sent us.
    We are currently in contact with the user whom posted this message and are further investigating the problem.

    We have received positive feedback from other users whom installed the latest version as a fix to the conflict with Visual Studio and did not receive complaints about any similar issues with this version


    My website: www.cjwdev.co.uk My blog: cjwdev.wordpress.com
    Wednesday, August 3, 2011 2:16 PM