|
-
Aug 10th, 2005, 11:26 AM
#1
Thread Starter
PowerPoster
wierd error
Hi
This is WIERD!!!!
If i run the app within the IDE or even within the device itself, there is no error! however if i run the app within Windows... it gives me the arguement out of range exception saying that the length cannot be less than zero.
All I am doing is this:
Assembly.GetExecutingAssembly().GetName().FullName
from that I get the error ONLY IN WINDOWS.... NOT in the IDE or the mobile device
any ideas?
-
Aug 10th, 2005, 10:15 PM
#2
Re: wierd error
Are you absolutely sure that that is the line that is throwing the exception? There is no argument and there is nothing with a Length property so I don't see how it could be. Having said that, you cannot just have that as a line of code because FullName is a property so you have to either assign it to a variable or assign a value to it, which is not possible in this case because it is ReadOnly. Are you trying to assign this string to an element of an array that is of length zero? I'd suggest putting MessageBoxes on either side of that line just to confirm that it is actually the one that is throwing the exception.
-
Aug 11th, 2005, 04:11 AM
#3
Thread Starter
PowerPoster
Re: wierd error
it is throwing an exception and I have tried this.
That value/command I assign to a string variable Ths works within the IDE and on the mobile device but NOT on the PC....
-
Aug 11th, 2005, 04:33 AM
#4
Re: wierd error
That does seem awfully odd. Why don't you try breaking it up into three seperate operations like this and see what happens:
VB Code:
Dim myAssembly As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly()
Dim myAssemblyName As Reflection.AssemblyName = myAssembly.GetName()
Dim myString As String = myAssemblyName.FullName
-
Aug 11th, 2005, 04:38 AM
#5
Thread Starter
PowerPoster
Re: wierd error
tried that too and i still get the error 
I mean its ok because it runs fine on the mobile device and thats what it was made to do... to run on the mobile device using the smartphone application project..... so if people run on the computer - it is not meant to work 100% (even though it was before I put on that command)....
It is interesting....
is there a way to detect if the app is running from a computer or mobile device?
-
Aug 11th, 2005, 04:42 AM
#6
Re: wierd error
I guess you could check which version of the .NET Framework it is using, which should tell you whether it is the CF or not. I don't actually know how to do that but I can't imagine that it's too difficult. Out of interest, which of the three lines was the one throwing the exception when you broke it up?
-
Aug 11th, 2005, 04:44 AM
#7
Thread Starter
PowerPoster
Re: wierd error

its at the first line.... and if i comment out the first line.. then the second line...
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
|