Note that there are some explanatory texts on larger screens.

plurals
  1. POObject fails to instantiate on Win7 x64
    primarykey
    data
    text
    <p>I've searched quite a bit and turned up nothing helpful so here I am.</p> <p>I have written an app in C# (Any CPU setting) that has been running on Windows 7 and XP x86 for some time now without error.</p> <p>Recently my office has upgraded my workstation to Windows 7 x64 (from x86).</p> <p>When I run my application in Visual Studio 2010 I receive no errors at run or compile time. It works as designed.</p> <p>My VS2010 version is 10.0.30319.1 RTMRel from our MSDN subscription, Framework is 4.0.30319 RTMRel</p> <p>When I run my compiled application directly I receive an error when with the SqlConnection object. It does not matter if i choose ANY CPU or x86 the same errors occur.</p> <p>In my class file this is the routine:</p> <pre><code> public static SqlConnection getDBConnection() { SqlConnection sqlConn = null; try { sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["KpH2Oprod"].ConnectionString); sqlConn.Open(); } catch { throw; } finally { if (sqlConn == null) { sqlConn.Dispose(); } } return sqlConn; } </code></pre> <p>Some manual tracing I found the error to be thrown not after <code>SqlConnection sqlConn = null;</code> when it's first instantiated but when I actually set it on the line:</p> <pre><code>sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["KpH2Oprod"].ConnectionString); </code></pre> <p>I have changed this line to:</p> <pre><code> sqlConn = new SqlConnection(); sqlConn.ConnectionString = ConfigurationManager.ConnectionStrings["KpH2Oprod"].ConnectionString; </code></pre> <p>to see if it was the SqlConnection or to Configuration manager and indeed it throws on the <code>sqlConn = new SqlConnection();</code> line. In fact this was the way I started and changed it to the previous, no matter, both throw error on using the new directive.</p> <p>The actual error message I get back is (some of which is my own message):</p> <p>I believe that this might be related to how the SQL object are registered but the message is truncate in the center of the first few lines (not my doing) that point to the parameter g being null. Again this works in the debugger flawlessly.</p> <pre><code>RunTimeError : Value cannot be null. Parameter name: g at System.Guid..ctor(String g) at kpH2O.frmMain..ctor() (mscorlib) ACTION : UPDATEINCIDENT () PROGRESS : WORKING () RunTimeError : Object reference not set to an instance of an object. at kpH2O.db.getDBConnection() at kpH2O.db.getIncidentIDFromNumber(String incidentNumber) at kpH2O.frmMain.updateHeatIncident() (kpH2O) ERROR : Process UPDATEINCIDENT: FAILED (doStartUp) </code></pre> <p>This is an out of the box VS2010 install without any addons. Any assistance is GREATLY appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload