Windows7已经安装了.Net4.5.2但是没装vs2017,打不开这个程序,没有错误提示,下面是我在系统日志里面找到的错误报告Application: Re_MSTO_Launcher_For_UI.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException
 at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
 at System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
 at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
 at System.Reflection.Assembly.Load(System.Reflection.AssemblyName)
 at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly)
 at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType)
 at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType, Int16)
 at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16)
 at System.Windows.Baml2006.Baml2006Reader.Process_ElementStart()
 at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
 at System.Windows.Baml2006.Baml2006Reader.ReadObject(System.Windows.Baml2006.KeyRecord)
 at System.Windows.ResourceDictionary.CreateObject(System.Windows.Baml2006.KeyRecord)
 at System.Windows.ResourceDictionary.OnGettingValue(System.Object, System.Object ByRef, Boolean ByRef)
 at System.Windows.ResourceDictionary.OnGettingValuePrivate(System.Object, System.Object ByRef, Boolean ByRef)
 at System.Windows.ResourceDictionary.GetValueWithoutLock(System.Object, Boolean ByRef)
 at System.Windows.ResourceDictionary.GetValue(System.Object, Boolean ByRef)
 at System.Windows.DeferredResourceReference.GetValue(System.Windows.BaseValueSourceInternal)
 at System.Windows.DependencyPropertyChangedEventArgs.get_NewValue()
 at System.Windows.Controls.Control.OnTemplateChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
 at System.Windows.StyleHelper.ApplyStyleOrTemplateValue(MS.Internal.FrameworkObject, System.Windows.DependencyProperty)
 at System.Windows.StyleHelper.InvalidateContainerDependents(System.Windows.DependencyObject, MS.Utility.FrugalStructList`1<System.Windows.ContainerDependent> ByRef, MS.Utility.FrugalStructList`1<System.Windows.ContainerDependent> ByRef, MS.Utility.FrugalStructList`1<System.Windows.ContainerDependent> ByRef)
 at System.Windows.StyleHelper.DoStyleInvalidations(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Windows.Style, System.Windows.Style)
 at System.Windows.StyleHelper.UpdateStyleCache(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Windows.Style, System.Windows.Style, System.Windows.Style ByRef)
 at System.Windows.FrameworkElement.OnStyleChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
 at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
 at System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty, Boolean)
 at System.Windows.ResourceReferenceExpression.InvalidateExpressionValue(System.Object, System.EventArgs)
 at System.Windows.TreeWalkHelper.InvalidateResourceReferences(System.Windows.DependencyObject, System.Windows.ResourcesChangeInfo)
 at System.Windows.TreeWalkHelper.OnResourcesChanged(System.Windows.DependencyObject, System.Windows.ResourcesChangeInfo, Boolean)
 at System.Windows.TreeWalkHelper.InvalidateOnResourcesChange(System.Windows.FrameworkElement, System.Windows.FrameworkContentElement, System.Windows.ResourcesChangeInfo)
 at System.Windows.ResourceDictionary.NotifyOwners(System.Windows.ResourcesChangeInfo)
 at System.Windows.ResourceDictionary.SetKeys(System.Collections.Generic.IList`1<System.Windows.Baml2006.KeyRecord>, System.IServiceProvider)
 at System.Windows.ResourceDictionary.SetDeferrableContent(System.Windows.DeferrableContent)
 at System.Windows.Baml2006.WpfSharedBamlSchemaContext+<>c.<Create_BamlProperty_ResourceDictionary_DeferrableContent>b__297_0(System.Object, System.Object)
 at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(System.Object, System.Object)
 at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(System.Xaml.XamlMember, System.Object, System.Object)
 at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(System.Object, System.Xaml.XamlMember, System.Object) Exception Info: System.Windows.Markup.XamlParseException
 at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
 at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
 at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
 at System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
 at System.Windows.Application.LoadComponent(System.Uri, Boolean)
 at System.Windows.Application.DoStartup()
 at System.Windows.Application.<.ctor>b__1_0(System.Object)
 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
 at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
 at System.Windows.Threading.DispatcherOperation.InvokeImpl()
 at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
 at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
 at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
 at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
 at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
 at System.Windows.Threading.DispatcherOperation.Invoke()
 at System.Windows.Threading.Dispatcher.ProcessQueue()
 at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
 at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
 at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
 at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
 at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
 at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
 at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
 at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
 at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
 at System.Windows.Application.RunDispatcher(System.Object)
 at System.Windows.Application.RunInternal(System.Windows.Window)
 at System.Windows.Application.Run(System.Windows.Window)
 at Re_MSTO_Launcher_For_UI.App.Main()程序本身没有调用第三方dll文件,在Windows10上能运行
请问有没有哪位大神能帮忙解决的

解决方案 »

  1.   

    Re_MSTO_Launcher_For_UI.exe 没找到,是不是有引用?
      

  2.   

    你在release模式下编译试试。
      

  3.   

    release模式编译了也还是这个报错
      

  4.   

    抓重点,问题一般出现在第一行描述上:The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException  ,找不到文件了,报错代码地点在下面找,具体文件得自己找,把报错的目录下的文件和能正常运行的一对比就知道了 
      

  5.   

    结个贴,代码本身没有问题,转成.Net 4.0就能正常运行。事实证明win7上面自带的.Net Framework 4.5以上的版本是有问题的,初步判断是有些dll有问题,win7要运行.Net 4.5的程序还是得重新安装.Net 4.5才行。这个破问题搞了我一个月才解决
      

  6.   

    https://msdn.microsoft.com/zh-cn/library/8z6watww(v=vs.110).aspx这辈子都不要用 4.5.2。