在VS2012 Ultimate外部运行的应用程序在5-15秒后崩溃 - c#

我遇到一个问题,我似乎找不到该站点上任何地方的解决方案。也许我只是在搜索错误的术语,所以现在我通过一个直接的问题将其交给您有能力的人。这里是:

每当我使用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 Home Premium版本。可以提供的任何帮助表示赞赏。

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

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()

我希望这能有所帮助。

参考方案

看来,对我所有的.NET框架进行简单的修复即可解决该问题。它使我相信被引用的.dll必须同时删除和修复!看来我无法发表评论,但我可以。

在VS2012 MVC4应用程序中模拟XSS攻击 - c#

我有一个MVC 4应用程序,在其中我试图模拟XSS附加。我只有一个按钮和文本框,它们将只输出在文本框中输入的值,如下所示。当我在文本框中输入<script>alert('xss')</script>时,自动显示异常,表明已从客户端检测到危险值。如何防止这种至少出于学习目的现在,按照Furqan的建议,不会出现例外。…

C#无法将类型为“ System.Double”的对象转换为类型为“ System.Single” - c#

在判断此问题已得到回答之前,请阅读说明。我在下面有这个简单的代码:Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("key" , 30d); System.Diagnostics.Debug.WriteLine($…

错误:无法将类型为“ System.Int32”的对象转换为类型为“ System.String”的对象 - c#

我已经完成了完美的编码注册页面,登录代码,现在UpdateCustomer页面有错误-背景信息:我正在使用Microsoft Access作为数据源 LabelState.Text = (string)Session["sState"]; LabelPostalCode.Text = (string)Session["sPost…

System.out.printf不打印整数参数 - java

我是Java编程的新手,无法从另一个类返回方法。这两个类都可以编译并成功运行。我可以从一个类中调用一个简单的int,但是当我想计算用户输入的两个输入整数时,我只会得到一个空格。这是我的计算课class calculations { public final int AGE = 53; public int numbers(int num1, int num2…

System.Text.Json合并两个对象 - c#

是否可以用System.Text.Json?合并两个这样的json对象对象1{ id: 1 william: "shakespeare" } 对象2{ william: "dafoe" foo: "bar" } 结果对象{ id: 1 william: "dafoe" foo: …