Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Deploy ASP.Net app

I gave my app to a client. I didnt "package" it. I compiled it and gave them the folder. They installed it on a webserver and only the first page comes up. When the app gets to "dbconnection.open", they get a null-reference.

I added debug steps to the code...thinking maybe the userID is null or maybe the connection string is null but they're not. They can also ping the server that has SQL server on it from the web server...

***Do I need to "package" the app ? I remember in VB6, packaging the app included all the necessary dlls in the package..so if a server doesnt have the dlls..it would get it with the package...

*** what is the dll that sql connection looks for? I have sqlsvr32.dll on my laptop...

Thanks for any help...

Avatar of Velio
Velio
Flag of South Africa image

you don't need to package it if you're using System.Data.SqlClient to connect to the DB, they'll already have it when they installed the .NET framework.

i would check the following:
1. is the connection string valid (you say they can ping the server, but that doesn't necessarily mean they can connect to it), eg check database permissions, sql remote connection settings, protocols etc.
2. is IIS using the same ASP.NET version on the client environment as it is on your dev environment.
Avatar of Camillia

ASKER

Thanks for answering... finally someone answered ! :)

1."sql remote connection settings"... Do i need "trusted connection =False" or something?

2. "same ASP.Net version".. how can I check this?

 
well depending on what the SQL Server authentication mechanism is used, you'll have to adjust your connection string - ie if it's using windows authentication, you'll have to add a login to SQL for the aspnet user. but a SQL login error would not normally throw a null-reference exception... do you have more error info and some code?

to check the ASP.NET version you can either open up the IIS configuration (Control Panel > Administrative Tools > IIS) and check in the properties of the app (the ASP.NET tab for IIS6, i think you'll have to look up in the application pool settings for IIS7). Alternatively if your exception isn't caught and you get the generic ASP.NET error screen, the version would appear at the very bottom of the page after the error message details.
SOLUTION
Avatar of jay_eire
jay_eire
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
1.They're not using Windows authentication. They're using Login authentication. They created the login/pwd in the database. They say they've made that login a dbo owner. *** I havent checked to make sure what they're saying is correct . I will do that ***

2. I think they have IIS6 and I asked them to make sure the site is 2.0 and not 1.1. Will double check this again

3. Yes, i do have code. I even added debugging to it and gave it to them. It logged to a textfile and what I  suspected that could be null...were not null. My code is below.

4. I dont have "trusted connection" in my webconfig.

**** The "debug" code in "try-finally" didnt get logged in to the textfile. So, dbconnection.open even fails.

*** I'm guessing something related to sql server is missing on their box but i really dont know...
*** The error is this and points to "dbmanager.close". So, it cant even open a connection and it tries to close it..

System.NullReferenceException
Object reference not set to an instance of an object.


 Dim dbManager As IDBManager = New DBManager(WebDAL.Source.UniWeb.Data.Common.DBTools.DBType)
 
            dbManager.ConnectionString = ConfigurationManager.ConnectionStrings("VQDBase").ConnectionString.ToString
 
            ''debug code
            Dim uniFilePath As String = System.Web.HttpContext.Current.Server.MapPath("debug" & Now.Second & ".txt")
            If Not File.Exists(uniFilePath) Then
                Dim fs As FileStream = File.Create(uniFilePath)
                fs.Close()
            End If
 
 
            Dim writer As StreamWriter
            writer = File.AppendText(uniFilePath)
            writer.WriteLine("server selection:" & WebDAL.Source.UniWeb.Data.Common.DBTools.DBType.ToString & " --connection:" & dbManager.ConnectionString)
 
 
 
            writer.WriteLine("userlogin: " & userLogin)
 
            'debug code
 
 
            Try
                dbManager.Open()
 
                 writer.WriteLine("After db open")
 
 
                'add parameters
                dbManager.CreateParameters(1)
                dbManager.AddParameters(0, "@UserLogin", userLogin, ParameterDirection.Input, 10)
 
                dbManager.ExecuteReader(CommandType.StoredProcedure, "usp_UserAccess")
 
                'writer.WriteLine("after calling SP")
 
 
                While (dbManager.DataReader.Read)
 
                    retVal.Add(dbManager.DataReader(0).ToString())
 
 
                End While
 
 
            Catch ex As Exception
              
                Throw (ex)
 
            Finally
                 writer.Close()
                dbManager.CloseReader()
                dbManager.Close()
 
            End Try

Open in new window

Jay - I just saw your msg. Let me read.

I dont have acces to their webserver...but i have access to another server and I did a telnet on port80 to the IP address of the webserver and I got an error that cannot connect..

*** I emailed them to try telneting from the webserver themselves. Howcome ping works tho??
Hi Farzadw,
you will need to check the connectivity from the web server where you have deployed your application and telnet to the SQL server from there.

Thanks
Jay
I emailed the client to do that. Will have to wait until tomorrow.
Client says they dont need to telnet because the sql-server is not a webserver.  Maybe telnet is not used to test connectivity. I asked him to see if he has a sql server management studio to test connectivitiy.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks..they're on SQL2000..can they still use telnet to test it?
i guess so...there's a command for it.. thanks
Thank you both for your help. This is resolved now. I created a "package' in dotnet and that did it. I guess something was missing on their web server.
Excellent news Farzadw.