Running .NET WinForm Applications on Citrix

We have been creating a major .NET WinForm application that will be deployed in Citrix for a few months now.  Basically, think of it as a custom rewrite of MS Access (note that this wasn't a techie's idea) that works against MS SQL Server.  Of course, business as usual doesn't like any limitations, so we have way too much data and far too many features to work in a shared environment like Citrix.  Or do we?  That has been the bane of my existence for the last couple of months, and unfortunately there doesn't appear to be many others that have such experience to share.  My main concern has been whether or not the .NET garbage collector would see the 4GB of RAM and think it could have it all, unaware of the other users on the box.  I have posted that concern to various forums several times, and I've seen a few others with similar concerns, but no one ever answered, other than people telling about .NET works in general without any Citrix experience.

Well I can finally report that things look pretty good afterall -- after much painful performance tuning and tracking down a memory leak in a 3rd party grid control.  There were many small performance gains, but the biggest one is something I still don't understand, but the numbers are proof.  Basically, we have a business class that has a method that gets a DataSet and stores in one of its members, and then the calling class separately sets the grid's datasource to the class property that exposes that member.  It seems like that would be fine, since a DataSet is a reference type, but it turns out that setting both the class member and the grid datasource in separate steps takes twice as much time as having the class method set the member and then return it to the caller!  I would love it if someone can explain that one to me -- my team told me it didn't work this way, but the numbers are proof, and none of us understand it.

So we were hoping for good results with our test this week -- sure enough, the first 45 minutes testing the application in Citrix with 15 users looked very good from a user's point of view.  But then things started grinding to a halt, and didn't pick up for 30 minutes when most of us started closing and restarting the application.  The naysayers in our company quickly released their observations that our application could not even support 15 users, which isn't very good in an expensive Citrix environment.  The infrastructure guys pointed to some poor .NET performance counters -- but wait, those numbers didn't get bad until 15 minutes after everything went to crap, and all the .NET numbers before then looked sweet.  The problem instead is obvious when you look at the overall memory numbers -- there was a gradual memory leak, unrelated to .NET, that eventually swamped the system, and eventually that also affected the .NET numbers.  I finally found the control, the 3rd party grid, that had the memory leak, and it turns out they already knew about this and had a hotfix, not to mention a newer version that we were still investigating.

We will now start updating that grid control, and I hope to soon be able to report a better test result in Citrix.  There may still be problems, but the numbers once again speak for themselves, and I think its pretty clear that our .NET app ran better than Access and our older Access-like applications that we are trying to replace.  The naysayers see .NET start with 20MB and freak out saying that its not going to scale, but that initial grab doesn't mean it takes 20MB to run the app, it just means .NET is getting memory so it doesn't have to later.  Its actually quite an incredible feeling to look at the graphs of .NET's memory and garbage collection when you have 15 people on a Citrix box, each looking at about 3 separate instances of our main view, each having an average of 25000 rows of data (some much more), averaging 25 columns (but some with more again).  .NET works great, and so does MS SQL Server, which we use exclusively with some of the world's largest databases -- that's right, we don't have any instances of Oracle at all.  Life is good.

Update: Life is NOT good since none of the global .NET memory performance counters that I relied on actually work!

Published Friday, January 23, 2004 3:13 PM by PaulWilson

Comments

# re: Running .NET WinForm Applications on Citrix

Hi,

I'm looking at building a win form app running on citrix for one of my client. Thank you for the heads up. More info regarding performace once you sort out your 3rd party control problems would be great.

Clarke

Friday, January 23, 2004 4:24 PM by Clarke

# re: Running .NET WinForm Applications on Citrix

We are just starting to look at some .NET in a Citrix MetaFrame environment, though none of it is WinForms. As you pointed out, it is really difficult to get clear answers on this, isn't it?

Friday, January 23, 2004 11:28 PM by Jerry Dennany

# Still can't find everything on the Internet...

Friday, January 23, 2004 11:47 PM by TrackBack

# re: Running .NET WinForm Applications on Citrix

Loading a DataSet while it's bound to a DataGrid, is much slower than loading it and then bind it. That's probably the issue you are running into.



Sunday, January 25, 2004 6:07 AM by Andres Aguiar

# re: Running .NET WinForm Applications on Citrix

I just by happenstance noticed this blog. My company is, from what I understand, Citrix's largest deployment of a server farm. I don't know what the count is but I know our server farm is 100+ running citrix and of those 25 boxes will be used for an application we are developing using .NET winforms also (using several NLB App Servers, SQL 2000 and remoting). The application is basically a CRM app with a bunch of other fluff. We will be starting up some System Testing in a couple weeks across a couple servers with about 20 testers. Within a couple months our training environment will be handling about 300+ users and our final deployment will be around 3000 users (1200+ simultaneous) across around 25 servers slated for june. I'd be happy to share my experience with you guys if you'd like (unofficially of course).

I was in the same boat as you guys when we were looking for any real world, large scale, .NET winform citrix deployments but came up with Nill and we've had to rely on the fact that they're both supported environments for .NET. We also have a third party grid that I'll now keep a close eye on hehe (infragistics).

Regards,

Josh

Thursday, January 29, 2004 12:18 PM by Josh

# re: Running .NET WinForm Applications on Citrix

Hey Josh:

I don't know if we have a 100 yet, but I know we will by the time this project is rolled out to everyone, since this project alone will have over 50 citrix boxes when done, on top of quite a few we already have. I'd love to hear (unofficially drop me an email) more about your experiences since it sounds like you've gotten farther than us. BTW, Infragistics is what we're using too -- the leak was in an early version of 2.0, the fix was out a long time ago, and hopefully everything is still good in 3.0. We do know that 3.0 performs overall much better than 2.0, but we're still talking about using a custom version since we have the source and have already found some problem areas. I'm in Atlanta -- where are you?

Thursday, January 29, 2004 12:47 PM by Paul Wilson

# re: Running .NET WinForm Applications on Citrix


Hi Paul,

I work for a large health insurance company and I'm actually in Raliegh NC but I run solo down here. Our core group of developers is located just outside Pittsburgh PA. I'd be happy to shoot you off some details and maybe we can keep in touch and share some experiences.

We're actually in the first phases of the project and we're starting off system testing on one of our citrix boxes at the end of next week. To be honest I'm expecting more problems from our app then from citrix :) but we do have a lot of unknowns. At the same time we deploy the application they're updating our citrix farm from NT/Citrix to Windows Server 2003 and Citrix Metaframe XP so they're anticipating better performance and being able to fit more users on one box but there is a lot of unkowns and risks because of those unknowns IMO.

I think the project is a very typical corportate project that starts out with the best intentions/timelines but is turning into a test of stamina, gotchas, and "wish I would have known/done that" but I'm having a good time with it outside of the extra hours and I'm learning a lot more then I ever did in my lab and building small asp.net sites or the cram sessions at VS Live(although those are great).

I'm far from a newbie but I traded in my servers and testing labs for a family recently so I haven't been keeping up on things as much as I used to but I'd be happy to share my experiences and planning (what's planning hehe) with deploying a .Net solution on Citrix with you. There are likely other developers out there in similar circumstances looking for info so if we could somehow help share the knowledge that would be great too.

Well another long night... heading home now.. I'll shoot you off an email.

Kindest Regards,
Josh

Thursday, January 29, 2004 10:54 PM by Josh

# Global .NET Memory Performance Counters Do NOT Work

Wednesday, February 04, 2004 10:18 PM by TrackBack

# Leak Found in the .NET XmlSerializer

Wednesday, February 11, 2004 4:20 PM by TrackBack

# re: Running .NET WinForm Applications on Citrix

We have a WinForm application running on a Citrix that is having an interesting problem. We are having a problem where the application hangs after a period of time and the application throws a "unhandled exception error". It seems to be coming from the 3rd party Grid that we purchased. Does this sound similar to your memory leak issue?

Friday, July 09, 2004 3:53 PM by Mark Huse

# re: Running .NET WinForm Applications on Citrix

Sounds very similar. However, I don't remember how much this post was updated, but we eventually found our issues to be much bigger (if not entirely) elsewhere. I know these other leaks were noted in my blog, but maybe not in this post. This isn't to say there wasn't a problem in the grid, but the problem only surfaced in reality when there were already other memory pressures in the first place. Once we got those more under control, then we never had another grid problem. We still couldn't put too many people on the same Citrix box, but that was due to the very bad business requirements of giving users ALL the data they wanted.

Friday, July 09, 2004 3:58 PM by Paul Wilson

# re: Running .NET WinForm Applications on Citrix

Hello Paul,

I work for a firm that is also currently trying to deploy a .net application on Citrix. I was wondering if it would be possible to give even a ballpark of the kind of hardware that you were running citrix/.net app on?

The reason this is of interest is our numbers are not much better than you have described here, getting about 15-20 users per citrix box (.net app + citrix). In our case the average Citrix box has a single 3.0 GHz CPU and 2GB of RAM.

Any feeback would be a huge help! thanks!

Raif


Wednesday, July 14, 2004 9:26 PM by Raif

# re: Running .NET WinForm Applications on Citrix

Our boxes were dual-processor with 4 GB RAM -- I don't know the CPU specs. Keep in mind our biggest problem was the very bad business requirements to allow unlimited number of records in a rich grid control with too many other features to count. I honestly believe a better set of requirements would have yielded more users per box, although I also am not convinced it would ever get the 50+ users that were common with Access and other non-.NET apps!

Wednesday, July 14, 2004 9:54 PM by Paul Wilson

# re: Running .NET WinForm Applications on Citrix

Thanks for the feedback Paul!

We have exactly the same issue here, as our client wants complete sets of data in the grids (no record limits). So we end up in some cases with very large memory requirements to load in all that data, just so they can get the same rich grid controls that you are likely describing.

I am also convinced based on our observations that 50 users would be an amazing feat for a .net application via Citrix. At least an application that loads such large sets of data.

I have a round of more interesting testing to be done on this whole setup in the weeks/months ahead. If I find anything that might be of help, I will let you know!

Thanks Again,

Raif

Thursday, July 15, 2004 11:33 AM by Raif

# VB 6.0 application on Citrix

I may be sounding novice in asking this question, but would like to know:
Is there any specific coding we need to do in our existing application ( mine is a vb 6.0 appln) so that it runs w/o problems in an citrix enviro?

prompt reply will be appreciated.

Thanks
LS

Tuesday, May 23, 2006 7:03 AM by LS

# re: Running .NET WinForm Applications on Citrix

There's just a few things, although I may not recall the exact list either, so I would still recommend you looking this up officially (I know I've seen such a list online and in books in the past).  The things I recall are that you must not assume local file paths -- instead you should use the appropriate APIs to get the user's assigned folder on the network.  I think that you were also not allowed to use the registry to store information, or at least you were limited in some  very real ways.  There could also be some issues with permissions if you assume users have more than the minimal assigned -- so overall you should keep in mind that users are not working in an unrestricted local environment.

Tuesday, May 23, 2006 9:07 AM by PaulWilson

# Deploying .NET WinForm Applications on Citrix

Does anyone have any thoughts on deploying the WinForm app in a Citrix environment?  Specifically how to get around locked assemblies?  Our current solution is to kick everyone off the server and then copy .dll's.  Since this is a 24x7 operation, not very convienient.

Wednesday, May 31, 2006 12:45 PM by Jan

# Mr

Something we were considering was each user having their own \bin folder on a shared file server (This is a users F:\ drive in our mappings).

This would mean each user would be running their own DLL's & we could force updates to the F:\bin folder whenever we wanted. We have an application launcher program that checks versions when starting a process and forces updates where nescessary.

Now this does 'work' but I think it introduces a number of problems. In particular, there is a perf hit when assemblies are loaded at run time. If your network has a blip, the app would probably fall over. Also, I have been suffering with the 'External Component has thrown an exception' error which I'm fairly certain will be resolved by deploying locally.

I was weighing this up as a control vs performance offset...I would like to be in control of the applications' deployment and any hotfixes I needed to apply...but, I think instead I'm just going to deploy on C and be really careful with application updates. We have to schedule in the updates with the Citrix farm team who then update a single server and roll out the image to the farm. This means updates can only take place out-of-hours & we have to be really careful with our QA stage...!

Is something like this not possible in your 24x7 environment? Is there never a point when there are no users using the assemblies?

Friday, June 02, 2006 7:54 AM by Dylan Morley

# re: Running .NET WinForm Applications on Citrix

One of the main reasons for using Citrix is to simplify deployment, so I can't imagine ever creating user specific deployments as you've describe.  As for how to manage deployment, my experience is that companies that invest in Citrix also invest in the appropriate people with experience in Citrix deployments, which typically involves some serious planning.  I do not have any idea what all the options may be, but I have seen weekly windows for Citrix maintenance, usually at times to affect the fewest people in a global company.

Friday, June 02, 2006 8:35 AM by PaulWilson

# Running .NET WebForm Applications on Citrix

I was wondering if anyone had tried running a Webform application on Citrix? We have a case where once the citrix session starts and calls the web form, the focus should be on the text box on the form. However the focus seems to still be on citrix and the user has to click in the textbox (even though the cursor is in the form - when you type, nothing appears) to enter text. Any thought?

Thursday, June 29, 2006 5:57 PM by Angela

# re: Running .NET WinForm Applications on Citrix

I've personally not worried about web apps on Citrix -- I'm also not real sure why you would bother to do so.

Friday, June 30, 2006 5:44 AM by PaulWilson

# re: Running .NET WinForm Applications on Citrix

We have clients that are running very old slow machines. They are going to connect to our new Citrix servers to kick off some desktop applications as well as our web applications. (Citrix talks to our web servers). With over 100 different client locations and 5-10 machines at each location, this was a less expensive way to upgrade the client's environment

Friday, June 30, 2006 10:18 AM by Angie

# re: Running .NET WinForm Applications on Citrix

We're also trying to run .NET winforms on citrix using infragistics.  Our app's are copied to a file share, and then the exe is fired up from there.  We copied our infragistics dll's along with the rest of the files in the bin directory to that file share.  When the users start up the exe, it just opens the form and shuts down.  If we copy the same files over to a PC, it works fine. Has anyone else run in to this situation in regards to using the infragistics controls in a citrix environment deploying to a file share?  

My thoughts are that we would need to register the infragistic dll's in the GAC of all 3 citrix boxes we have.

Thursday, August 23, 2007 9:45 AM by MikeVoissem

# re: Running .NET WinForm Applications on Citrix

A file share is just where something is stored -- it does not actually run on the file share.  So yes, if something is necessary to run the exe, then it must be installed on the boxes that are going to actually run it -- citrix boxes in this case.

Friday, August 24, 2007 10:26 AM by PaulWilson

# Deploy .net windows application on citrix | hardware wacool

Pingback from  Deploy .net windows application on citrix | hardware wacool

Saturday, October 02, 2010 10:07 AM by Deploy .net windows application on citrix | hardware wacool

Leave a Comment

(required) 
(required) 
(optional)
(required)