0

我正在开发一个具有数据库的软件(我正在使用 SQL Server 2008),并且我想将它部署在客户端计算机上。所以我创建了一个使用 Visual Studio 安装程序项目的安装程序。

一切在我的计算机上运行良好(我尝试安装并测试它)但是当我将它安装在客户的计算机上时,它会出现以下错误:

Date and Time:         9/27/2013 9:42:58 PM
Machine Name:          USER-PC
IP Address:            fe80::642b:46db:a6db:6be6%13
Current User:          user-PC\user

Application Domain:    Demeter2012.exe
Assembly Codebase:     file:///C:/Program Files/Konekthing/Demeter/Demeter2012.exe
Assembly Full Name:    Demeter2012, Version=2.0.0.0, Culture=neutral,PublicKeyToken=null
Assembly Version:      2.0.0.0
Assembly Build Date:   9/20/2013 7:49:52 PM

Exception Source:      .Net SqlClient Data Provider
Exception Type:        System.Data.SqlClient.SqlException
Exception Message:     
Exception Target Site: OnError

---- Stack Trace ----
System.Data.SqlClient.SqlInternalConnection.OnError(exception As SqlException,breakConnection As Boolean)
   Demeter2012.exe: N 00162
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   Demeter2012.exe: N 00238
System.Data.SqlClient.TdsParser.Connect(serverInfo As ServerInfo, connHandler As SqlInternalConnectionTds, ignoreSniOpenTimeout As Boolean, timerExpire As Int64, encrypt As Boolean, trustServerCert As Boolean, integratedSecurity As Boolean)
   Demeter2012.exe: N 00315
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(serverInfo As ServerInfo, newPassword As String, ignoreSniOpenTimeout As Boolean, timeout As TimeoutTimer, owningObject As SqlConnection)
   Demeter2012.exe: N 00184
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(serverInfo As ServerInfo, newPassword As String, redirectedUserInstance As Boolean, owningObject As SqlConnection, connectionOptions As SqlConnectionString, timeout As TimeoutTimer)
   Demeter2012.exe: N 00312
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(owningObject As SqlConnection, timeout As TimeoutTimer, connectionOptions As SqlConnectionString, newPassword As String, redirectedUserInstance As Boolean)
   Demeter2012.exe: N 00200
System.Data.SqlClient.SqlInternalConnectionTds..ctor(identity As DbConnectionPoolIdentity, connectionOptions As SqlConnectionString, providerInfo As Object, newPassword As String, owningObject As SqlConnection, redirectedUserInstance As Boolean)
   Demeter2012.exe: N 00234
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(options As DbConnectionOptions, poolGroupProviderInfo As Object, pool As DbConnectionPool, owningConnection As DbConnection)
   Demeter2012.exe: N 00603
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(owningConnection As DbConnection, pool As DbConnectionPool, options As DbConnectionOptions)
   Demeter2012.exe: N 00031
System.Data.ProviderBase.DbConnectionPool.CreateObject(owningObject As DbConnection)
   Demeter2012.exe: N 00527
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(owningObject As DbConnection)
   Demeter2012.exe: N 00070
System.Data.ProviderBase.DbConnectionPool.GetConnection(owningObject As DbConnection)
   Demeter2012.exe: N 00471
System.Data.ProviderBase.DbConnectionFactory.GetConnection(owningConnection As DbConnection)
   Demeter2012.exe: N 00111
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(outerConnection As DbConnection, connectionFactory As DbConnectionFactory)
   Demeter2012.exe: N 00110
System.Data.SqlClient.SqlConnection.Open()
   Demeter2012.exe: N 00139
System.Data.Common.DbDataAdapter.FillInternal(dataset As DataSet, datatables As DataTable[], startRecord As Int32, maxRecords As Int32, srcTable As String, command As IDbCommand, behavior As CommandBehavior)
   Demeter2012.exe: N 00122
System.Data.Common.DbDataAdapter.Fill(dataTables As DataTable[], startRecord As Int32, maxRecords As Int32, command As IDbCommand, behavior As CommandBehavior)
   Demeter2012.exe: N 00164
System.Data.Common.DbDataAdapter.Fill(dataTable As DataTable)
   Demeter2012.exe: N 00113
Demeter2012.Model.DataSetTableAdapters.NodeTableAdapter.GetDataByActive()
   Demeter2012.exe: N 00100
Demeter2012.MonitorFunction.PopulateNodeId()
   Demeter2012.exe: N 00067
Demeter2012.MonitorFunction.PopulateNodeIDComboBoxes()
   Demeter2012.exe: N 00015
Demeter2012.MainWindow.Window_Loaded(sender As Object, e As RoutedEventArgs)
   Demeter2012.exe: N 00047
System.Windows.RoutedEventHandlerInfo.InvokeHandler(target As Object, routedEventArgs As RoutedEventArgs)
   Demeter2012.exe: N 00100
System.Windows.EventRoute.InvokeHandlersImpl(source As Object, args As RoutedEventArgs, reRaised As Boolean)
   Demeter2012.exe: N 00312
System.Windows.UIElement.RaiseEventImpl(sender As DependencyObject, args As RoutedEventArgs)
   Demeter2012.exe: N 00246
System.Windows.UIElement.RaiseEvent(e As RoutedEventArgs)
   Demeter2012.exe: N 00019
System.Windows.BroadcastEventHelper.BroadcastEvent(root As DependencyObject, routedEvent As RoutedEvent)
   Demeter2012.exe: N 00315
System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(root As Object)
   Demeter2012.exe: N 00144
MS.Internal.LoadedOrUnloadedOperation.DoWork()
   Demeter2012.exe: N 00021
System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   Demeter2012.exe: N 00072
System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   Demeter2012.exe: N 00149
System.Windows.Media.MediaContext.RenderMessageHandlerCore(resizedCompositionTarget As Object)
   Demeter2012.exe: N 00138
System.Windows.Media.MediaContext.RenderMessageHandler(resizedCompositionTarget As Object)
   Demeter2012.exe: N 00139
System.Windows.Media.MediaContext.Resize(resizedCompositionTarget As ICompositionTarget)
   Demeter2012.exe: N 00059
System.Windows.Interop.HwndTarget.OnResize()
   Demeter2012.exe: N 00369
System.Windows.Interop.HwndTarget.HandleMessage(msg As WindowMessage, wparam As IntPtr, lparam As IntPtr)
   Demeter2012.exe: N 00865
System.Windows.Interop.HwndSource.HwndTargetFilterMessage(hwnd As IntPtr, msg As Int32, wParam As IntPtr, lParam As IntPtr, handled As Boolean&)
   Demeter2012.exe: N 00041
MS.Win32.HwndWrapper.WndProc(hwnd As IntPtr, msg As Int32, wParam As IntPtr, lParam As IntPtr, handled As Boolean&)
   Demeter2012.exe: N 00189
MS.Win32.HwndSubclass.DispatcherCallbackOperation(o As Object)
   Demeter2012.exe: N 00124
System.Windows.Threading.ExceptionWrapper.InternalRealCall(callback As Delegate, args As Object, numArgs As Int32)
   Demeter2012.exe: N 00082
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(source As Object, method As Delegate, args As Object, numArgs As Int32, catchHandler As Delegate)
   Demeter2012.exe: N 00065
System.Windows.Threading.Dispatcher.InvokeImpl(priority As DispatcherPriority, timeout As TimeSpan, method As Delegate, args As Object, numArgs As Int32)
   Demeter2012.exe: N 00179
MS.Win32.HwndSubclass.SubclassWndProc(hwnd As IntPtr, msg As Int32, wParam As IntPtr, lParam As IntPtr)
   Demeter2012.exe: N 00259
MS.Win32.UnsafeNativeMethods.ShowWindow(hWnd As HandleRef, nCmdShow As Int32)
   Demeter2012.exe: N 00000
System.Windows.Window.ShowHelper(booleanBox As Object)
   Demeter2012.exe: N 00270
System.Windows.Window.Show()
   Demeter2012.exe: N 00061
Demeter2012.LogIn.btn_login_Click(sender As Object, e As RoutedEventArgs)
   Demeter2012.exe: N 00249
System.Windows.RoutedEventHandlerInfo.InvokeHandler(target As Object, routedEventArgs As RoutedEventArgs)
   Demeter2012.exe: N 00100
System.Windows.EventRoute.InvokeHandlersImpl(source As Object, args As RoutedEventArgs, reRaised As Boolean)
   Demeter2012.exe: N 00312
System.Windows.UIElement.RaiseEventImpl(sender As DependencyObject, args As RoutedEventArgs)
   Demeter2012.exe: N 00246
System.Windows.UIElement.RaiseEvent(e As RoutedEventArgs)
   Demeter2012.exe: N 00019
System.Windows.Controls.Primitives.ButtonBase.OnClick()
   Demeter2012.exe: N 00055
System.Windows.Controls.Button.OnClick()
   Demeter2012.exe: N 00079
System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(e As MouseButtonEventArgs)
   Demeter2012.exe: N 00157
System.Windows.UIElement.OnMouseLeftButtonUpThunk(sender As Object, e As MouseButtonEventArgs)
   Demeter2012.exe: N 00074
System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(genericHandler As Delegate, genericTarget As Object)
   Demeter2012.exe: N 00048
System.Windows.RoutedEventArgs.InvokeHandler(handler As Delegate, target As Object)
   Demeter2012.exe: N 00039
System.Windows.RoutedEventHandlerInfo.InvokeHandler(target As Object, routedEventArgs As RoutedEventArgs)
   Demeter2012.exe: N 00118
System.Windows.EventRoute.InvokeHandlersImpl(source As Object, args As RoutedEventArgs, reRaised As Boolean)
   Demeter2012.exe: N 00312
System.Windows.UIElement.ReRaiseEventAs(sender As DependencyObject, args As RoutedEventArgs, newEvent As RoutedEvent)
   Demeter2012.exe: N 00259
System.Windows.UIElement.OnMouseUpThunk(sender As Object, e As MouseButtonEventArgs)
   Demeter2012.exe: N 00177
System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(genericHandler As Delegate, genericTarget As Object)
   Demeter2012.exe: N 00048
System.Windows.RoutedEventArgs.InvokeHandler(handler As Delegate, target As Object)
   Demeter2012.exe: N 00039
System.Windows.RoutedEventHandlerInfo.InvokeHandler(target As Object, routedEventArgs As RoutedEventArgs)
   Demeter2012.exe: N 00118
System.Windows.EventRoute.InvokeHandlersImpl(source As Object, args As RoutedEventArgs, reRaised As Boolean)
   Demeter2012.exe: N 00312
System.Windows.UIElement.RaiseEventImpl(sender As DependencyObject, args As RoutedEventArgs)
   Demeter2012.exe: N 00246
System.Windows.UIElement.RaiseTrustedEvent(args As RoutedEventArgs)
   Demeter2012.exe: N 00060
System.Windows.Input.InputManager.ProcessStagingArea()
   Demeter2012.exe: N 00654
System.Windows.Input.InputManager.ProcessInput(input As InputEventArgs)
   Demeter2012.exe: N 00067
System.Windows.Input.InputProviderSite.ReportInput(inputReport As InputReport)
   Demeter2012.exe: N 00079
System.Windows.Interop.HwndMouseInputProvider.ReportInput(hwnd As IntPtr, mode As InputMode, timestamp As Int32, actions As RawMouseActions, x As Int32, y As Int32, wheel As Int32)
   Demeter2012.exe: N 00981
System.Windows.Interop.HwndMouseInputProvider.FilterMessage(hwnd As IntPtr, msg As WindowMessage, wParam As IntPtr, lParam As IntPtr, handled As Boolean&)
   Demeter2012.exe: N 01063
System.Windows.Interop.HwndSource.InputFilterMessage(hwnd As IntPtr, msg As Int32, wParam As IntPtr, lParam As IntPtr, handled As Boolean&)
   Demeter2012.exe: N 00109
MS.Win32.HwndWrapper.WndProc(hwnd As IntPtr, msg As Int32, wParam As IntPtr, lParam As IntPtr, handled As Boolean&)
   Demeter2012.exe: N 00189
MS.Win32.HwndSubclass.DispatcherCallbackOperation(o As Object)
   Demeter2012.exe: N 00124
System.Windows.Threading.ExceptionWrapper.InternalRealCall(callback As Delegate, args As Object, numArgs As Int32)
   Demeter2012.exe: N 00082
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(source As Object, method As Delegate, args As Object, numArgs As Int32, catchHandler As Delegate)
   Demeter2012.exe: N 00065
System.Windows.Threading.Dispatcher.InvokeImpl(priority As DispatcherPriority, timeout As TimeSpan, method As Delegate, args As Object, numArgs As Int32)
   Demeter2012.exe: N 00179
MS.Win32.HwndSubclass.SubclassWndProc(hwnd As IntPtr, msg As Int32, wParam As IntPtr, lParam As IntPtr)
   Demeter2012.exe: N 00259
MS.Win32.UnsafeNativeMethods.DispatchMessage(msg As MSG&)
   Demeter2012.exe: N 00000
System.Windows.Threading.Dispatcher.PushFrameImpl(frame As DispatcherFrame)
   Demeter2012.exe: N 00192
System.Windows.Threading.Dispatcher.PushFrame(frame As DispatcherFrame)
   Demeter2012.exe: N 00072
System.Windows.Application.RunDispatcher(ignore As Object)
   Demeter2012.exe: N 00039
System.Windows.Application.RunInternal(window As Window)
   Demeter2012.exe: N 00291
System.Windows.Application.Run(window As Window)
   Demeter2012.exe: N 00040
Demeter2012.App.Main()
   Demeter2012.exe: N 00053

既然大家都问了,这里我在我的 App.config 文件中为您提供我的连接字符串:

<?xml version="1.0"?>
   <configuration>
   <configSections>
   </configSections>
   <connectionStrings>
      <add name="Demeter2012.Properties.Settings.Demeter_DbConnectionString"
          connectionString="Data Source=MOHAMMADFAJARRI\SURROGATES;Initial Catalog=DB_Demeter;Persist Security Info=True;User ID=sa;Password=wsnadmin;"
        providerName="System.Data.SqlClient" />
   </connectionStrings>
   <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>

附带说明:User-PC 是我的客户端计算机的名称,MOHAMMADFAJARRI 是我的计算机的名称。SURROGATES 是 SQL Server 中存储此应用程序使用的数据库 DB_Demeter 的服务器的名称

关于我在哪里做错的任何建议?

4

0 回答 0