tags:

views:

208

answers:

2

I'm attempting to deploy a WinForms app in a Citrix environment. It's been working reliably for some time on other physical and virtual machines, but it's failing, only when running the application on a Citrix desktop.

The failures are typically where we have mixed-type data as strings in a general-purpose settings table in the (SQL Server 2005) database, and then convert them to the appropriate type at run time.

So for example, there's a '1' on the database in a varchar(50) column, it's read in, and then something like

dim myNumericVariable as integer = Cint(dr.Item(columnName))

(where dr is the DataRow coming out of ADO.NET).

The message in the thrown exception says:

Conversion from string "1" to type 'integer' is not valid

This kind of failure is happening all over the application, but only in the Citrix environment. In all our other environments it runs fine, but I have no idea whether the fact that it's Citrix is just a fluke and there's some other underlying reason.

It's a VB.NET app, .NET 2.0, with Strict and Explicit both on, compiled for x86. It works perfectly on XP SP3, also Windows 2003 Server x64.

I'm at my wits end with this - I've looked all over and found no hint as to why I'm seeing this behaviour. I'd be very grateful for suggestions. If you need more information about the environments, or the way the app is built, I'll happily edit the question. Thanks in advance..

+2  A: 

There's a known bug; hopefully that will sort it for you.

Steven Robbins
Thanks for this... the messages I'm getting are certainly the same as in the KB link you give here. This is a promising lead, but sadly I don't have access to the registry on the relevant servers, so I'll have to wait, possibly till Monday to find out for sure!!!
ChrisA
I've tried to reproduce the error locally, too, by putting a value into the reg key referred to in the article, on my local machine, but the error doesn't recur.
ChrisA
Hopefully it will fix it. There's probably other mitigating circumstances that cause the problem, so I don't think you can get it to "break" with just the reg key.
Steven Robbins
Woohoo!!! It has fixed it. Thank you soooo much :)
ChrisA
A: 

Yeah, I'm not seeing any errors on my 32-bit Vista laptop, either, so it's tough to say.

Maybe you could try Integer.Parse()?

Dim yourVar as Integer = Integer.Parse(dr.Item("YourColName").toString())
Christian Nunciato