【问题标题】:Published project requires visual studio installed发布的项目需要安装 Visual Studio
【发布时间】:2013-11-27 06:37:15
【问题描述】:

我制作了一个 WPF 项目,该项目使用需要 .Net 4.0 的组件和另一个需要 .Net 4.5 的组件

我已将我的项目设置为面向 .Net 4.5

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

好像只有安装了Visual Studio的电脑,安装后才能打开程序。

我也尝试过安装“Microsoft .Net Framework 4.5 Multi-Targeting Pack”的想法,这可能是必需的 - 但程序仍然无法加载......

有什么想法吗?

编辑

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`

问候

【问题讨论】:

  • 有错误信息吗?您引用了哪些组件/组件(完整列表)?
  • 是调试版本还是发布版本?
  • 如果您不向我们提供错误消息(可以在事件管理器中找到),应用程序崩溃的原因可能有很多(.net frameworks 版本问题/os 版本/Visual C++ Redistributable 等) ) 这只是猜测工作
  • @user2724352:Windows 事件日志是否显示任何内容?
  • 另一种方法是查看“融合”/程序集加载日志(在调试器中通常很好),以查看您的应用正在加载哪些程序集。它可能很多,而不仅仅是您认为自己引用的那些。

标签: c# wpf installshield publish setup.exe


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-02-15
    • 2010-09-05
    • 1970-01-01
    • 2011-03-04
    • 1970-01-01
    • 2023-03-19
    相关资源
    最近更新 更多