Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#WPF-应用程序不';安装后不要启动_C#_Wpf_Deployment_Installation - Fatal编程技术网

C#WPF-应用程序不';安装后不要启动

C#WPF-应用程序不';安装后不要启动,c#,wpf,deployment,installation,C#,Wpf,Deployment,Installation,我正试图在VisualStudio2019中使用安装向导部署我的C#WPF应用程序。 当我在我的dev计算机上安装应用程序时,通过我所做的设置,它运行良好,我可以启动已安装的应用程序,所有事情都正常工作。 当我在另一台计算机上安装应用程序时,它会显示SplashScreen,然后什么也没发生 我查看了windows的事件日志,发现我的应用程序有两个错误 错误(日志名称:应用程序,源:.NET运行时,事件ID:1026,级别:错误) 我尝试重新安装SQL Server或.NET Framework

我正试图在VisualStudio2019中使用安装向导部署我的C#WPF应用程序。 当我在我的dev计算机上安装应用程序时,通过我所做的设置,它运行良好,我可以启动已安装的应用程序,所有事情都正常工作。 当我在另一台计算机上安装应用程序时,它会显示SplashScreen,然后什么也没发生

我查看了windows的事件日志,发现我的应用程序有两个错误

  • 错误(日志名称:应用程序,源:.NET运行时,事件ID:1026,级别:错误)
  • 我尝试重新安装SQL Server或.NET Framework,但没有任何帮助


    我不知道问题出在哪里,也没有在网上找到答案。

    我找到了。尚未在目标计算机上安装Microsoft SQL 2016 Express LocalDB。
    感谢您的帮助。

    确保在安装时复制所有依赖项。检查您的Solution.Project.References是否存在目标计算机上不存在的DLL、项目引用?它们都是复制的,.NET FrameworkIt的引用除外。它告诉您调用堆栈中的问题。VS_MVVM.Model.LanguageCollection.GetSelectedLanguage()方法在SQL连接上失败。也许你的连接字符串坏了?防火墙等?连接字符串是正确的。数据库文件是本地文件,位于用户文件夹中的AppData文件夹中。所以不应该有许可问题。
    Application: VS_MVVM.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.ComponentModel.Win32Exception
    
    Exception Info: System.Data.SqlClient.SqlException
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(System.Data.ProviderBase.DbConnectionPoolIdentity, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SqlCredential, System.Object, System.String, System.Security.SecureString, Boolean, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SessionData, System.Data.ProviderBase.DbConnectionPool, System.String, Boolean, System.Data.SqlClient.SqlAuthenticationProviderManager)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(System.Data.Common.DbConnectionOptions, System.Data.Common.DbConnectionPoolKey, System.Object, System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions, System.Data.Common.DbConnectionPoolKey, System.Data.Common.DbConnectionOptions)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal)
       at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(System.Data.Common.DbConnection, UInt32, Boolean, Boolean, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef)
       at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef)
       at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal, System.Data.ProviderBase.DbConnectionInternal ByRef)
       at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions)
       at System.Data.SqlClient.SqlConnection.TryOpenInner(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>)
       at System.Data.SqlClient.SqlConnection.TryOpen(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>)
       at System.Data.SqlClient.SqlConnection.Open()
       at VS_MVVM.Model.LanguageCollection.GetSelectedLanguage()
       at VS_MVVM.ViewModel.MainViewModel.LoadLanguage()
       at VS_MVVM.ViewModel.MainViewModel..ctor()
    
    Exception Info: System.Windows.Markup.XamlParseException
       at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
       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.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.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.Application.RunDispatcher(System.Object)
       at System.Windows.Application.RunInternal(System.Windows.Window)
       at VS_MVVM.App.Main()
    
    Faulting application name: VS_MVVM.exe, version: 1.0.0.0, time stamp: 0xf0d82005
    Faulting module name: KERNELBASE.dll, version: 10.0.18362.356, time stamp: 0x7083db20
    Exception code: 0xe0434352
    Fault offset: 0x000000000003a839
    Faulting process id: 0x1d40
    Faulting application start time: 0x01d589b244b41838
    Faulting application path: C:\Program Files (x86)\Test\Test\VS_MVVM.exe
    Faulting module path: C:\Windows\System32\KERNELBASE.dll
    Report Id: cd987b9b-2182-4587-8b2f-25389663ea9a
    Faulting package full name: 
    Faulting package-relative application ID: