Note that there are some explanatory texts on larger screens.

plurals
  1. POSystem.Web.dll different version giving me problems in vb.net
    primarykey
    data
    text
    <p>I have a VB.NET web application project written in VS2010 targeted to the .Net 2.0 framework (don't ask I know). I have a class with an import statement that says</p> <pre><code>Imports System.Web.HttpContext </code></pre> <p>Lower down I try to use</p> <pre><code>Current.Session("username") = "user" Current.Session("psswd") = "psswd" Current.Session("dbName") = "database" If (IsNothing(Current.Session("username")) Or IsNothing(Current.Session("psswd")) Or IsNothing(Current.Session("dbName"))) Then Current.Response.StatusCode = 402 Else ' Do some stuff here End if </code></pre> <p>It works fine on my personal machine (windows xp SP3) but breaks on the server. I can't debug it on the server so I'm relying on stack trace to give me the error.</p> <p>Stacktrace gives me</p> <pre><code>[NullReferenceException: Object variable or With block variable not set.] Microsoft.VisualBasic.CompilerServices.Container..ctor(Object Instance) +497860 Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +373 letter_main.Logon.login_user() in C:\VSProjects\letter_main\letter_main\Old_App_Code\Logon.vb:55 letter_main._Default.Page_Load(Object sender, EventArgs e) in C:\VSProjects\letter_main\letter_main\Default.aspx.vb:32 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +62 </code></pre> <p>Line 55 in Logon.vb is the line 'Current.Response.StatusCode = 402' which it should never get to if it managed to put the values in the session. I'm guessing it hasn't?</p> <p>So I investigated System.Web.dll on both of the machines and I found both were registered in the c:\%WINDIR%\assemblies from the location C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll but I had a different version on the server than on my local machine</p> <p>Version on server is: 2.0.50727.3053 Version on my machine is: 2.0.50727.3614</p> <p>Could this be the cause of my problem? Can anyone think of a good way to troubleshoot? The server is windows 2003, not sure if I can just copy it's System.Web.dll and use regasm to test on my local machine? I can't replace the server version as there are other web apps running there that will need it.</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.
 

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