How to make the app run?????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I've taken a four days training in C#, very good training, experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more than the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It will not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers XP-pro
with all updates, with Domain User account, no matter how I try, it refuses
to execute certain sections of the code, everything trivial like showing a
form (empty of course) no problem, but everything interesting like open the
ADO connection to the databas, get the recordset filled and fill the List on
the empty form NOPE, can't do that due to some .Net Framework security issues.

So, How can I make 200 client machines accept my C# code without manually
configuring them one by one?

Kjell
 
You need to provide more information on the "not working" thing. And it is
very common with a not thorough testing application does not work on the
client computer.

Is your app an Window Form application? (it seems yes)

How do you get in "installed" on client computer? Did you created an
installation package? Or did you simply XCopied whole folder to the client
computer? Dod you "install" it locally or on a network share?

Is proper version of .NET framework installed on the client computer?

With such very basic information, only thing that can be said is you did not
do things correctly and show your app to your client a bit too early.
 
It can happen very easily if the only system you tested it on is your
development system. Get Visrtual PC 2007, make yourself a XP SP2 virtual
machine (with updates if you like) do whatever deployment you're using and
see if it works.
 
ok.

First of all, it was not shown to my customer, I took it to a very nice
customer letting me use his network for testings.

It's a MDI app with three child forms and a couple of dialogs, It's not a
"ready" app. it's more of a cross section of a typical "My app" "lowest
level" just to confirm best practice. (I'm moving from VB6 towards C#)

so, I wanted to check that certain things is running as I was hoping.
and yes; I've made an Installation package.

so the execution looked first ok, the MDI form came up, what I did not see
is that the call to open the ADO connection to a locally stored Access DB was
kind of "skipped"

I don't know any other word for it, let me list which part I manage to
verify that never got executed.

I think this is equvilent to VB GetSettings
this.Left = (int)Application.UserAppDataRegistry.GetValue(this.Name +
"left", 50);
anyway, it was skipped.

''this is a nice function I found
User MyU = new User();
MyU.InitializeWithWindowsUser();

if (MyU.IsInRole("Domänadministratörer"))
mess = "You are a Domänadministratörer";
MessageBox.Show(mess);
it was skipped

and finally, open the database.
I don't know exactly what did not get executed, it could be open an external
file to get the Path for the database.
Or the ADO Open connection string, but I'm testing the result from the file
reading and if it fails I try to get input from user with OpenFileDialog.
this never show up so the whole function must have been skipped.

so with no ADO connection the child forms will not show anything.

End of program

I made the program very small by purpose, to get minimum chans for bugs and
maximum chans for a positive test run in customer environment.

Kjell
 
fair enough.

I took my daughter's PC, also a WinXP sp2 pro, bla bla very much in same
condition as my pc (except for VS2005) and equal to the pc's my customer is
having.

and this is making me more confuse, it works on her machine.

What is most disturbing is that there are no error messages, it just skips
certain parts of the code.

It costing me a half day to make one test on customer's pc, and this is the
best part;
I've built all pc's for that customer, built the whole domain for him, and I
have built my own domain in very much the same way.

without error messages how am i suppose to know whats wrong?

Kjell

Phil Wilson said:
It can happen very easily if the only system you tested it on is your
development system. Get Visrtual PC 2007, make yourself a XP SP2 virtual
machine (with updates if you like) do whatever deployment you're using and
see if it works.
--
Phil Wilson
[MVP Windows Installer]


Kjell said:
Hello

I've taken a four days training in C#, very good training, experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more than the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It will not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers XP-pro
with all updates, with Domain User account, no matter how I try, it
refuses
to execute certain sections of the code, everything trivial like showing a
form (empty of course) no problem, but everything interesting like open
the
ADO connection to the databas, get the recordset filled and fill the List
on
the empty form NOPE, can't do that due to some .Net Framework security
issues.

So, How can I make 200 client machines accept my C# code without manually
configuring them one by one?

Kjell
 
Do you have any try{...}catch(...){...} block in your code? if yes, place
MessageBox.Show() in the catch... clause so any error caught would pops up a
message box.

You can also place some message boxes before and after problemetic code
(some that "skipped". BTW, no code would simply skip by its own). For
example, you could place code to open connection (I hope you use ADO.NET,
not ADO as in VB) under a button click event handler, you may place a few
message boxes in every few lines of code. So, the clicking on button would
either open the connecction successfully, or failed with runtime error
raised. By seeing the message boxes pop up one by one, you would have idea
if your code runs to its end.
 
Hello Kjell,

You made the following statements:
<< the call to open the ADO connection to a locally stored Access DB was
kind of "skipped" >>
<< it just skips certain parts of the code >>
<< very much in same condition as my pc (except for VS2005) and equal to the
pc's my customer is having. >>

You would benefit from changing the way you think about computers and how
they work. Computers are dignital devices - not analog devices. So nothing
in a computer "kind of" happens. It either happens or it does not happen.
That is the truth or at least should be the underlying assumption about all
of your troubleshooting efforts - even if there is a *perception* that
something "kind of" happens.

Computers do not "just skips certain parts of the code": Your working
assumption should be that the only reason code would fail to execute is if
there is some specific and knowable reason.

No two computers are identical - period. You write that your daughters PC is
"in very much the same condition". Remember that means it is NOT in fact in
the *same* condition. Your customers PCs are NOT equal either - not to each
other, not to your daughters, and not to yours. The only time they would be
"practically identical" is immediately after reimaging from a standard
image.

So rather than becoming upset because your assumptions and expectations are
obviously invalid, you would benefit from changing your assumptions - rather
than blaming the computers, .NET, or inventing wild theories involving
possible analog aspects of these digital devices.


Fianlly, regarding
<< without error messages how am i suppose to know whats wrong? >>

Your question practically answers itself. You aren't supposed to know what's
wrong if no messages are appearing. So if you aren't getting error messages,
then stick in some messages of your own. There are many ways to do this:
Show a message box at critical points in the code- and have the message box
display the current value of important variables; write to a text file -
include line numbers, value of critical variables, sequence, return value of
called methods, implement some Trace listeners, etc.

But before you do that, check the obvious stuff. How does your application
connect to the database. Surely that is going to be an obvious difference
between your computer and those at the customer site. What does your
connection string look like - how is it set... hard-coded, or from .Settings
or App.config.

"change how you think - and change your [debugging] life"

-HTH

-"Smithers"

Kjell said:
fair enough.

I took my daughter's PC, also a WinXP sp2 pro, bla bla very much in same
condition as my pc (except for VS2005) and equal to the pc's my customer
is
having.

and this is making me more confuse, it works on her machine.

What is most disturbing is that there are no error messages, it just skips
certain parts of the code.

It costing me a half day to make one test on customer's pc, and this is
the
best part;
I've built all pc's for that customer, built the whole domain for him, and
I
have built my own domain in very much the same way.

without error messages how am i suppose to know whats wrong?

Kjell

Phil Wilson said:
It can happen very easily if the only system you tested it on is your
development system. Get Visrtual PC 2007, make yourself a XP SP2 virtual
machine (with updates if you like) do whatever deployment you're using
and
see if it works.
--
Phil Wilson
[MVP Windows Installer]


Kjell said:
Hello

I've taken a four days training in C#, very good training, experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more than
the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It will
not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers
XP-pro
with all updates, with Domain User account, no matter how I try, it
refuses
to execute certain sections of the code, everything trivial like
showing a
form (empty of course) no problem, but everything interesting like open
the
ADO connection to the databas, get the recordset filled and fill the
List
on
the empty form NOPE, can't do that due to some .Net Framework security
issues.

So, How can I make 200 client machines accept my C# code without
manually
configuring them one by one?

Kjell
 
ok, I'm slowely catching some of the pieces here.

There's no way I'm going to travel 60 km to test every step, some errors was
discovered on anoter machine of me, so I'll have to assume whats going wrong
when at customer.

There is a try..catch when opening the connection that can explain that
problem.
I'm still surprised that the attempt to retrieve info from the db is not
throwing an error if the connection never was opened, I've no try....catch
doing that.

btw, How can i tell if i'm using ADO as in VB or .Net ADO ??


Kjell
 
thanks for the lecture smithers :-)

Yes, I was a bit upset, maybe I should not have open the thread in the first
pace at all.

I'm not blaiming anyone of you guys doing your best to help us with various
..Net problems, you're all doing a great job.

and your're absolutely right, computer's are digital devices, always has
been always will be, and they can not by them self decide to skip anything
without the program author's will.

sorry for giving you that impression, English is not my native language.

I was very positive towards C# after finishing the training, and now with a
little distance to the result of the first attempt of coding I'm surprised
that so much error handling is part of the code without me having to code it.

That's how I should have expressed myself if I did my research correctly
before coming here. I'll do my homework better in the future.

Maybe there is one thing you could help me with.?

I'm mostly doing applications used by many over a local network, meaning
that the app.exe file is stored on a server share.

I tried to find the app.exe file after the application was installed using
the built-in application package, I could not find it, yet it's there !!!!!
I must have missed something from the training or they never told me the
secret here, can someone bring a light to this.

Can I make a setup program within the VS2005 not containing the app.exe file
but only the required resources to run the app.exe file and then place the
app.exe file on a server share and a shortcut on the desktop?

Or, am I totally derailed here.....?

Kjell



Smithers said:
Hello Kjell,

You made the following statements:
<< the call to open the ADO connection to a locally stored Access DB was
kind of "skipped" >>
<< it just skips certain parts of the code >>
<< very much in same condition as my pc (except for VS2005) and equal to the
pc's my customer is having. >>

You would benefit from changing the way you think about computers and how
they work. Computers are dignital devices - not analog devices. So nothing
in a computer "kind of" happens. It either happens or it does not happen.
That is the truth or at least should be the underlying assumption about all
of your troubleshooting efforts - even if there is a *perception* that
something "kind of" happens.

Computers do not "just skips certain parts of the code": Your working
assumption should be that the only reason code would fail to execute is if
there is some specific and knowable reason.

No two computers are identical - period. You write that your daughters PC is
"in very much the same condition". Remember that means it is NOT in fact in
the *same* condition. Your customers PCs are NOT equal either - not to each
other, not to your daughters, and not to yours. The only time they would be
"practically identical" is immediately after reimaging from a standard
image.

So rather than becoming upset because your assumptions and expectations are
obviously invalid, you would benefit from changing your assumptions - rather
than blaming the computers, .NET, or inventing wild theories involving
possible analog aspects of these digital devices.


Fianlly, regarding
<< without error messages how am i suppose to know whats wrong? >>

Your question practically answers itself. You aren't supposed to know what's
wrong if no messages are appearing. So if you aren't getting error messages,
then stick in some messages of your own. There are many ways to do this:
Show a message box at critical points in the code- and have the message box
display the current value of important variables; write to a text file -
include line numbers, value of critical variables, sequence, return value of
called methods, implement some Trace listeners, etc.

But before you do that, check the obvious stuff. How does your application
connect to the database. Surely that is going to be an obvious difference
between your computer and those at the customer site. What does your
connection string look like - how is it set... hard-coded, or from .Settings
or App.config.

"change how you think - and change your [debugging] life"

-HTH

-"Smithers"

Kjell said:
fair enough.

I took my daughter's PC, also a WinXP sp2 pro, bla bla very much in same
condition as my pc (except for VS2005) and equal to the pc's my customer
is
having.

and this is making me more confuse, it works on her machine.

What is most disturbing is that there are no error messages, it just skips
certain parts of the code.

It costing me a half day to make one test on customer's pc, and this is
the
best part;
I've built all pc's for that customer, built the whole domain for him, and
I
have built my own domain in very much the same way.

without error messages how am i suppose to know whats wrong?

Kjell

Phil Wilson said:
It can happen very easily if the only system you tested it on is your
development system. Get Visrtual PC 2007, make yourself a XP SP2 virtual
machine (with updates if you like) do whatever deployment you're using
and
see if it works.
--
Phil Wilson
[MVP Windows Installer]


Hello

I've taken a four days training in C#, very good training, experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more than
the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It will
not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers
XP-pro
with all updates, with Domain User account, no matter how I try, it
refuses
to execute certain sections of the code, everything trivial like
showing a
form (empty of course) no problem, but everything interesting like open
the
ADO connection to the databas, get the recordset filled and fill the
List
on
the empty form NOPE, can't do that due to some .Net Framework security
issues.

So, How can I make 200 client machines accept my C# code without
manually
configuring them one by one?

Kjell
 
Maybe there is one thing you could help me with.?

I'm mostly doing applications used by many over a local network, meaning
that the app.exe file is stored on a server share.

I tried to find the app.exe file after the application was installed using
the built-in application package, I could not find it, yet it's there
!!!!!
I must have missed something from the training or they never told me the
secret here, can someone bring a light to this.

Can I make a setup program within the VS2005 not containing the app.exe
file
but only the required resources to run the app.exe file and then place the
app.exe file on a server share and a shortcut on the desktop?


What might be helpful for you is to *manually* install your application once
or twice. One beautiful feature of .NET is known as "XCopy deployment" -
which more-or-less means (1) create a folder on the target machine (2) copy
the .exe to the folder (3) copy any supporting .dll files to the same
folder; and (4) create a shortcut on the desktop to the .exe. Assuming that
all of the supporting .dll files are .NET assemblies, it should all work
just fine. That's the most basic way to install a simple .NET application.
Things can get a bit more complicated if your application relies on any
legacy .com .dlls, a database, etc.

The point is that you should not rely on the installation package until you
understand exactly what it *should* be doing. Given your situation, it is
clear that it is not doing what you expect. This means that you don't know
what it is *actually* doing compared to what it should be doing. So if you
were to manually install everything once or twice, you would gain more
knowledge about what is or should go where. Then when you create an
installation package, you can verify that it is doing exactly what it should
do - and if something goes wrong, you know exactly what to look for.

Separately, you need to verify that each computer has the proper minimal
components already installed, and any required connectivity established.
Have you verified .NET Framework versions? What about dependent assemblies?
And the database - how do the users connect? Is it SQL Server? Is it MS
Access? If MS Access, are required drive letter(s) mapped - if SQL Server,
are required ports opened on a firewall? Now we're grasping at straws....

We cannot possibly help you debug your specific your problem because you
give us so little to work with. So all we can do is give you general
guidelines for troubleshooting. These guidelines would be valid for *any*
developement effort or troubleshooting effort.

Don't be fooled by that class you took. Classes are designed to get you
through some very small and simple applications. Everything usually "just
works" in a class because the instructor made it that way. But when you are
on your own outside of the class, things can get complicated very quickly;
you have to have some good analytical skills to figure out what's going on.
The problem isn't with you (per se) or with .NET (certainly not there) - but
with the unrealistic expectations created during the course where the entire
subject matter was well-planned and sanitized long before you showed up.

Finally, ESL isn't a problem. Your written English is fine.

-HTH
 
Addition to Smithers had said.

First, try XCopy method to "install" your app on a computer. This is the
simplest way to "install" an .NET app (copying everything in you projects'
"bin\Release" folder to the targeting computer.

If this gets your app runs, then your installation package must not built
correctly. As Sithers said, you need to know what should be packaged
clearly.

You have mentioned that you want to place the app.exe on a network share
(drive). Is this what you actually did at your client site. If yes, then
that probably is where your problem comes: by default, .NET treat any code
loaded from outside running computer as unsafe. You need to use CASPOL.exe
tool to configure .NET code access security, i.e. give proper trust to
certain code group (it could be a network share, an Internet site, or entire
local intranet...).

I do not believe a short training course would go that far on this kind of
topic, but you do need to know that if you load app.exe from a location
other than the local computer.

If you do not have time yet to know this CAS (code access security) stuff,
then alway install the app.exe locally, and try to use XCopy might be a good
start point.


Kjell said:
thanks for the lecture smithers :-)

Yes, I was a bit upset, maybe I should not have open the thread in the
first
pace at all.

I'm not blaiming anyone of you guys doing your best to help us with
various
.Net problems, you're all doing a great job.

and your're absolutely right, computer's are digital devices, always has
been always will be, and they can not by them self decide to skip anything
without the program author's will.

sorry for giving you that impression, English is not my native language.

I was very positive towards C# after finishing the training, and now with
a
little distance to the result of the first attempt of coding I'm surprised
that so much error handling is part of the code without me having to code
it.

That's how I should have expressed myself if I did my research correctly
before coming here. I'll do my homework better in the future.

Maybe there is one thing you could help me with.?

I'm mostly doing applications used by many over a local network, meaning
that the app.exe file is stored on a server share.

I tried to find the app.exe file after the application was installed using
the built-in application package, I could not find it, yet it's there
!!!!!
I must have missed something from the training or they never told me the
secret here, can someone bring a light to this.

Can I make a setup program within the VS2005 not containing the app.exe
file
but only the required resources to run the app.exe file and then place the
app.exe file on a server share and a shortcut on the desktop?

Or, am I totally derailed here.....?

Kjell



Smithers said:
Hello Kjell,

You made the following statements:
<< the call to open the ADO connection to a locally stored Access DB was
kind of "skipped" >>
<< it just skips certain parts of the code >>
<< very much in same condition as my pc (except for VS2005) and equal to
the
pc's my customer is having. >>

You would benefit from changing the way you think about computers and how
they work. Computers are dignital devices - not analog devices. So
nothing
in a computer "kind of" happens. It either happens or it does not happen.
That is the truth or at least should be the underlying assumption about
all
of your troubleshooting efforts - even if there is a *perception* that
something "kind of" happens.

Computers do not "just skips certain parts of the code": Your working
assumption should be that the only reason code would fail to execute is
if
there is some specific and knowable reason.

No two computers are identical - period. You write that your daughters PC
is
"in very much the same condition". Remember that means it is NOT in fact
in
the *same* condition. Your customers PCs are NOT equal either - not to
each
other, not to your daughters, and not to yours. The only time they would
be
"practically identical" is immediately after reimaging from a standard
image.

So rather than becoming upset because your assumptions and expectations
are
obviously invalid, you would benefit from changing your assumptions -
rather
than blaming the computers, .NET, or inventing wild theories involving
possible analog aspects of these digital devices.


Fianlly, regarding
<< without error messages how am i suppose to know whats wrong? >>

Your question practically answers itself. You aren't supposed to know
what's
wrong if no messages are appearing. So if you aren't getting error
messages,
then stick in some messages of your own. There are many ways to do this:
Show a message box at critical points in the code- and have the message
box
display the current value of important variables; write to a text file -
include line numbers, value of critical variables, sequence, return value
of
called methods, implement some Trace listeners, etc.

But before you do that, check the obvious stuff. How does your
application
connect to the database. Surely that is going to be an obvious difference
between your computer and those at the customer site. What does your
connection string look like - how is it set... hard-coded, or from
.Settings
or App.config.

"change how you think - and change your [debugging] life"

-HTH

-"Smithers"

Kjell said:
fair enough.

I took my daughter's PC, also a WinXP sp2 pro, bla bla very much in
same
condition as my pc (except for VS2005) and equal to the pc's my
customer
is
having.

and this is making me more confuse, it works on her machine.

What is most disturbing is that there are no error messages, it just
skips
certain parts of the code.

It costing me a half day to make one test on customer's pc, and this is
the
best part;
I've built all pc's for that customer, built the whole domain for him,
and
I
have built my own domain in very much the same way.

without error messages how am i suppose to know whats wrong?

Kjell

:

It can happen very easily if the only system you tested it on is your
development system. Get Visrtual PC 2007, make yourself a XP SP2
virtual
machine (with updates if you like) do whatever deployment you're using
and
see if it works.
--
Phil Wilson
[MVP Windows Installer]


Hello

I've taken a four days training in C#, very good training,
experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more
than
the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It
will
not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers
XP-pro
with all updates, with Domain User account, no matter how I try, it
refuses
to execute certain sections of the code, everything trivial like
showing a
form (empty of course) no problem, but everything interesting like
open
the
ADO connection to the databas, get the recordset filled and fill the
List
on
the empty form NOPE, can't do that due to some .Net Framework
security
issues.

So, How can I make 200 client machines accept my C# code without
manually
configuring them one by one?

Kjell
 
Yes, thanks Norman

This is what i've been waiting for, I had no knowledge about CASPOL.exe
No wonder it never worked as planned.

Reading the articles about CASPOL really removes alot of question marks for
me.

It's not easy till you know what to ask for, right! :-)

Thanks Norman for revealing this valuable information for me.


PS, I've already read through several of the articles found via google, but
I'm not sure how to get my hands on that tool, One site having a spanish
version actually asked for $9.95 ?!?!?!
Do I have to buy that tool seperately?, I've already spent thousands of
dollars on my MSDN-Pro subscription, doesn't that include such a vital tool???



Kjell



Norman Yuan said:
Addition to Smithers had said.

First, try XCopy method to "install" your app on a computer. This is the
simplest way to "install" an .NET app (copying everything in you projects'
"bin\Release" folder to the targeting computer.

If this gets your app runs, then your installation package must not built
correctly. As Sithers said, you need to know what should be packaged
clearly.

You have mentioned that you want to place the app.exe on a network share
(drive). Is this what you actually did at your client site. If yes, then
that probably is where your problem comes: by default, .NET treat any code
loaded from outside running computer as unsafe. You need to use CASPOL.exe
tool to configure .NET code access security, i.e. give proper trust to
certain code group (it could be a network share, an Internet site, or entire
local intranet...).

I do not believe a short training course would go that far on this kind of
topic, but you do need to know that if you load app.exe from a location
other than the local computer.

If you do not have time yet to know this CAS (code access security) stuff,
then alway install the app.exe locally, and try to use XCopy might be a good
start point.


Kjell said:
thanks for the lecture smithers :-)

Yes, I was a bit upset, maybe I should not have open the thread in the
first
pace at all.

I'm not blaiming anyone of you guys doing your best to help us with
various
.Net problems, you're all doing a great job.

and your're absolutely right, computer's are digital devices, always has
been always will be, and they can not by them self decide to skip anything
without the program author's will.

sorry for giving you that impression, English is not my native language.

I was very positive towards C# after finishing the training, and now with
a
little distance to the result of the first attempt of coding I'm surprised
that so much error handling is part of the code without me having to code
it.

That's how I should have expressed myself if I did my research correctly
before coming here. I'll do my homework better in the future.

Maybe there is one thing you could help me with.?

I'm mostly doing applications used by many over a local network, meaning
that the app.exe file is stored on a server share.

I tried to find the app.exe file after the application was installed using
the built-in application package, I could not find it, yet it's there
!!!!!
I must have missed something from the training or they never told me the
secret here, can someone bring a light to this.

Can I make a setup program within the VS2005 not containing the app.exe
file
but only the required resources to run the app.exe file and then place the
app.exe file on a server share and a shortcut on the desktop?

Or, am I totally derailed here.....?

Kjell



Smithers said:
Hello Kjell,

You made the following statements:
<< the call to open the ADO connection to a locally stored Access DB was
kind of "skipped" >>
<< it just skips certain parts of the code >>
<< very much in same condition as my pc (except for VS2005) and equal to
the
pc's my customer is having. >>

You would benefit from changing the way you think about computers and how
they work. Computers are dignital devices - not analog devices. So
nothing
in a computer "kind of" happens. It either happens or it does not happen.
That is the truth or at least should be the underlying assumption about
all
of your troubleshooting efforts - even if there is a *perception* that
something "kind of" happens.

Computers do not "just skips certain parts of the code": Your working
assumption should be that the only reason code would fail to execute is
if
there is some specific and knowable reason.

No two computers are identical - period. You write that your daughters PC
is
"in very much the same condition". Remember that means it is NOT in fact
in
the *same* condition. Your customers PCs are NOT equal either - not to
each
other, not to your daughters, and not to yours. The only time they would
be
"practically identical" is immediately after reimaging from a standard
image.

So rather than becoming upset because your assumptions and expectations
are
obviously invalid, you would benefit from changing your assumptions -
rather
than blaming the computers, .NET, or inventing wild theories involving
possible analog aspects of these digital devices.


Fianlly, regarding
<< without error messages how am i suppose to know whats wrong? >>

Your question practically answers itself. You aren't supposed to know
what's
wrong if no messages are appearing. So if you aren't getting error
messages,
then stick in some messages of your own. There are many ways to do this:
Show a message box at critical points in the code- and have the message
box
display the current value of important variables; write to a text file -
include line numbers, value of critical variables, sequence, return value
of
called methods, implement some Trace listeners, etc.

But before you do that, check the obvious stuff. How does your
application
connect to the database. Surely that is going to be an obvious difference
between your computer and those at the customer site. What does your
connection string look like - how is it set... hard-coded, or from
.Settings
or App.config.

"change how you think - and change your [debugging] life"

-HTH

-"Smithers"

fair enough.

I took my daughter's PC, also a WinXP sp2 pro, bla bla very much in
same
condition as my pc (except for VS2005) and equal to the pc's my
customer
is
having.

and this is making me more confuse, it works on her machine.

What is most disturbing is that there are no error messages, it just
skips
certain parts of the code.

It costing me a half day to make one test on customer's pc, and this is
the
best part;
I've built all pc's for that customer, built the whole domain for him,
and
I
have built my own domain in very much the same way.

without error messages how am i suppose to know whats wrong?

Kjell

:

It can happen very easily if the only system you tested it on is your
development system. Get Visrtual PC 2007, make yourself a XP SP2
virtual
machine (with updates if you like) do whatever deployment you're using
and
see if it works.
--
Phil Wilson
[MVP Windows Installer]


Hello

I've taken a four days training in C#, very good training,
experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more
than
the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It
will
not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers
XP-pro
with all updates, with Domain User account, no matter how I try, it
refuses
to execute certain sections of the code, everything trivial like
showing a
form (empty of course) no problem, but everything interesting like
open
the
ADO connection to the databas, get the recordset filled and fill the
List
on
the empty form NOPE, can't do that due to some .Net Framework
security
issues.

So, How can I make 200 client machines accept my C# code without
manually
configuring them one by one?

Kjell
 
oooops, reg Caspol.... I wasen't looking hard enough....

It's on my disk, has probably been there since long.

Not sure if it's part of the Framwork pieces or VS2005 but it doesn't matter
right now, this is good news... :-)

Kjell



Norman Yuan said:
Addition to Smithers had said.

First, try XCopy method to "install" your app on a computer. This is the
simplest way to "install" an .NET app (copying everything in you projects'
"bin\Release" folder to the targeting computer.

If this gets your app runs, then your installation package must not built
correctly. As Sithers said, you need to know what should be packaged
clearly.

You have mentioned that you want to place the app.exe on a network share
(drive). Is this what you actually did at your client site. If yes, then
that probably is where your problem comes: by default, .NET treat any code
loaded from outside running computer as unsafe. You need to use CASPOL.exe
tool to configure .NET code access security, i.e. give proper trust to
certain code group (it could be a network share, an Internet site, or entire
local intranet...).

I do not believe a short training course would go that far on this kind of
topic, but you do need to know that if you load app.exe from a location
other than the local computer.

If you do not have time yet to know this CAS (code access security) stuff,
then alway install the app.exe locally, and try to use XCopy might be a good
start point.


Kjell said:
thanks for the lecture smithers :-)

Yes, I was a bit upset, maybe I should not have open the thread in the
first
pace at all.

I'm not blaiming anyone of you guys doing your best to help us with
various
.Net problems, you're all doing a great job.

and your're absolutely right, computer's are digital devices, always has
been always will be, and they can not by them self decide to skip anything
without the program author's will.

sorry for giving you that impression, English is not my native language.

I was very positive towards C# after finishing the training, and now with
a
little distance to the result of the first attempt of coding I'm surprised
that so much error handling is part of the code without me having to code
it.

That's how I should have expressed myself if I did my research correctly
before coming here. I'll do my homework better in the future.

Maybe there is one thing you could help me with.?

I'm mostly doing applications used by many over a local network, meaning
that the app.exe file is stored on a server share.

I tried to find the app.exe file after the application was installed using
the built-in application package, I could not find it, yet it's there
!!!!!
I must have missed something from the training or they never told me the
secret here, can someone bring a light to this.

Can I make a setup program within the VS2005 not containing the app.exe
file
but only the required resources to run the app.exe file and then place the
app.exe file on a server share and a shortcut on the desktop?

Or, am I totally derailed here.....?

Kjell



Smithers said:
Hello Kjell,

You made the following statements:
<< the call to open the ADO connection to a locally stored Access DB was
kind of "skipped" >>
<< it just skips certain parts of the code >>
<< very much in same condition as my pc (except for VS2005) and equal to
the
pc's my customer is having. >>

You would benefit from changing the way you think about computers and how
they work. Computers are dignital devices - not analog devices. So
nothing
in a computer "kind of" happens. It either happens or it does not happen.
That is the truth or at least should be the underlying assumption about
all
of your troubleshooting efforts - even if there is a *perception* that
something "kind of" happens.

Computers do not "just skips certain parts of the code": Your working
assumption should be that the only reason code would fail to execute is
if
there is some specific and knowable reason.

No two computers are identical - period. You write that your daughters PC
is
"in very much the same condition". Remember that means it is NOT in fact
in
the *same* condition. Your customers PCs are NOT equal either - not to
each
other, not to your daughters, and not to yours. The only time they would
be
"practically identical" is immediately after reimaging from a standard
image.

So rather than becoming upset because your assumptions and expectations
are
obviously invalid, you would benefit from changing your assumptions -
rather
than blaming the computers, .NET, or inventing wild theories involving
possible analog aspects of these digital devices.


Fianlly, regarding
<< without error messages how am i suppose to know whats wrong? >>

Your question practically answers itself. You aren't supposed to know
what's
wrong if no messages are appearing. So if you aren't getting error
messages,
then stick in some messages of your own. There are many ways to do this:
Show a message box at critical points in the code- and have the message
box
display the current value of important variables; write to a text file -
include line numbers, value of critical variables, sequence, return value
of
called methods, implement some Trace listeners, etc.

But before you do that, check the obvious stuff. How does your
application
connect to the database. Surely that is going to be an obvious difference
between your computer and those at the customer site. What does your
connection string look like - how is it set... hard-coded, or from
.Settings
or App.config.

"change how you think - and change your [debugging] life"

-HTH

-"Smithers"

fair enough.

I took my daughter's PC, also a WinXP sp2 pro, bla bla very much in
same
condition as my pc (except for VS2005) and equal to the pc's my
customer
is
having.

and this is making me more confuse, it works on her machine.

What is most disturbing is that there are no error messages, it just
skips
certain parts of the code.

It costing me a half day to make one test on customer's pc, and this is
the
best part;
I've built all pc's for that customer, built the whole domain for him,
and
I
have built my own domain in very much the same way.

without error messages how am i suppose to know whats wrong?

Kjell

:

It can happen very easily if the only system you tested it on is your
development system. Get Visrtual PC 2007, make yourself a XP SP2
virtual
machine (with updates if you like) do whatever deployment you're using
and
see if it works.
--
Phil Wilson
[MVP Windows Installer]


Hello

I've taken a four days training in C#, very good training,
experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more
than
the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It
will
not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers
XP-pro
with all updates, with Domain User account, no matter how I try, it
refuses
to execute certain sections of the code, everything trivial like
showing a
form (empty of course) no problem, but everything interesting like
open
the
ADO connection to the databas, get the recordset filled and fill the
List
on
the empty form NOPE, can't do that due to some .Net Framework
security
issues.

So, How can I make 200 client machines accept my C# code without
manually
configuring them one by one?

Kjell
 
It is part of .NET framework. For .NET 1.x version, after the .NET framework
is installed, you'll have MS .NET Framework Configuration applet available
in "Control Panel->Administrative Tools". That is the GUI equivalent of
CASPOL.exe. However, for .NET 2.0, the applet only comes with .NET Framework
SDK. That means, if you have VS2005/.NET SDK installed, you can configure
CAS easily with GUI tool. But on your clients' computer, the applet is most
likely not available (because you wouldn't install 200MB .NET SDK on user
computer), so you have to run CASPOL.exe at command line. Fortunately, .NET
documentation has fairly detailed description of how to use it (so as on the
net).

As for loading .NET app from a network share, in order to simplifying
constant bug updates, a simple way is to configure a code groug that points
to a network folder, and give it appropriated trust (I usaully give it full
trust). All users only has read/execute permission to that folder and only
dedicated user (admin) has write permission. With this setup, you know only
the dedicated user can drop .NET code/app into it to let user run from
there, so the code is trusted.

Here is an example of using CASPOL.exe to create such code group. I make it
a *.bat command, so you only need to double-click it on client computer
(watch the line break):

C:\Windows\Microsoft.net\framework\v2.0.50727\CASPOL -machine -addgroup
All_Code -url file://NetworkShareFolderPath/* FullTrust -name
MyNETCodeStorageDepot -description "Central located .NET Applications"


HTH

Kjell said:
oooops, reg Caspol.... I wasen't looking hard enough....

It's on my disk, has probably been there since long.

Not sure if it's part of the Framwork pieces or VS2005 but it doesn't
matter
right now, this is good news... :-)

Kjell



Norman Yuan said:
Addition to Smithers had said.

First, try XCopy method to "install" your app on a computer. This is the
simplest way to "install" an .NET app (copying everything in you
projects'
"bin\Release" folder to the targeting computer.

If this gets your app runs, then your installation package must not built
correctly. As Sithers said, you need to know what should be packaged
clearly.

You have mentioned that you want to place the app.exe on a network share
(drive). Is this what you actually did at your client site. If yes, then
that probably is where your problem comes: by default, .NET treat any
code
loaded from outside running computer as unsafe. You need to use
CASPOL.exe
tool to configure .NET code access security, i.e. give proper trust to
certain code group (it could be a network share, an Internet site, or
entire
local intranet...).

I do not believe a short training course would go that far on this kind
of
topic, but you do need to know that if you load app.exe from a location
other than the local computer.

If you do not have time yet to know this CAS (code access security)
stuff,
then alway install the app.exe locally, and try to use XCopy might be a
good
start point.


Kjell said:
thanks for the lecture smithers :-)

Yes, I was a bit upset, maybe I should not have open the thread in the
first
pace at all.

I'm not blaiming anyone of you guys doing your best to help us with
various
.Net problems, you're all doing a great job.

and your're absolutely right, computer's are digital devices, always
has
been always will be, and they can not by them self decide to skip
anything
without the program author's will.

sorry for giving you that impression, English is not my native
language.

I was very positive towards C# after finishing the training, and now
with
a
little distance to the result of the first attempt of coding I'm
surprised
that so much error handling is part of the code without me having to
code
it.

That's how I should have expressed myself if I did my research
correctly
before coming here. I'll do my homework better in the future.

Maybe there is one thing you could help me with.?

I'm mostly doing applications used by many over a local network,
meaning
that the app.exe file is stored on a server share.

I tried to find the app.exe file after the application was installed
using
the built-in application package, I could not find it, yet it's there
!!!!!
I must have missed something from the training or they never told me
the
secret here, can someone bring a light to this.

Can I make a setup program within the VS2005 not containing the app.exe
file
but only the required resources to run the app.exe file and then place
the
app.exe file on a server share and a shortcut on the desktop?

Or, am I totally derailed here.....?

Kjell



:

Hello Kjell,

You made the following statements:
<< the call to open the ADO connection to a locally stored Access DB
was
kind of "skipped" >>
<< it just skips certain parts of the code >>
<< very much in same condition as my pc (except for VS2005) and equal
to
the
pc's my customer is having. >>

You would benefit from changing the way you think about computers and
how
they work. Computers are dignital devices - not analog devices. So
nothing
in a computer "kind of" happens. It either happens or it does not
happen.
That is the truth or at least should be the underlying assumption
about
all
of your troubleshooting efforts - even if there is a *perception* that
something "kind of" happens.

Computers do not "just skips certain parts of the code": Your working
assumption should be that the only reason code would fail to execute
is
if
there is some specific and knowable reason.

No two computers are identical - period. You write that your daughters
PC
is
"in very much the same condition". Remember that means it is NOT in
fact
in
the *same* condition. Your customers PCs are NOT equal either - not to
each
other, not to your daughters, and not to yours. The only time they
would
be
"practically identical" is immediately after reimaging from a standard
image.

So rather than becoming upset because your assumptions and
expectations
are
obviously invalid, you would benefit from changing your assumptions -
rather
than blaming the computers, .NET, or inventing wild theories involving
possible analog aspects of these digital devices.


Fianlly, regarding
<< without error messages how am i suppose to know whats wrong? >>

Your question practically answers itself. You aren't supposed to know
what's
wrong if no messages are appearing. So if you aren't getting error
messages,
then stick in some messages of your own. There are many ways to do
this:
Show a message box at critical points in the code- and have the
message
box
display the current value of important variables; write to a text
file -
include line numbers, value of critical variables, sequence, return
value
of
called methods, implement some Trace listeners, etc.

But before you do that, check the obvious stuff. How does your
application
connect to the database. Surely that is going to be an obvious
difference
between your computer and those at the customer site. What does your
connection string look like - how is it set... hard-coded, or from
.Settings
or App.config.

"change how you think - and change your [debugging] life"

-HTH

-"Smithers"

fair enough.

I took my daughter's PC, also a WinXP sp2 pro, bla bla very much in
same
condition as my pc (except for VS2005) and equal to the pc's my
customer
is
having.

and this is making me more confuse, it works on her machine.

What is most disturbing is that there are no error messages, it just
skips
certain parts of the code.

It costing me a half day to make one test on customer's pc, and this
is
the
best part;
I've built all pc's for that customer, built the whole domain for
him,
and
I
have built my own domain in very much the same way.

without error messages how am i suppose to know whats wrong?

Kjell

:

It can happen very easily if the only system you tested it on is
your
development system. Get Visrtual PC 2007, make yourself a XP SP2
virtual
machine (with updates if you like) do whatever deployment you're
using
and
see if it works.
--
Phil Wilson
[MVP Windows Installer]


Hello

I've taken a four days training in C#, very good training,
experienced
teacher and all that, very positive.

Went home spent a week making my first application, slightly more
than
the
usual "Hello world".

Took it with me to my best customer, and beleive it or not....It
will
not
work !!!!

How can that happen!!!
It works fine on my XP-pro at home and not at all on my customers
XP-pro
with all updates, with Domain User account, no matter how I try,
it
refuses
to execute certain sections of the code, everything trivial like
showing a
form (empty of course) no problem, but everything interesting
like
open
the
ADO connection to the databas, get the recordset filled and fill
the
List
on
the empty form NOPE, can't do that due to some .Net Framework
security
issues.

So, How can I make 200 client machines accept my C# code without
manually
configuring them one by one?

Kjell
 
Back
Top