XML deserialization exception occurs in EXE, but not during debugging - vb.net

I have a VB.net application that uses a custom serializable class to persist configuration settings. At startup, I deserialize the config file. This works perfectly in the debugger. I run the application in Visual Studio, it calls the LoadSettings function, and it instantiates the object. However, once I build the executable and run it, it generates an exception. Does anyone know why it is behaving differently between the debugger and compiled code?
The way the config file was created, was by serializing an object of class Settings, and writing that to a file using a StreamReader object. Pretty straightforward, I do it all the time.
Here's the subroutine:
Private Sub LoadSettings(FromFile As String)
Dim ser As New XmlSerializer(GetType(UtilityClasses.Settings))
Dim reader As New StreamReader(FromFile)
Settings = ser.Deserialize(reader)
reader.Close()
End Sub
And, on the ser.Deserialize() call, it raises this exception:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Configuration file MyUtility.config does not have root <configuration> tag (C:\Data\Code\MyUtility\bin\Debug\MyUtility.config line 2)
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
at System.Diagnostics.Switch.InitializeConfigSettings()
at System.Diagnostics.Switch.InitializeWithStatus()
at System.Diagnostics.Switch.get_SwitchSetting()
at System.Diagnostics.BooleanSwitch.get_Enabled()
at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly(Type type, String defaultNamespace, XmlSerializerImplementation& contract)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at CATPrd2Prt.Form1.LoadSettings(String FromFile) in C:\Data\Code\MyUtility\Form1.vb:line 99
at CATPrd2Prt.Form1.Form1_Load(Object sender, EventArgs e) in C:\Data\Code\MyUtility\Form1.vb:line 30
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3662 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
CATPrd2Prt
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Data/Clients/Inalfa/Code/CATPrd2Prt/CATPrd2Prt/bin/Debug/CATPrd2Prt.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3662 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3667 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3667 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3654 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3662 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3664 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Interop.INFITF
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///C:/Data/Clients/Inalfa/Code/CATPrd2Prt/CATPrd2Prt/bin/Debug/Interop.INFITF.DLL
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.1 built by: SP
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Aha, figured it out. Apparently, naming the config file "MyUtility.config" was causing some kind of problem with the deserializer. But I have no idea why it was different during Debugging. I changed the name to "MyUtility.config.xml" and it worked fine.

Related

When Building my exe it cant find my database

When I build my project on the computer with Visual basic my exe file works but as soon as I open the exe on my server I get an error that I think it doesn't my database. Doesn't this get compiled at the same time as my whole program? I see the database in the folder it gets compiled to. And any pictures I have load are the right connection string to the server. Not sure if I am missing anything else. This is the error it gives:
See the end of this message for details on invoking just-in-time
(JIT) debugging instead of this dialog box.
************** Exception Text ************** System.Data.SqlClient.SqlException (0x80131904): A network-related or
instance-specific error occurred while establishing a connection to
SQL Server. The server was not found or was not accessible. Verify
that the instance name is correct and that SQL Server is configured to
allow remote connections. (provider: SQL Network Interfaces, error: 52
- Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database
Runtime feature is enabled.) ---> System.ComponentModel.Win32Exception
(0x80004005): The system cannot find the file specified at
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, SqlCredential
credential, Object providerInfo, String newPassword, SecureString
newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString
userConnectionOptions, SessionData reconnectSessionData,
DbConnectionPool pool, String accessToken, Boolean
applyTransientFaultHandling, SqlAuthenticationProviderManager
sqlAuthProviderManager) at
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
DbConnectionPool pool, DbConnection owningConnection,
DbConnectionOptions userOptions) at
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool
pool, DbConnection owningObject, DbConnectionOptions options,
DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject, DbConnectionOptions userOptions, DbConnectionInternal
oldConnection) at
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject, DbConnectionOptions userOptions, DbConnectionInternal
oldConnection) at
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean
allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions
userOptions, DbConnectionInternal& connection) at
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
owningObject, TaskCompletionSource1 retry, DbConnectionOptions
userOptions, DbConnectionInternal& connection) at
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection
owningConnection, TaskCompletionSource1 retry, DbConnectionOptions
userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&
connection) at
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection
outerConnection, DbConnectionFactory connectionFactory,
TaskCompletionSource1 retry, DbConnectionOptions userOptions) at
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory,
TaskCompletionSource1 retry, DbConnectionOptions userOptions) at
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1
retry) at
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1
retry) at System.Data.SqlClient.SqlConnection.Open() at
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32
startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior
behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable
dataTable) at
Shipping_Bible.Client_CodeDataSet1TableAdapters.ClientTableAdapter.Fill(ClientDataTable
dataTable) in C:\Users\CMike\Desktop\Shipping Bible\Shipping
Bible\Client_CodeDataSet1.Designer.vb:line 1908 at
Shipping_Bible.FrmBible.FrmBible_Load(Object sender, EventArgs e) in
C:\Users\CMike\Desktop\Shipping Bible\Shipping Bible\FrmBible.vb:line
23 at System.Windows.Forms.Form.OnLoad(EventArgs e) at
System.Windows.Forms.Form.OnCreateControl() at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl() at
System.Windows.Forms.Control.WmShowWindow(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Message& m) at
System.Windows.Forms.Form.WmShowWindow(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
ClientConnectionId:00000000-0000-0000-0000-000000000000 Error
Number:2,State:0,Class:20
************** Loaded Assemblies ************** mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
---------------------------------------- Shipping Bible
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Shared/Common/Data/Shipping%20Bible/Shipping%20Bible.exe
---------------------------------------- Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
---------------------------------------- System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
---------------------------------------- System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4121.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
---------------------------------------- System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
---------------------------------------- System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
---------------------------------------- System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
---------------------------------------- System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
---------------------------------------- System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
---------------------------------------- Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
---------------------------------------- System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4121.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
---------------------------------------- System.Data.DataSetExtensions
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
---------------------------------------- System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
---------------------------------------- System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
---------------------------------------- System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer
(machine.config) must have the jitDebugging value set in the
system.windows.forms section. The application must also be compiled
with debugging enabled.
For example:
When JIT debugging is enabled, any unhandled exception will be sent to
the JIT debugger registered on the computer rather than be handled by
this dialog box.
Thank you

Access Data Base connection using app.config through null exception after running the installed application

i'm trying to connect database using app.config, the problem is it works fine in framework (visual studio 2012) but when i create the setup, after running it though quick launch it through null exception for the connection string, here is my connection and exception. The db file is placed in D:\Account\Account\bin\x86\Debug. By connection string it works fine but i want to use the app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="myconnection" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Account.accdb"
providerName="System.Data.OleDb" />
</connectionStrings>
</configuration>
myconnection = New OleDbConnection
Dim ConnectionString As String = ConfigurationManager.ConnectionStrings("myconnection").ConnectionString
'Dim ConnectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Account.accdb"
myconnection.ConnectionString = ConnectionString
myconnection.Open()
'Here is the null exception
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Account.Common.ConnectDb()
at Account.FrmLogin.FrmLogin_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18010 built by: FX45RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Account
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Manoj/My%20Product%20Name/Account.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 11.0.50709.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18016 built by: FX45RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

ImageResizer on Mono

I get the following error when using the ImageResizer module on Mono in Linux:
Server Error in '/' Application
Argument is out of range. Parameter name: date
Description: HTTP 500. Error processing request.
Stack Trace:
System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: date
at System.Web.HttpCachePolicy.SetLastModified (DateTime date) [0x00046] in /build/src/mono-2.10.8/mcs/class/System.Web/System.Web/HttpCachePolicy.cs:225
at ImageResizer.Caching.ResponseHeaders.DefaultApplyToResponseMethod (IResponseHeaders headers, System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at ImageResizer.Plugins.Basic.NoCacheHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator6.MoveNext () [0x00dad] in /build/src/mono-2.10.8/mcs/class/System.Web/System.Web/HttpApplication.cs:1368
at System.Web.HttpApplication.Tick () [0x00000] in /build/src/mono-2.10.8/mcs/class/System.Web/System.Web/HttpApplication.cs:932
Version information: Mono Runtime Version: 2.10.8 (tarball Sat Dec 31 02:07:23 UTC 2011); ASP.NET Version: 4.0.30319.1
Here is the debug sheet:
Image resizer diagnostic sheet 07/09/2012 14:15:41
3 Issues detected:
(Warning): To potentially see additional errors here, perform an image resize request.
(Warning): UrlAuthorizationModule.CheckUrlAccessForPrincipal is not supported on this runtime (are you running Mono?)
It may be possible for users to bypass UrlAuthorization rules you have defined for your website, and access images that would otherwise be protected. If you do not use UrlAuthorization rules, this should not be a concern. You may also re-implement your security rules by handling the Config.Current.Pipeline.AuthorizeImage event.
(Warning): NoCache is only for development usage, and cannot scale to production use.
Add DiskCache or CloudFront for production use
You are not using any paid bundles.
Registered plugins:
ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.MvcRoutingShim.MvcRoutingShimPlugin
Configuration:
<resizer>
<pipeline fakeExtensions=".ashx" />
<plugins>
<add name="MvcRoutingShim" />
</plugins>
</resizer>
Accepted querystring keys:
quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom,
Accepted file extensions:
bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi,
Environment information:
Running Apache on Unix 2.6.39.2 and CLR 4.0.30319.1
Trust level: Unrestricted
OS bitness:
Executing assembly: /usr/bin/mono
IntegratedPipeline: False
Loaded assemblies:
System.Runtime.Caching Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Messaging Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Transactions Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
Mono.Data.Tds Assembly: 4.0.0.0
Mono.Security Assembly: 4.0.0.0
System.Security Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
Mono.CSharp Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
App_global.asax_199cffe9 Assembly: 0.0.0.0
Microsoft.Web.Infrastructure Assembly: 1.0.0.0 File: 1.0.20105.407
dotless.Core Assembly: 1.3.0.3 File: 1.3.0.3 Info: 1.3.0.3
System.Web.WebPages.Razor Assembly: 1.0.0.0 File: 1.0.20105.407
System.Web.WebPages.Deployment Assembly: 1.0.0.0 File: 1.0.20105.407
System.Web.Razor Assembly: 1.0.0.0 File: 1.0.20105.407
ImageResizer Assembly: 3.2.3.302 File: 3.2.3.302 Info: 3-2-beta-3 Commit: 245e873
ImageResizer.Mvc Assembly: 3.2.3.302 File: 3.2.3.302 Info: 3-2-beta-3 Commit: 245e873
System.Web.WebPages Assembly: 1.0.0.0 File: 1.0.20105.407
System.Web.Mvc Assembly: 3.0.0.0 File: 3.0.20105.0
System.Web.Routing Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Web.Helpers Assembly: 1.0.0.0 File: 1.0.20105.407
System.Web.Abstractions Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Web.ApplicationServices Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Data.Linq Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Web.DynamicData Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.ComponentModel.DataAnnotations Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Xml.Linq Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Data.DataSetExtensions Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Web.Extensions Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Core Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.ServiceModel.Web Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 3.5.594.0
System.ServiceModel Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Xaml Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Runtime.Serialization Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.IdentityModel Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.EnterpriseServices Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Drawing Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Web.Services Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Data Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
Microsoft.CSharp Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
Mono.Posix Assembly: 4.0.0.0
Mono.WebServer2 Assembly: 0.4.0.0
mod-mono-server4 Assembly: 2.10.2.0
Mono.Web Assembly: 4.0.0.0 Info: 0.0.0.1
System.Xml Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Configuration Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
System.Web Assembly: 4.0.0.0 File: 4.0.0.0 Info: 0.0.0.1
mscorlib Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1
Any idea what could be going wrong here?
This is technically a bug in Mono - Both .NET 2.0 and .NET 4.0 convert the date to universal time before performing the conversion, while mono compares it to the local server time, failing to even normalize the two variables to ensure they have matching time zones.
Mono See code
public void SetLastModified (DateTime date)
{
if (date > DateTime.Now)
throw new ArgumentOutOfRangeException ("date");
if (have_last_modified && date < last_modified)
return;
have_last_modified = true;
last_modified = date;
}
.NET (both V2 and V4) (Use ILSpy, search HttpCachePolicy with System.Web loaded)
Or, click this link to see the disassembly.
Psuedocode for SetLastModified(DateTime date):
Convert date to universal time.
Round datetime down to the nearest multiple of 10,000,000 ticks
Verify that value is less than DateTime.UtcNow, and throw an exception if it's not.
If the local copy of the value has been set before and is 'newer' than this value, leave it alone.
Otherwise set the local copy of the value to the universal time version of the parameter.
Calling code (ImageResizer), /Core/Caching/ResponseHeaders.cs
//Sets the Last-Modifed: header
//The check against the current time is because files served from another server may have a modified date in the future, if the clocks are not synchronized.
//ASP.NET incorrectly blocks an future modified date from being sent, with an ArgumentOutOfRangeException
DateTime utc = headers.LastModified.ToUniversalTime();
if (utc != DateTime.MinValue && utc < DateTime.UtcNow) {
context.Response.Cache.SetLastModified(utc);
}
Finding a workaround to this that won't break something isn't very simple. MS SQL provides LastModified values in un-specified time zones, while filesystems provide UTC but can be in the future if they're from a remote server.
Since incoming DateTime values often don't include a timezone flag, normalization is very important.
Converting to UTC, testing, converting back to local, testing, then assigning might be a valid workaround.
I suggest editing /Core/Caching/ResponseHeaders.cs, method DefaultApplyToResponseMethod to use the following statement
if (utc != DateTime.MinValue && utc < DateTime.UtcNow && utc.ToLocalTime() < DateTime.Now) {
context.Response.Cache.SetLastModified(utc.ToLocalTime());
}
Please let me see if you notice a flaw in the logic; if I it works for you and passes the beta test it might be integrated into a future release.

ImageResizer showing no errors, but not working on IIS6

I just installed imageresizer on IIS6 .NET2 and downloaded the JCropExample2 sample project. I get no errors, but a: the images do not resize on page load and b: the cropping does not work. No errors are shown. I am new to .NET, so really not sure what I have missed??
ImageResizer Debug:
2 Issues detected:
(Warning): To potentially see additional errors here, perform an image resize request.
(Warning): NoCache is only for development usage, and cannot scale to production use.
Add DiskCache or CloudFront for production use
You are not using any paid bundles.
Registered plugins:
ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
Configuration:
<resizer>
<pipeline fakeExtensions=".ashx" />
<plugins />
</resizer>
Accepted querystring keys:
quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom,
Accepted file extensions:
bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi,
Environment information:
Running Microsoft-IIS/6.0 on Microsoft Windows NT 5.2.3790 Service Pack 2 and CLR 2.0.50727.3634
Trust level: Unrestricted
OS bitness: x86
Executing assembly: c:\windows\system32\inetsrv\w3wp.exe
IntegratedPipeline: False
Loaded assemblies:
mscorlib Assembly: 2.0.0.0 File: 2.0.50727.3634 Info: 2.0.50727.3634
System.Web Assembly: 2.0.0.0 File: 2.0.50727.3634 Info: 2.0.50727.3634
System Assembly: 2.0.0.0 File: 2.0.50727.3634 Info: 2.0.50727.3634
System.Xml Assembly: 2.0.0.0 File: 2.0.50727.3082 Info: 2.0.50727.3082
System.Configuration Assembly: 2.0.0.0 File: 2.0.50727.3053 Info: 2.0.50727.3053
System.Data Assembly: 2.0.0.0 File: 2.0.50727.3053 Info: 2.0.50727.3053
System.Web.RegularExpressions Assembly: 2.0.0.0 File: 2.0.50727.3053 Info: 2.0.50727.3053
Microsoft.JScript Assembly: 8.0.0.0 File: 8.0.50727.3053 Info: 8.0.50727.3053
System.Web.Mobile Assembly: 2.0.0.0 File: 2.0.50727.3053 Info: 2.0.50727.3053
System.ServiceModel Assembly: 3.0.0.0 File: 3.0.4506.3636 Info: 3.0.4506.3636
System.Web.Services Assembly: 2.0.0.0 File: 2.0.50727.3053 Info: 2.0.50727.3053
System.Drawing Assembly: 2.0.0.0 File: 2.0.50727.3639 Info: 2.0.50727.3639
System.EnterpriseServices Assembly: 2.0.0.0 File: 2.0.50727.3053 Info: 2.0.50727.3053
ImageResizer Assembly: 3.2.3.302 File: 3.2.3.302 Info: 3-2-beta-3 Commit: 245e873
System.ServiceModel.Web Assembly: 3.5.0.0 File: 3.5.594.1152 Info: 3.5.594.1152
System.WorkflowServices Assembly: 3.5.0.0 File: 3.5.594.1152 Info: 3.5.594.1152
System.Runtime.Serialization Assembly: 3.0.0.0 File: 3.0.4506.3636 Info: 3.0.4506.3636
System.IdentityModel Assembly: 3.0.0.0 File: 3.0.4506.3636 Info: 3.0.4506.3636
SMDiagnostics Assembly: 3.0.0.0 File: 3.0.4506.3636 Info: 3.0.4506.3636
It's working fine. You failed to read the step 3 of 3 on the homepage
<!-- Unless you (a) use Integrated mode, or (b) map all reqeusts to ASP.NET,
you'll need to add .ashx to your image URLs: image.jpg.ashx?width=200&height=20 -->
<pipeline fakeExtensions=".ashx" />
As you're using IIS6, which does not have Integrated mode, you have to use the .jpg.ashx syntax.
http://resizer.puremobi.com/JCropExample2/fountain-small.jpg.ashx?width=400

Entity Framework throws "System.Data.EntityException: The underlying provider failed on Open." while moving 10k+ records

I have an application where I move data from one table to another on the same database (some simple calculations are done). I use the entity framework to select the data from the first table and add it to the other table.I try to transfer appx. 100k rows and the problem is that it seems like it kills the connection to my database. After it has been running for a while I get the error below. Does anyone have a clue why that might happen?
NB. I am running on ms 2008 express.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__0[TResult](IEnumerable`1 sequence)
at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.First[TSource](IQueryable`1 source)
at DataExtractProgram.Form1.ect()
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
DataExtractProgram
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Apps/2.0/6LPXQTY9.K57/NMK5LWCH.01M/data..tion_edf9c07719516f7e_0001.0000_b19bec20c89bf848/DataExtractProgram.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
DataLayer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Apps/2.0/6LPXQTY9.K57/NMK5LWCH.01M/data..tion_edf9c07719516f7e_0001.0000_b19bec20c89bf848/DataLayer.DLL
----------------------------------------
System.Data.Entity
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.1 built by: SP
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.Entity/3.5.0.0__b77a5c561934e089/System.Data.Entity.dll
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.1 built by: SP
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
BusinessLayer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Apps/2.0/6LPXQTY9.K57/NMK5LWCH.01M/data..tion_edf9c07719516f7e_0001.0000_b19bec20c89bf848/BusinessLayer.DLL
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_64/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_64/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Runtime.Serialization
Assembly Version: 3.0.0.0
Win32 Version: 3.0.4506.2152 (SP.030729-0100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Serialization/3.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_64/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_64/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_64/mscorlib/2.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
I move data from one table to another on the same database (some simple calculations are done)
I'm not sure why you're not just doing:
insert into destination_table( a, c, f, m, n, p)
select a, b, c, d + e, f * c + .1 * b, g || h
from source_table
where some_predicate;
That is, including all your calculations in the select.
It is hard to tell, but it would be interesting to see what connections were active when it bombed... maybe it is spawning multiple somehow...
However; for transferring mass data, I would usually recommend either just a stored procedure (if the processing can be done in the database) - or if you need richer code, something like SqlBulkCopy hooked to an IDataReader - this will allow you to stream data from one table to the other with the minimum of buffering / overhead.
Representing an arbitrary data-source as an IDataReader (to feed to SqlBulkCopy) is a pain, but you can use SimpleDataReader for this. You would also use ExecuteReader on the source SqlCommand to consume the data from origin.