Category Archives: dotNET

Boosting Windows Forms App Performance – yay!!!

I can barely contain my excitement over this article, “Practical Tips for Boosting the Performance of Windows Forms Apps” by Milena Salman in MSDN Mag (March 06). I read most of it this morning over breakfast and came down to my office with the sole intent of opening up the windows forms app I am getting ready to re-deploy in it’s shiny new .NET 2.0 makeover and finding any place that I can apply all of the awesome advice Milena dishes out in this article.

Of course, now it’s 2:00 and if I can just turn off Outlook, I.M. and the phone, I might actually get started on this.

Don’t Forget: www.acehaid.org

How I use XCeed streaming compression component to return web service data

I have mentioned my use of the XCeed streaming compression for returning data from web services a number of times in this blog. Here is a post when I first discovered that it reduced a 2.9 minute download of  4 MB to 12 seconds! I have since mentioned it a few times but never showed exactly how it is coded. Last night Rod Paddock pinged me to find out if I thought that component would work for him and it turned out he had the exact same scenario as I have been using it for. Therefore I showed him my code and thought I would put it here as well.

The key to all of this is that the component compresses bytes, so whatever you are returning, you want to convert it to bytes first. I’m sure this may make some web service purists cringe, but is it any different than returning a binary attachment with MTOM – which is a W3C standard? (I’m open to further education on this, my purist friends!)

Anyway, back to stream compression.

Let’s say you have a .NET client to .NET service scenario and are writing both ends. (That is a setup to avoid any rotten tomatoes for using a dataset in this example 🙂 ).

On the web service end, I have a method that accepts the dataset, converts it to a byte array, compresses that into another byte array using XCeed QuickCompression class and then returns this compressed byte array.

Using ms As New System.IO.MemoryStream
 ds.WriteXml(ms)
 Dim bytearray(ms.Length) As Byte
 
bytearray = ms.GetBuffer
 
Dim CompressedBytes() As Byte
 
CompressedBytes = QuickCompression.Compress(bytearray, CompressionMethod.Deflated, CompressionLevel.Normal)
 
Return CompressedBytes
End Using 

On the client end, having called this web service operation, I decompress the received bytes into a new byte array, then read that byte array into a new DataSet. Et Voila!

Dim ds As New DataSet
Dim compressedBytes() As Byte = WSProxy.GetDataSetasCompressedBytes
Dim byteArray() As Byte
= QuickCompression.Decompress(compressedBytes)
Using ms As New
MemoryStream
  ms.Write(byteArray, 0, byteArray.Length)
  ms.Position = 0
 
ds.ReadXml(ms)
End Using

I remember when I was first looking for a means of doing this and reading about this component, it wasn’t obvious how to do this in a web service, so I had a pointer from someone in tech support as to how to accomplish this.

I have used this combined with WSE 2.0 and now with WSE 3.0 to protect this data in addition to compressing it. If you have really humongous files, you can combine compression with MTOM in WSE 3.0 as well. I’ll have to check this out with WCF at some point.

Don’t Forget: www.acehaid.org

Some notes about DevTeach: Early bird discount, user group discounts, get to know the speakers

Jean-Rene sent out a great email about DevTeach today. Here are some key elements from it:

Save 200$ by taking advantage of DevTeach early bird.
This year, we are offering an early bird of 200$ CAN for attendees that are registering before February 28th, 2006. Registered attendees have accessed to the DevTeach 2005 Archive sessions material for download.

User group members rebate at DevTeach 2006
The User Groups Rebate program is back in 2006. We are offering 50.00$ off the registration cost to all members of user groups registered with INETA, Pass, Culminis or the Universal Thread User Group Meeting Tracker. To benefit of this rebate, members need to enter a rebate code when processing their registration. This rebate can be combined with the early bird discount which gives a 200.00$ rebate until Fabruary 28th. User group leaders can request this rebate code good for 50$ off the registration by sending an email to [email protected].

Get to know our speakers by reading their blog and listening to their talk show interviews.
Most of our speakers write regularly in their blog and have been interviewed by the Dot Net Rock Talk Show or the Visual Studio Show. Get to know our speakers by reading their blog and listening to their latest interview on talk shows. The DevTeach conference include a top selection of speakers having a strong experience in various areas. Most of these speakers are presenting at major conferences around the world on a regular base and in other areas as well such as user groups, corporate training and class training.

Don’t Forget: www.acehaid.org

ClickOnce wants me to update from the deployment server when I’m in debug mode?

Here is a project that I am now publishing through clickonce.

I just opened the project up in VS2005 and saw all of these warnings. Sheesh, here we go again…

(Note: I got an email from Patrick Darragh who is a Program Manager on the VB Team and has a lot to do with ClickOnce. Patrick tells me that “those warnings are controlled by the ‘Verify files uploaded to the server’ property on the Publish Options dialog off the Publish tab.  If you uncheck this property, the warning should go away.”)



Don’t Forget: www.acehaid.org

Unhappily accepting the “whole kit n kaboodle” with clickOnce- for now

I have really been trying to force ClickOnce to let me publish ONLY the changed files, but according to this forum post by David Guyer, I should probably just give up.

Here are my issues.

1) Moving the new deployment folder and manifest to the production server takes way too long.
  1a) part of the reason for this is that I have 3rd party dlls that I have as INCLUDED rather than Pre-Requisites. Even with all of my security, I’m a little nervous about controlling the deployment of 3rd party licensed tools and this feels safer. So with some Infragistics, Janus and XCeed components, this adds 4.5 MB to my deployment files. This is one place I will have to focus on paring it down. However, with the rate at which infragistics updates its components, this provides another excuse for leaving it in the Includes.

2) Even though all of the documentation promises that the client ONLY pulls down the new files from the server, the update dialog says that all 6MB are being downloaded and looking in the GAC I see all of the files in the latest folder, not just the new ones. This is acceptable wrt speed on the intranet, but what about our dialup users out there on the web. I’m not the only one who is questioning this.

UPDATE
I have been keeping at it and learned a little more about #2. Yes, I have to publish the entire app over again, but if I do it right, the files that are not new will not get downloaded. The way to acheive this is to make a copy of the previous deployment folder, which will mean all of the previous files will match up with the hash that the client machine has for them. Then use the MAGE tool to create the manifest. (See this msdn doc and look for the “next steps” section re: updating.) Then the client machine won’t bother pulling those down again and instead, grab them from the last folder. Or something like that. Either way, the client will still say “downloading xxxMB” where xxx is the size of the complete app, but it is only downloading new stuff from the web server and kind of “cross-loading” so to speak from a sibling folder already on the client.

Don’t Forget: www.acehaid.org

46 Attendees at our joint VTdotNET/VTSQL meeting last night!!

Vermont.NET turned FOUR at our meeting last night and we had a joint meeting with the Vermont SQL Group which is a spin off of VTdotNET. This was the 2nd of our two launch events (the first was related to INETA and the 2nd to PASS) so we had 5 more VS2005/SQL Server2005 licence packs to give away.

So, I counted 46 at the meeting. That is our 3rd largest meeting ever.

1) Ken Getz (INETA): 50
2) Keith Pleas/Thom Robbins/ INETA 100th Speaker event and MSDN film crew: 50
3) Laura Blood/Roman Rehak/SQL2005 Launch: 46
4) Rocky Lhotka (INETA): 40
5) Laura Blood/VS2005 Launch: 40

Laura and Roman did an awesome job. Laura presented the slides that MSDN created for these events. That was some chore because each slide was jam packed with information, so she pointed out highlights. Then Roman did the demos and he used a lot of his own (from his job as SQL Server guru extraordinaire) and also a few from some other sources that he acknowledged.

The most interesting thing to me was my new persective on Service Broker. I have only really looked at it from what it provides for Query Notification and didn’t really “get” it’s real purpose. Now I realize that the reason for this is because I am a) not a DBA with the problems that it solves and b) not doing big time enterprise work. I understood the queues and the services but was missing the big picture. But I finally got it and it’s really easy –  by sending processing chores off to the service broker, you can distribute your processes (much more easily than the previously available methods). Some examples: Scenario A is where you send a process such as executing a particular query off (asynchronously) to a service broker on a different box. Scenario B is where you queue up requests to be processed over night. It was a real “AHA!” moment.

He also did a great xml data type demo where he showed the difference between finding a needle in a haystack of xml formatted data stored in a (???) varchar field and finding that same needled with the data stored in an xml data field. The xquery/xpath was much more efficient, cutting a 40 second search down to a few hundred millseconds. Then by applying some of the indexing you can do with the xml data type, it got down even more.

There were many other great demos – CLR in SQL Server, and a B.I. demo – something I have never looked at or considered before – from Integration Services. Very cool, very impressive.

Thanks to Laura and Roman for a great meeting.

A few other highlights: cake for our 4th anniversary and goodies from local MSDN DCC Susan Wisowaty. Susan lives in Burlington, but is the DCC for New York and New Jersey.

Don’t Forget: www.acehaid.org

Vermont.NET is Four Years Old

Next Mondays VTdotNET meeting marks our 4th anniversary. I think after 4 years, I’m allowed to say that I’m very proud of this! VTdotNEt has created a real community out of the many .NET developers in Northwest Vermont. That was my ultimate goal. We also have a bevy of highly skilled .NET developers in the area, many of whom are already deploying .NET 2.0 applications. We have brought amazing speakers here month after month and definitely put the .NET developer community on the map.

I think everyone in the whole group should give themselves a pat on the back.

Mondays’ meeting is the part 2 of the VS/SQL 2005 launch, and a joint meeting with the VTSQL.org group. Since INETA and PASS were both creating these user group events, we got to do two between our two groups. So we have another 5 sets of VS2005 Pro/SQL Server 2005 Standard licenses to raffle off, certification test vouchers and some other swag. Laura Blood and Roman Rehak will be presenting. Rumor has it that Roman is going to be the demo god for the night.

Competitive Computing, who is hosting the meeting, is also providing the group with pizza and soda for the evening.

And, we will, of course, have birthday cake.

Thanks to everyone who has helped make this group be a great success!! That includes not only our members, but INETA, Thom Robbins, Joe Stagner, Russ Fustino (who encouraged me to start the group) and the many sponsors who have helped us with pizza, books and other awesome swag over the years.

Here’s to many more!

Don’t Forget: www.acehaid.org

Don’t Forget the AppPool when doing ASP.NET 1.x & 2.0 side by side in IIS6

I decided this needed it’s very own post as it is buried in another one.

I was way too eager to finally get .NET 2.0 onto my web server and missed a step and did not recognize the red flags going up trying to tell me that I missed this step.

If you are putting .NET 2.0 onto a web server already running 1.1, you need to create a separate application pool and set the app pool for .NET 1.1 apps to one of them and .NET 2.0 apps to the other one.

Most likely, if you are not creating any new 1.1 apps, you should attach the 1.1 apps to the new app pool and if you use a default app pool, let the .NET 2.0 apps own that.

Each application pool owns a different process. So I had the 1.1 and 2.0 apps running in the same process and they were really tangling with each other. I was getting Server Unavailable errors and even had a bizarre effect on a web service*.

In case you haven’t dealt explicity with application pools yet, that is a separate section in IIS. You have Application Pools Websites and Web Service Extensions. You can easily create a new application pool.

Then, in the properties of each web site you want to change, the application pool option is a drop down at the bottom of the first tab (Directory).

*That was a doozy. It was a 1.1 service that returns a DataSet comprised of 8 tables. Before returning the ds, I use XCeed stream compression to compress the stream. On the client end, I decompress and then read the stream into a new dataset. Suddenly the resulting dataset had taken two columns from the first table and created new tables out of each one. Once I figured out what was happening, I had no clue how to deal with it other than remove the compression and just return the datatable. In the end, the problem disappeared when I sorted out the App Pools!!

Don’t Forget: www.acehaid.org