【问题标题】:App Run Outside of VS2012 Ultimate Crashes after 5-15 Seconds应用程序在 VS2012 Ultimate 之外运行 5-15 秒后崩溃
【发布时间】:2013-06-29 17:33:17
【问题描述】:

我遇到了一个问题,我似乎无法在本网站的任何地方找到解决方案。也许我只是在搜索错误的术语,所以现在我通过一个直接的问题把它交给你有能力的人。这里是:

每当我使用 Visual Studio 2012 Ultimate 创建应用程序并进行调试构建或发布构建然后尝试在 IDE 外部运行时,它会在大约 5 到 15 秒后崩溃,而不会显示任何错误消息/异常。我已经尝试过使用 C# 和 VB 应用程序。据我所知,我所有的 .NET 框架都是最新的。我在 VS2012 Ultimate 之前安装了一个 Visual Studio 2008 Professional 实例,一切正常。安装 VS2012 Ultimate 后,我创建的任何东西都无法正常运行。从那以后,我卸载了 VS2008 Professional 和 VS2012 Ultimate,运行 CCleaner,然后完全重新安装了 VS2012 Ultimate。问题仍然存在。另外,我的一个朋友带来了一个 .exe(他没有制作 .dll 文件)给我看他制作的一个程序,我的笔记本电脑上仍然存在相同的症状,但它在他的电脑上运行良好。

我运行的是 64 位 Windows 7 家庭高级版。感谢您提供任何帮助。

为简单起见,我创建了一个空白表单,代码如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

    namespace Spoon
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
        }
    }

非常感谢大家的帮助。

更新** 这是 VS2012 Ultimate 运行时即时窗口的输出。

构造此框架的内容时遇到异常。此信息也记录在“C:\Users\GoombaMaster\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml”中。

Exception details:
System.IO.FileNotFoundException: Unable to find the specified file.
   at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr)
   at MS.Internal.Text.TextInterface.FontFace.TryGetFontTable(OpenTypeTableTag openTypeTableTag, Byte[]& tableData)
   at MS.Internal.FontCache.FontFaceLayoutInfo.GetFontTable(OpenTypeTableTag openTypeTableTag)
   at MS.Internal.FontCache.GsubGposTables..ctor(FontFaceLayoutInfo layout)
   at MS.Internal.FontCache.FontFaceLayoutInfo.ComputeTypographyAvailabilities()
   at System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit)
   at MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs)
   at MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded)
   at MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth)
   at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)
   at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak)
   at System.Windows.Media.FormattedText.LineEnumerator.FormatLine(TextSource textSource, Int32 textSourcePosition, Double maxLineLength, TextParagraphProperties paraProps, TextLineBreak lineBreak)
   at System.Windows.Media.FormattedText.LineEnumerator.MoveNext()
   at System.Windows.Media.FormattedText.DrawAndCalculateMetrics(DrawingContext dc, Point drawingOffset, Boolean getBlackBoxMetrics)
   at System.Windows.Media.FormattedText.get_Metrics()
   at System.Windows.Media.FormattedText.get_Height()
   at Microsoft.VisualStudio.Text.Formatting.Implementation.TextInfoCache.GetTextInfo(TextRunProperties key)
   at Microsoft.VisualStudio.Text.Formatting.Implementation.FormattedTextSourceFactoryService.Create(ITextSnapshot sourceTextSnapshot, ITextSnapshot visualBufferSnapshot, Int32 tabSize, Double baseIndentation, Double wordWrapWidth, Double maxAutoIndent, Boolean useDisplayMode, IClassifier aggregateClassifier, ITextAndAdornmentSequencer sequencer, IClassificationFormatMap classificationFormatMap, Boolean isViewWrapEnabled)
   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot, SnapshotPoint anchorPosition, Double verticalDistance, ViewRelativePosition relativeTo, Double effectiveViewportWidth, Double effectiveViewportHeight, Boolean preserveViewportTop)
   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot)
   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.Initialize()
   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextEditorFactoryService.InitializeTextView(IWpfTextView view)
   at Microsoft.VisualStudio.Editor.Implementation.VsTextViewAdapter.Init_InitializeWpfTextView()
   at Microsoft.VisualStudio.Editor.Implementation.VsTextViewAdapter.Init_OnActivation()
   at Microsoft.VisualStudio.Editor.Implementation.VsTextViewAdapter.Microsoft.VisualStudio.TextManager.Interop.IVsCompoundAction.OpenCompoundAction(String pszDescription)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()

我希望这会有所帮助。

【问题讨论】:

  • 查看 Windows 应用程序/系统事件日志,看看是否有任何关于出现问题的建议。在您的机器上构建的 exe 文件如何在您朋友的机器上执行?听起来像卸载/重新安装 .Net 框架可能是个好主意。
  • 我已经尝试在 Visual Studio 中附加该进程并对其运行调试,但我似乎无法从中得到任何东西。即使我尝试暂停应用程序的运行时执行,它仍然会关闭。我什至没有足够的时间阅读线程。我将尝试再次卸载并重新安装 .NET。我已经卸载/重新安装了 4.0 和 4.5,但下面没有。此外,当我尝试在 VS 中不调试的情况下运行时,也会出现同样的问题。所以它可能需要对 vshost.exe 环境做一些事情,给它它需要的东西,而不是在外面。
  • 抱歉这么久才回来。我检查了我的系统事件日志,发现我的软件保护在我登录笔记本电脑大约 5 分钟后停止。除此之外,我收到如下错误:“遇到异常。这可能是由扩展引起的。您可以通过检查文件 'C:\Users\MyCompName\AppData\Roaming\Microsoft 获取更多信息\VisualStudio\11.0\ActivityLog.xml'.
  • 在刚才提到的活动日志中,日志中的两个错误(非常短的版本)是:“System.IO.FileNotFoundException: Unable to find the specified file。”和“构建框架内容失败。”

标签: c# visual-studio-2012 crash


【解决方案1】:

似乎对我所有的 .NET 框架进行了简单的修复就解决了这个问题。它让我相信被引用的 .dll 需要被删除和修复!看来我不能投票赞成评论,但如果可以的话,我会的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-16
    • 1970-01-01
    • 2013-04-13
    相关资源
    最近更新 更多