|
-
Oct 1st, 2003, 03:29 PM
#1
Thread Starter
Lively Member
Deployment Issue
I'm having a problem when I go to deploy the app I just wrote onto a users machine. I went thru the steps listed in here:
ms-help://MS.VSCC/MS.MSDNVS/vsintro7/html/vbtskcreatinginstallerforyourapplication.htm
to create a setup.exe. Everything SEEMS to be OK at this point. I, of course can run the .exe that was placed on my local drive when I ran the setup.exe. When I go to the users machine and run the setup.exe everything SEEMS fine but when they run the .exe they receive a very generic error:
Application has generated an exception that could not be handled. Process id=0x58c(1420), Thread id=0x5b4(1460)
I then tried to track the problem down by having the user log into my machine and run the .exe which worked just fine. I went to their machine & logged in and tried to run and received the same error (just different id numbers). I think that this narrows it down to something specific to the users machine. This user has previously run apps on her machine that have beed written in .NET & have the same third party controls (Infragistics).
Can anyone suggest any other areas to look at to solve this problem? Has anyone come up against this before?
Thanks,
Corinne
-
Oct 1st, 2003, 09:35 PM
#2
Lively Member
use try catch blocks around everything and msgbox the results., like this:
try
'your code here
catch ex as exception
msgbox ex.message & vbcrlf & ex.stacktrace
end try
if its a console app, open a cmd window and run it from there. that way you can see the errors
That is waaaaay simplified error handling. I have code that will show the stack and error messages recursively, log it to a file, email etc. if anyone is interested. works great and that way you have a complete history of everything that caused the error. I use infragistics controls myself. did you register them to the GAC or did you leave them in the apps directory?
-
Oct 2nd, 2003, 08:09 AM
#3
Thread Starter
Lively Member
Mike,
Thanks for responding.
In further efforts to solve my problem, I used the Just In Time Debugger & received a message: The connection string has not been initialized. I went in & checked my connection string (which is in a xml config file).
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="data source=STKPROD04;initial catalog=STKPRODDB;integrated security=SSPI;persist security info=False;workstation id=IT22I;packet size=4096" />
</appSettings>
</configuration>
Since I'm having problems trying to put this out on a users machine I took of the Workstation ID & packet size so now I have:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="data source=STKPROD04;initial catalog=STKPRODDB;integrated security=SSPI;persist security info=False" />
</appSettings>
</configuration>
Is this connection string written OK? Do I need to take off the persist security info=False part? Any help is appreciated.
I would be interested to see the code you have to will show the stack and error messages.
Thanks,
Corinne
-
Oct 2nd, 2003, 08:13 AM
#4
Lively Member
How are you getting your connection string out of the config file, via AppSettings?
What provider are you using for your datasource? IE what database are you working with?
-
Oct 2nd, 2003, 08:37 AM
#5
Sleep mode
Is it neccessary to store you connection string in XML file ? I wouldn't bother if I were you . I used to put it in a module in a way it's global to all members of my classes .
-
Oct 2nd, 2003, 08:39 AM
#6
Lively Member
he is going about it the right way. If it is in app.config, he can change that file and not have to recompile the whole app, which is what you will have to do with your "put everything in a module" approach.
-
Oct 2nd, 2003, 08:42 AM
#7
Thread Starter
Lively Member
Mike,
Yes, I'm getting the string out of the config file via AppSettings. The database is SQL.
Pirate,
Yes, at this point I want to stay with the config file, if someone can I just need to know if I have it written correctly.
Thanks
-
Oct 2nd, 2003, 08:45 AM
#8
Sleep mode
Originally posted by MikeStammer
he is going about it the right way. If it is in app.config, he can change that file and not have to recompile the whole app, which is what you will have to do with your "put everything in a module" approach.
I always assume he's in debugging mode . Yes , he's .
Can you tell me what's wrong with a module ? C# programmers wish they have one .
-
Oct 2nd, 2003, 08:46 AM
#9
Lively Member
That error usually means the connection string is blank. I have seen that error as well when using oracle 9 client with oracle 7 database.
Here is basic code:
dim cn as sqlConnection = new sqlConnection(appsettings("ConnString"))
msgbox cn.connectionstring
cn.open
if you dont see your connection string when msgbox is called, there is an issue with pulling the value from app.config. Check spelling and capitalization and we can go from there.
-
Oct 2nd, 2003, 08:47 AM
#10
Thread Starter
Lively Member
Mike,
In response to your question earlier about infragistics. I left them in the apps directory. Can you explain what GAC is? Also would you be willing to have further discussions about infragistics? I'm having trouble finding someone to bounce questions off of & the infragistics site leaves a lot to be desired in the way of help.
Thanks,
Corinne
-
Oct 2nd, 2003, 08:50 AM
#11
Lively Member
GAC - Global assembly cache. Usually c:\windows\assembly. basically you can put a control there and any app can use it vs leaving it in the app directory for just one app to use.
You can ask anything you want. I will help out no problem, but I only use WinControls as far as Infragistics controls go. I hate web development.
-
Oct 2nd, 2003, 08:50 AM
#12
Lively Member
Putting things in a module is not the best way to do things. I have written dozens of programs and have never used a module to declare variables. Its just not the right way to code things now that .NET is here
-
Oct 2nd, 2003, 08:51 AM
#13
Thread Starter
Lively Member
Mike,
I did as you suggested and the connection string is fine. I get the results I need in the message box.
-
Oct 2nd, 2003, 08:51 AM
#14
Sleep mode
Originally posted by MikeStammer
Check spelling and capitalization and we can go from there.
Connection string is not case sensitive .
-
Oct 2nd, 2003, 08:52 AM
#15
Lively Member
but XML is. I was not speaking of what the connection string is, but the key value in the XML config file.
were you able to call cn.open without errors?
-
Oct 2nd, 2003, 08:52 AM
#16
Sleep mode
Originally posted by MikeStammer
Putting things in a module is not the best way to do things. I have written dozens of programs and have never used a module to declare variables. Its just not the right way to code things now that .NET is here
lol , sorry then I wouldn't call you a programmer .
-
Oct 2nd, 2003, 08:59 AM
#17
Thread Starter
Lively Member
Mike,
Yes, I was able to open the connection without any errors. Getting hte connection on MY machine has never been the issue. The user can not run the app on her machine & when I used the JIT Debugger the error message came back that the Connection string has not been initialized. Would that not mean that the string is not written correctly ie. me taking the workstation id off?
Connection string before modified:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="data source=STKPROD04;initial catalog=STKPRODDB;integrated security=SSPI;persist security info=False;workstation id=IT22I;packet size=4096" />
</appSettings>
</configuration>
Thanks,
Corinne
-
Oct 2nd, 2003, 09:03 AM
#18
Lively Member
What the hell are you talking about? Using a module for global variables should be avoided and if you arent careful can lead to problems. Global variables should be used as little as possible. You dont know what you are talking about. If you consider yourself one I dont think I want to be one.
-
Oct 2nd, 2003, 09:04 AM
#19
Lively Member
Does the end user have MDAC 2.7 or later installed? Maybe they need the SQL client installed. What is the OS of the target machine (not your dev machine)?
-
Oct 2nd, 2003, 09:06 AM
#20
Sleep mode
Originally posted by MikeStammer
Putting things in a module is not the best way to do things. I have written dozens of programs and have never used a module to declare variables. Its just not the right way to code things now that .NET is here
Exclusive for MikeStammer
Read here :
"Modules are a reference type similar to classes, but with some important distinctions. The members of a module are implicitly Shared and scoped to the declaration space of the standard module's containing namespace, rather than just to the module itself. Unlike classes, modules can never be instantiated, do not support inheritance, and cannot implement interfaces. A module can only be declared in a namespace and cannot be nested in another type.
You can have multiple modules in a project, but members with the same name defined in two or more modules must be qualified with their module name when accessed outside of their module." .... Visual Basic Help
"Both classes and modules are reference types that encapsulate items defined within, but they differ in how these items are accessed from other procedures.
The primary difference between classes and modules is that classes can be instantiated and standard modules cannot. Because there is never more than one copy of a standard module's data, when one part of your program changes a public variable in a standard module, any other part of the program gets the same value if it subsequently reads that variable. Class data, on the other hand, exists separately for each instantiated object. Another difference is that unlike standard modules, classes can implement interfaces.
Classes and modules also employ different scope for their members. Members defined within a class are scoped within a specific instance of the class, and exist only for the lifetime of the object. The practical result is that, to access class members from outside a class, you must use only fully qualified names; for example, Object.Member. Members declared within a standard module, on the other hand, are shared by default, and are scoped to the declaration space of the standard module's containing namespace. This means that public variables in a standard module are effectively global variables because they are visible from anywhere in your project, and they exist for the life of the program. Unlike class members, members of standard modules are implicitly shared and cannot use the Shared keyword.”.... Visual Basic Help
You really have to reconsider the way you think and program .
-
Oct 2nd, 2003, 09:14 AM
#21
Thread Starter
Lively Member
Mike,
The user is running Windows 2000. User has been able to run apps before written in .NET & pulling data from SQL without having to install SQL Client. User has MDAC 2.6 installed.
Anyone able to confirm how to write the connection string??? Do I need all of the pieces that I posted earlier? I'm asking this because all of the examples I've found give different variations on the components to make up a complete string.
Thanks,
Corinne
-
Oct 2nd, 2003, 09:15 AM
#22
Lively Member
Looks to me like you just posted the justification for my argument. Just because you CAN do something does not mean you should.
If you want to use modules for variables, go ahead. I do not want to and do not think it is a best practice. Find me some documentation that says it is and I will believe you. Until then, dont bother with these cut and paste jobs.
From what is said in your quote, modules are a way to make a variable global to an entire namespace. While this may occasionally be useful, it should not be used every time because it is the easiest way to solve a problem. That is what this means:
"This means that public variables in a standard module are effectively global variables because they are visible from anywhere in your project, and they exist for the life of the program."
You probably declare all your variables as global just in case right?
Any other bright ideas Einstein?
-
Oct 2nd, 2003, 09:19 AM
#23
Lively Member
Originally posted by Corinne
Mike,
The user is running Windows 2000. User has been able to run apps before written in .NET & pulling data from SQL without having to install SQL Client. User has MDAC 2.6 installed.
Anyone able to confirm how to write the connection string??? Do I need all of the pieces that I posted earlier? I'm asking this because all of the examples I've found give different variations on the components to make up a complete string.
Thanks,
Corinne
here are some examples of the ones I use. Usernames, passwords, and database names changed to protect the innocent:
With a user and pass:
<add key="DATABASE_CONN_STRING" value="packet size=4096;user id=SomeUsername;data source=FEANOR;persist security info=True;initial catalog=SomeDatabase;password=SomePassword" />
Integrated security:
<add key="ConnString" value="data source=SomeServer;initial catalog=SomeDatabase;integrated security=SSPI;persist security info=True;packet size=4096;Pooling=true" />
-
Oct 2nd, 2003, 09:24 AM
#24
Sleep mode
Originally posted by MikeStammer
You probably declare all your variables as global just in case right?
?
Not really . 
Originally posted by MikeStammer
Any other bright ideas Einstein?
My pleasure to call me Einstein . 
Declaring variables in a module is much more better than the ways you're inventing . No question on this idea at all . So I'll pretend I didn't read your posts and let you go or better to say I'll disappear for sometime .
-
Oct 2nd, 2003, 09:26 AM
#25
Thread Starter
Lively Member
Mike,
Would it be possible for you to explain the parts of this connection?
value="data source=SomeServer; I totally understand this
initial catalog=SomeDatabase; I totally understand this
integrated security=SSPI; Need further clarification
persist security info=True; Need further clarification
packet size=4096; Need further clarification
Pooling=true" Need further clarification
-
Oct 2nd, 2003, 09:35 AM
#26
Lively Member
Much more better. Good English there.
Maybe no question to you, but find me anyone else of extreme reputation that recommends this, ie someone like Don Box, etc.
I haven't invented anything. Don't hurry back. All you seem to post is "just add it to a module" anyways.
And the Einstein remark was sarcasm. Look it up if you don't know what it means
-
Oct 2nd, 2003, 09:42 AM
#27
Lively Member
Originally posted by Corinne
Mike,
Would it be possible for you to explain the parts of this connection?
value="data source=SomeServer; I totally understand this
initial catalog=SomeDatabase; I totally understand this
integrated security=SSPI; Need further clarification
persist security info=True; Need further clarification
packet size=4096; Need further clarification
Pooling=true" Need further clarification
Check in MSDN here:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.htm
Integrated Security=SSPI
This is windows integrated security. In other words, use the credentials used when a user logged into the machine to authenticate with the database. This way you can use NT groups for database permissions.
persist security info=True
Check here: http://dbforums.com/arch/30/2002/11/564206
Here is more info:
When set to false or no (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password.
packet Size
Size in bytes of the network packets used to communicate with an instance of SQL Server.
Pooling=true
used for connection pooling. When you use this and close a connection, its not really closed/destroyed. this way when you open the connection again, .NET can look into the pool for a connection and reuse it. This is MUCH faster than not using pooling. More info:
When true, the SQLConnection object is drawn from the appropriate pool, or if necessary, is created and added to the appropriate pool. Recognized values are true, false, yes, and no.
-
Oct 2nd, 2003, 10:41 AM
#28
Sleep mode
Originally posted by MikeStammer
Much more better. Good English there.
Well . English is my third Language . 
Originally posted by MikeStammer
Maybe no question to you, but find me anyone else of extreme reputation that recommends this, ie someone like Don Box, etc.
Post a poll .
Originally posted by MikeStammer
I haven't invented anything. Don't hurry back. All you seem to post is "just add it to a module" anyways.
This is the first step , if it works then you can try other ways . You seem to mislead the guys here .
Originally posted by MikeStammer
And the Einstein remark was sarcasm. Look it up if you don't know what it means
I believe everybody knows , Albert Einstein , but you since you're mocking him. 
enough wasting time . This could take days and we'll spoil the guy's thread . I don't want this to happen .
-
Oct 2nd, 2003, 10:44 AM
#29
Thread Starter
Lively Member
Well I'm NOT a guy & still don't have a answer --------- still working through your last suggestion Mike, I'll post again.
Thanks,
Corinne
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|