how to let user instll: System_SR_de.cab

B

Boris Nienke

Hi,

i have implemented E-Mail-sending into my c# application (thanks to
everybody giving tips on this topic!)

Now when something bad happens i just get the error "Assemblyname of
resource not found"
This is, because on the device is no SR-Package installed. When i start
the debugger it installes "System_SR_de.cab" on the device and then i
get correct error-messages.

Question is:
- can i put this ressource-cab into my own installer-package so that it
is installed whenever my application is installed on a device?

how?

Thank you very much

Boris
 
T

Tim Wilson

Why not catch the error(s) and display your own message to the user. This
way you're in control of what the user is shown. If you need to localize the
messages then you should be able to do that yourself as well. Since, AFAIK,
the System_SR_* only come as part of VS.Net 2003 and not as part of the CF
install itself, it *might* not even be legal to redistribute these CAB, but
I'm not sure about that. Plus I don't think that these CAB's were ever meant
to be seen by anyone but developers since they're primarily a "debug thing".
 
B

Boris Nienke

Why not catch the error(s) and display your own message to the user. This
way you're in control of what the user is shown. If you need to localize the
messages then you should be able to do that yourself as well. Since, AFAIK,
the System_SR_* only come as part of VS.Net 2003 and not as part of the CF
install itself, it *might* not even be legal to redistribute these CAB, but
I'm not sure about that. Plus I don't think that these CAB's were ever meant
to be seen by anyone but developers since they're primarily a "debug thing".

you might be right - but i always catch _my_ errors and display _my_
messages.
But: now there are possible errors in the SMTP-functions. For example
when connecting to a host and there's no active internet-connection...
or you have a WAP-connection instead of an internet-connection etc...

then the only error i get is "Assemblyname of ressource not found" which
won't help me if a customer is telling me that...
I don't know how to catch those errors (there may be A LOT of possible
errors) because i do a "Try... Catch" and here i get the useless text in
the "exception.message"

so i really like to see the real error-message and so i like to have the
SR-Package installed... I don't know a alternative solution...?!

Boris
 
P

Peter Foot [MVP]

This resource assembly is for use during debugging only and you are not
licensed to distribute it with your application. You'll need to build your
own error handling and system to display a "friendly" error message to the
user.

Peter
 
T

Tim Wilson

So you're saying that it throws the SAME exception in DIFFERENT scenarios
and gives you useless error messages without a System_SR_* package
installed? What do you mean by "errors in the SMTP-functions"?
 
C

Chris Tacke, eMVP

You'll still get a different exception, at least in number. Your app should
always be checking for errors and provide the user something meaningful.
The error resource is intended as a developer resource, nothing more.
That's why it's not part of the CF distribution.

-Chris
 
A

Alex Feinman [MVP]

System.SR.xxx assemblies are not redistributable. You do not have a license
to package it with your application and the end-user does not have means of
obtaining it short of acquiring the SDK
 
B

Boris Nienke

So you're saying that it throws the SAME exception in DIFFERENT scenarios
and gives you useless error messages without a System_SR_* package
installed? What do you mean by "errors in the SMTP-functions"?

for example when doing a Resolve DNS (havn't got the source available at
this moment, sorry) and this failed because of
- wrong name
- no connection
- wrong connection
- ....what ever

an exception occurs that just says "assembly name of resource not
found".

Maybe there are different numbers - this might me right - but that won't
help me because:
- how should i know EVERY SINGLE possible error-no.?
- how should i code a big case to display better messages ... this
option is included in the framework, i just need the System-SR-Package.
Why code it again?
- sure it's for the developer. I catch errors, so the application is not
affected. But i cannot help my clients if i don't know what happened...
a number wouldn't help me because: where should i look to find them?
- And: if the error-messages are good (and they are!) the client can
help himself very easily without contacting me...


Boris
 
B

Boris Nienke

You'll still get a different exception, at least in number. Your app should
always be checking for errors and provide the user something meaningful.
The error resource is intended as a developer resource, nothing more.

that exactly what the CF is doing already - if the System_SR-package is
installed!
Why doing it again by myself and maybe forget some (many?) possible
errors?


Boris
 
B

Boris Nienke

This resource assembly is for use during debugging only and you are not
licensed to distribute it with your application. You'll need to build your
own error handling and system to display a "friendly" error message to the
user.

that's too sad :'(

But how to build such a complete error-handling by myself? Where i can
find a complete list of those error-messages and how to globally catch
them?

boris
 
D

Daniel Moth

find a complete list of those error-messages and how to globally catch

That is the crucial bit in my opinion: "How to globally catch them"

There is no global exception handling capability in the CF like there is on
the desktop. The official line is that you must try catch every single
(public) method yourself. That is not acceptable. Every software app ships
with bugs and no matter how hard you try you will miss a condition where an
error occurs. And when that happens you get an error dialog which is not
yours (what happened to the principle that frameworks do not put up any GUI
of their own) and furthermore the text in the dialog has nothing to do with
the original exception condition since System_SR is not distributed.

Hopefully MS will see the light and offer us global error handling with CF
2.0

Cheers
Daniel
 
T

Tim Wilson

And I understand what you're saying. Why do something twice? If it's already
done then leverage that infrastructure. But the question is as follows:
"Can you legally ship System_SR_* packages with your application?"
I haven't looked into this to see if it's actually legal to redistribute
these packages and so I would think, on gut instinct, that it's not legal.
And both Alex and Peter have said that you cannot do this as well. So at
this point I think that you have no choice but to use try/catch blocks and
do your best to figure out meaningful messages to display to the end user.
 
B

Boris Nienke

That is the crucial bit in my opinion: "How to globally catch them"

yesss.... that's why i'm asking ....
[...]and no matter how hard you try you will miss a condition where an
error occurs. And when that happens you get an error dialog which is not
yours [...] and furthermore the text in the dialog has nothing to do with
the original exception condition since System_SR is not distributed.

you got it! :)
That's my point of the problem. If i start to "rewrite" the
System_SR-Package and build catches around every single command that has to
do with my online-functions... well... then the executable will raise up a
lot i think... but in the end i'm sure i have missed some exceptions... or
will show the wrong text etc... I'm sure i will need an exception-handler
for the exception-handler then :)
Hopefully MS will see the light and offer us global error handling with CF
2.0

hopefully!
Meanwhile it would be OK if i could ship the System_SR file for my
preferred language...

Boris
 
B

Boris Nienke

System.SR.xxx assemblies are not redistributable. You do not have a license
to package it with your application and the end-user does not have means of
obtaining it short of acquiring the SDK

Hey - i've searched a bit further and see what i've found:
(long link, watch out wrapping)
http://msdn.microsoft.com/library/d...s/dv_evtuv/html/etconresourcelocalization.asp

Here i can read this:
"You can create and distribute world-ready device applications to
accommodate localization needs for both the developer and the user."
[...]
".NET Compact Framework exception strings" [...]

Not a single word about "no license to distribute these files" or "just
internal for the developer"

I think these files are made for distribution... if they were just for the
developer it would be enough to have them in english - just like the IDE -
wouldn't it?

Maybe i should ask MS... but i don't think i will get an answere...

Boris
 
A

Alex Feinman [MVP]

Boris,

I clearly remember being told that these files were not redistributable. But
things change (and MSDN content does too). Let me find out, since the issue
is indeed raised quite often.

--
Alex Feinman
---
Visit http://www.opennetcf.org
Boris Nienke said:
System.SR.xxx assemblies are not redistributable. You do not have a license
to package it with your application and the end-user does not have means of
obtaining it short of acquiring the SDK

Hey - i've searched a bit further and see what i've found:
(long link, watch out wrapping)
http://msdn.microsoft.com/library/d...s/dv_evtuv/html/etconresourcelocalization.asp

Here i can read this:
"You can create and distribute world-ready device applications to
accommodate localization needs for both the developer and the user."
[...]
".NET Compact Framework exception strings" [...]

Not a single word about "no license to distribute these files" or "just
internal for the developer"

I think these files are made for distribution... if they were just for the
developer it would be enough to have them in english - just like the IDE -
wouldn't it?

Maybe i should ask MS... but i don't think i will get an answere...

Boris
 
I

Ilya Tumanov [MS]

Boris,

All errors are _your_ errors even if thrown from somebody else's code.
This is because these errors are result or _your_ actions.

Say, there's error in SMTP function. This is because _you_'re using SMTP
and something gone bad.
It's up to you to catch these exceptions and take corrective action and/or
display a high level message to your customer.

This message can not be technical like messages in System.SR.
It should explain what's going in terms your customers would understand.
You should also suggest corrective action if you can.

For example, you get System.IOException on attempt to read e-mail.
You should not just print out exception message (which would be "Unable to
read data from the transport connection").

Instead, you should:

1. Retry couple times.
2. If unsuccessful, print out message like this: "Could not get mail from
the server, please try again later or contact support at 555-1234".

Bottom line: your customer's don't need System.SR as it contains technical
messages for developers they would not understand.
It's up to you to provide adequate error description.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
B

Boris Nienke

LOL - :)

sorry, i had to laugh a bit... excuse me, i try to explain:

1.) you are right - a bit. One should catch all errors and explain where
and why they happend. So this is right and it's my opinion too!

2.) when i use SMTP (which is not my code but code of the
..Net-Framework) then errors are NOT my errors just because i USE Smtp!
Of course i can catch exceptions (fact is, that i can't in all cases!
but OK...) but i cannot explain every possible error... why? Because i
havn't written the SMTP-code, i don't know what it's doing and why it's
failing... all i can do is "something bad happened while resolving a
DSN"... not very helpfull for the users, isn't it?

3.) the System_SR Messages are NoT that abstract! Well, i know the
german ones and have no idea about the english ones... but the german
resources will give exception-texts (that i can catch and write into a
log) like (translated back to english by me) "There is no active
connection to the internet" or "The Host is misspelled or not available
at the moment...." and so on... VERY helpfull when showing and writing
into a log-file

4.) i don't why i start to discuss if the System_SR is helpfull for the
end-users or not... it's helpfull for ME (at least) when the user is
able to send me a details logfile... but without the System_SR package i
cannot produce such good lockfile because i simple can't expect every
single possible error that may happen just because i'm using .Net-code
:) ....

if there is a good way to do this by myself, i will do it! Currently i
do a Try-Catch around most functions. and in the catch i write a
"e.message" (where e is the exception) into a logfile. If it's a
sensitive function i show the exception to the user (and in many cases
with my own text which is very special to the application like "Do this
and that and then try again"... you know... but i can do this just in
the cases where i KNOW what could happen ;)

Boris
 
B

Boris Nienke

Boris,

I clearly remember being told that these files were not redistributable. But
things change (and MSDN content does too). Let me find out, since the issue
is indeed raised quite often.

would be really nice if you could find out some good news - i have
searched a lot more but havn't found restrictions yet...

Boris
 
I

Ilya Tumanov [MS]

Cool, I have no idea I'm that funny. :)

Now back to business:

#1/2:

Yes, you should catch all exceptions and process exceptions you could
anticipate.

In C almost all API's returns error codes to notify you of failure,
exceptions are used to perform the same task in C#/VB.Net.
As you would process error codes in C, you should process exceptions in
C#/VB.Net.

For example, if you're using SMTP code, it's pretty easy to figure out
there might be some network related exceptions.
You might not know exactly why it's failing (may be all Cisco routers gone
mad), but you can figure out what to do if something failed.

And yes, you're ultimately responsible for all exceptions (unless there's a
bug in our/3rd party code and exception is thrown in error).
You're getting an exception because you did something and that operation
can not be performed properly.

You got an exception resolving name with DNS? Perhaps, network is down. Or
DNS server is down.
Or TCP/IP configuration on device is incorrect. Or server name entered by
user is incorrect.
Is it DNS class problem? Not at all, it's up to you to process and fix it.

And yes, you could do much better than "something bad happened while
resolving a DSN".
You can try backup server. You can verify if network is up. You can verify
if you can reach DNS server.
And you sure can suggest corrective action.

Now, how would you know which exception to expect? Easy, it's all in the
documentation.
For example, let's take a look at Dns.GetHostByName() documentation:

...
Exceptions
Exception Type Condition
ArgumentNullException hostName is a null reference (Nothing in Visual
Basic).
SocketException An error is encountered when resolving hostName.
SecurityException The caller does not have permission to access DNS
information.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aha, here's the list of exceptions you can expect and thus have to process.
Yes, it's not your code and you have no sources, but you know what to
expect from it.

#3.
You're developer; this is why System.SR seems to be good enough to you.
Too bad, it's useless to your customers.

#4
I do see your point. I'm sorry it's not redistributable.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: Boris Nienke <[email protected]>
Subject: Re: how to let user instll: System_SR_de.cab
User-Agent: 40tude_Dialog/2.0.12.1de
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <[email protected]>
<[email protected]>
 
B

Boris Nienke

#1/2:

For example, if you're using SMTP code, it's pretty easy to figure out
there might be some network related exceptions.
You might not know exactly why it's failing (may be all Cisco routers gone
mad), but you can figure out what to do if something failed.

And yes, you're ultimately responsible for all exceptions (unless there's a
bug in our/3rd party code and exception is thrown in error).
You're getting an exception because you did something and that operation
can not be performed properly.

Example:
- i have a MDA-I with WM2003 installed
- The user opens a connection to the internet
- The user makes something wrong because he selected the WAP connection
instead of the GPRS-connection!

- now the code tries a SMTP.ResolveHost(MyHostName) (something similiar)
- i have a Try-Catch around that!
- BUT: after a timeout the whole application stops with a full-screen .Net
Error message
- WITHOUT the System_SR there is just "Assemblyname of ressource not found"
which implies, that there's something wrong with MY code and the error
(halt!) comes from that
- But WITH the System_SR there comes a very clear error-message that
describes why the system is stopped (havn't got the long text in my mind
but when i read this it was really clear - for the customer too!)

Well... here i DO HAVE a Try-Catch but i'm NOT ABLE to catch this error!
Without System_SR i would never have searched in the connections because i
thought it was my fault (because there is a try-catch i never thought the
application could HALT in any way at THIS point, so i searched all over the
code.... until i installed System_SR and saw what was going wrong!)

And yes, you could do much better than "something bad happened while
resolving a DSN".

see above: in some (many?) cases i can not :'( ...
Now, how would you know which exception to expect? Easy, it's all in the
documentation.
For example, let's take a look at Dns.GetHostByName() documentation: [...]
Aha, here's the list of exceptions you can expect and thus have to process.
Yes, it's not your code and you have no sources, but you know what to
expect from it.

yes - right - but how could i write an exception-handler that handles such
hard HALTs as described above to give the user a better understanding of
what happend?

And why the hell should i code KBs or maybe MBs of own exception-handlers
(and surely will miss some) if it's allready build into the system? That's
really strange

It makes sense to catch errors and give clear messages to the customer
where i except something could go wrong.
But in the else-cases of the catch-clauses i have to display the message of
the exception - at least to write it into a log... but HERE is the point,
that in these cases i simply get NO message withouth System_SR - that makes
searching a error a bit hard because as a developer you cannot always
recreate the error in your own environment - so you need the logs from the
user... but without text? I may know where it happens but not why...

#3.
You're developer; this is why System.SR seems to be good enough to you.
Too bad, it's useless to your customers.

it's not ;-) the texts are really good!
#4
I do see your point. I'm sorry it's not redistributable.

:'( that's really TOO SAD! You are absolutely sure about that?
Do you have a link where this is described?

Boris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top