C# 发布的项目需要安装visual studio

C# 发布的项目需要安装visual studio,c#,wpf,installshield,publish,setup.exe,C#,Wpf,Installshield,Publish,Setup.exe,我制作了一个WPF项目,它使用需要.NET4.0的组件和另一个需要.NET4.5的组件 我已将我的项目设置为目标.NET4.5 我用InnoSetup和MSI(InstallShield)安装程序制作了一个setup.exe 似乎只有安装了Visual Studio的pc才能在安装后打开程序 我也尝试过安装“Microsoft.Net Framework 4.5多目标包”,这可能是必需的,但程序仍然无法加载 有什么想法吗 编辑 Windows事件日志 Program: BingTestWPF.e

我制作了一个WPF项目,它使用需要.NET4.0的组件和另一个需要.NET4.5的组件

我已将我的项目设置为目标.NET4.5

我用InnoSetup和MSI(InstallShield)安装程序制作了一个setup.exe

似乎只有安装了Visual Studio的pc才能在安装后打开程序

我也尝试过安装“Microsoft.Net Framework 4.5多目标包”,这可能是必需的,但程序仍然无法加载

有什么想法吗

编辑

Windows事件日志

Program: BingTestWPF.exe
Framework-version: v4.0.30319
Beskrivelse: Denne proces blev afsluttet pga. en ubehandlet undtagelse.
Undtagelsesoplysninger: System.Windows.Markup.XamlParseException
Stak:
ved System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader,     System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
ved System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
ved System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
ved System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
ved System.Windows.Application.LoadComponent(System.Uri, Boolean)
ved System.Windows.Application.DoStartup()
ved System.Windows.Application.<.ctor>b__1(System.Object)
ved System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
ved MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
ved System.Windows.Threading.DispatcherOperation.InvokeImpl()
ved System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
ved System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
ved System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
ved System.Windows.Threading.DispatcherOperation.Invoke()
ved System.Windows.Threading.Dispatcher.ProcessQueue()
ved System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
ved MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
ved MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
ved System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
ved MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
ved System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
ved MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
ved MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
ved MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
ved System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
ved System.Windows.Application.RunInternal(System.Windows.Window)
ved System.Windows.Application.Run()
ved BingTestWPF.App.Main()`


Assembly list :

DlhSoft.Data.Controls
DlhSoft.Data.Core
DlhSoft.HierarchicalData.Controls
DlhSoft.HierarchicalData.Core
DlhSoft.ProjectData.Core
DlhSoft.ProjectData.GanttChart.Controls
DlhSoft.ProjectData.Management.Controls
Microsoft.CSharp
Microsoft.Maps.MapControl.WPF
PresentationCore
PresentationFramework
SpreadsheetGear2012.Core
System
System.Core
System.Data
System.Data.DataSetExtensions
System.Drawing
System.EnterpriseServices
System.Web.Services
System.Windows.Forms
System.Xaml
System.Xml
System.Xml.Linq
WindowsBase`
程序:BingTestWPF.exe
框架版本:v4.0.30319
Beskrivelse:Denne proces blev AFSLUTTE pga。恩,乌贝汉德,让我们再谈一谈。
UndTagelSeoplySninger:System.Windows.Markup.XamlParseException
斯塔克:
ved System.Windows.Markup.wpfxamloader.Load(System.Xaml.XamlReader、System.Xaml.IXamlObjectWriterFactory、布尔值、System.Object、System.Xaml.XamlObjectWriterSettings、System.Uri)
ved System.Windows.Markup.wpfxamloader.LoadBaml(System.Xaml.XamlReader,Boolean,System.Object,System.Xaml.Permissions.XamlAccessLevel,System.Uri)
ved System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream、System.Windows.Markup.ParserContext、System.Object、Boolean)
ved System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream、System.Windows.Markup.ParserContext)
ved System.Windows.Application.LoadComponent(System.Uri,布尔值)
ved System.Windows.Application.DoStartup()
ved System.Windows.Application.b__1(System.Object)
ved System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32)
ved MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate)
ved System.Windows.Threading.DispatcherOperation.InvokeImpl()
ved System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)
ved System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)
ved System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object)
ved System.Windows.Threading.DispatcherOperation.Invoke()
ved System.Windows.Threading.Dispatcher.ProcessQueue()
ved System.Windows.Threading.Dispatcher.WndProcHook(IntPtr、Int32、IntPtr、IntPtr、Boolean ByRef)
ved MS.Win32.hwndwapper.WndProc(IntPtr、Int32、IntPtr、IntPtr、Boolean ByRef)
ved MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
ved System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32)
ved MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate)
ved System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32)
ved MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr,IntPtr)
已保存MS.Win32.UnsafentiveMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
已保存MS.Win32.UnsafentiveMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
ved System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
ved System.Windows.Application.RunInternal(System.Windows.Window)
ved System.Windows.Application.Run()文件
ved BingTestWPF.App.Main()`
汇编清单:
DlhSoft.Data.Controls
DlhSoft.Data.Core
DlhSoft.hierarcialdata.Controls
DlhSoft.hierarcialdata.Core
DlhSoft.ProjectData.Core
DlhSoft.ProjectData.GanttChart.Controls
DlhSoft.ProjectData.Management.Controls
Microsoft.CSharp
Microsoft.Maps.MapControl.WPF
展示中心
呈现框架
电子表格齿轮2012.核心
系统
系统核心
系统数据
System.Data.DataSetExtensions
系统图
系统企业服务
System.Web.Services
System.Windows.Forms
System.Xaml
命名空间
System.Xml.Linq
窗台`

关于

我通过在机器上安装重新分发包解决了这个问题。似乎我正在使用一些dll程序集,因为项目设置为64位


但是,如果我将应用程序设置为在32位上运行,则不需要这些,并且应用程序可以在没有该软件包的情况下运行。

是否有任何错误消息?您引用了哪些组件/程序集(完整列表)?是调试构建还是发布构建?如果应用程序不提供错误消息(可以在事件管理器中找到),那么应用程序崩溃可能有很多原因(.NETFraskFraseObjs/OSValue/VisualC++ + RealDeDeDeTable)。这只是猜测work@user2724352:Windows事件日志是否显示任何内容?另一种方法是查看“fusion”/程序集加载日志(在调试器中通常可以),以查看应用程序正在加载哪些程序集。它可能不仅仅是你认为你在引用的那些。