开发环境:vs2015 框架:.NET4.5
问题描述:使用vs2015开发了一个app,在部分电脑上安装.NET4.5后能够直接运行(win10系统下),但是在win7系统下安装了.NET4.5运行时会出错,找不到原因,求解

解决方案 »

  1.   

    报错信息是什么?另外你程序的目标平台是什么?你如果拿X64的程序安装在32位的电脑上不管是Win 几都会出错。
    主要是你的报错信息什么都没有
      

  2.   

    程序运行一段时间后崩溃,然后提示联机检查解决方案并关闭程序,目标平台就是.NET4.5,机器的运行环境也是windows64位
      

  3.   

    运行一段时间后崩溃你应该把你崩溃的信息贴出来,另外.NET 4.5是框架不是平台。是不是乱用线程了?
      

  4.   

    日志名称:          Application
    来源:            .NET Runtime
    日期:            2019-09-02 17:29:27
    事件 ID:         1026
    任务类别:          无
    级别:            错误
    关键字:           经典
    用户:            暂缺
    计算机:           HP-PC
    描述:
    应用程序: CKDataCollection.exe
    Framework 版本: v4.0.30319
    说明: 由于未经处理的异常,进程终止。
    异常信息: System.Windows.Markup.XamlParseException
    堆栈:
       在 System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
       在 System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
       在 System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
       在 System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
       在 System.Windows.Application.LoadComponent(System.Uri, Boolean)
       在 System.Windows.Application.DoStartup()
       在 System.Windows.Application.<.ctor>b__1(System.Object)
       在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
       在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
       在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
       在 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
       在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
       在 System.Windows.Threading.DispatcherOperation.Invoke()
       在 System.Windows.Threading.Dispatcher.ProcessQueue()
       在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
       在 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
       在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
       在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
       在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
       在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
       在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
       在 MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
       在 System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
       在 System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
       在 System.Windows.Threading.Dispatcher.Run()
       在 System.Windows.Application.RunDispatcher(System.Object)
       在 System.Windows.Application.RunInternal(System.Windows.Window)
       在 System.Windows.Application.Run(System.Windows.Window)
       在 CKDataCollection.App.Main()事件 Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name=".NET Runtime" />
        <EventID Qualifiers="0">1026</EventID>
        <Level>2</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2019-09-02T09:29:27.000000000Z" />
        <EventRecordID>47687</EventRecordID>
        <Channel>Application</Channel>
        <Computer>HP-PC</Computer>
        <Security />
      </System>
      <EventData>
        <Data>应用程序: CKDataCollection.exe
    Framework 版本: v4.0.30319
    说明: 由于未经处理的异常,进程终止。
    异常信息: System.Windows.Markup.XamlParseException
    堆栈:
       在 System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
       在 System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
       在 System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
       在 System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
       在 System.Windows.Application.LoadComponent(System.Uri, Boolean)
       在 System.Windows.Application.DoStartup()
       在 System.Windows.Application.&lt;.ctor&gt;b__1(System.Object)
       在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
       在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
       在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
       在 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
       在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
       在 System.Windows.Threading.DispatcherOperation.Invoke()
       在 System.Windows.Threading.Dispatcher.ProcessQueue()
       在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
       在 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
       在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
       在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
       在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
       在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
       在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
       在 MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
       在 System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
       在 System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
       在 System.Windows.Threading.Dispatcher.Run()
       在 System.Windows.Application.RunDispatcher(System.Object)
       在 System.Windows.Application.RunInternal(System.Windows.Window)
       在 System.Windows.Application.Run(System.Windows.Window)
       在 CKDataCollection.App.Main()
    </Data>
      </EventData>
    </Event>
      

  5.   

    但是我已经手动安装了.NET4.5,运行环境不应该有问题呀
      

  6.   

    运行一段时间就崩溃? 这不是一开始运行就崩溃了吗
    读取baml出错了
    最有可能的还是.net4.5没有装好
      

  7.   

    确实是运行了一段时间奔溃的,.NET45都是官网上下载安装的
      

  8.   

    你看一下电脑上是否有framework 4.0?我怀疑是有4.0的,系统使用4.0的framework运行你的程序,但你的程序是4.5编的,有可能出现问题。如果有4.0的,卸载以后,再安装4.5的framework试试,记得安装完重启。