Showing posts with label WinFX. Show all posts
Showing posts with label WinFX. Show all posts

Monday, October 29, 2007

No more Acropolis!


Don't worry! nothing happened to the monument in Athens, Greece (beautiful place by the way).


I just read Acropolis is dead. The Acropolis team will be joining the Patterns & Prectices team and they'll release WPF Composite Client. We can't say we didn't see it coming... no seriously, we can't say it. But for some reason it wasn't a big surprise. As I got interested in Acropolis I was also picking on what the P&P team was doing and something didn't sound right. I got the feeling Microsoft didn't know exactly what they were doing since two teams were working on very "similar" solutions, or at least the purpose of them were very similar. And of course, Acropolis was new, P&P has been around for a while and lots of people are using the CAB today so, IMHO, it's a good call!


I guess that's it for the Acropolis Addin ;)

Read Full Post

Wednesday, September 12, 2007

WCF timeout exception

I know I said WCF is not well documented, and I still believe it but I must say that when I posted about this issue I got a guy from Microsoft (named Richie) who really stuck with me to help me solve the problem. Even though I solved it, I still don't understand why. Now I'll post about it (and the solution) so hopefully I will help somebody with it and maybe some one can explain to me why the generated code with svcutil does not have what I want.

It all started implementing security features in the DeKlarit WCF Addin. When I finally got it working I started testing, and at some point the server did not respond and the client exited with a TimeoutException. I added trace log and message log and noticed that it always felt on the 15th communication.

After going thru the Indigo forum and Googled around I found the problem is due to the amount of concurrent connections opened and the timeout the have by default. What?!. Well, that's exactly what I thought, at least the NetTcpBinding (the one I'm using right now) has a default configuration that works in some limited cases.

How did I solve it? Closing the base channel every time so the connections won't add up. Even though it's been fixed I still don't understand why the generated code by the svcutil does not have those "close" calls.

Somebody? Anybody?

Read Full Post

Monday, September 10, 2007

WCF not well documented!

I know it's a pretty new technology, but I believe Microsoft should have done a better job with it's documentation. If you take a look at Microsoft's WCF forum you'll notice for the kind of questions people is doing that something is missing. There's of course the WCF for Dummies example where you host your services in your IIS and create a win app as the client. Everything goes smooth there. But what if you want your services to run as a Windows Service? what if you want to test it as a ConsoleApp?

I believe there's still some critical parts missing. If you come from Remoting you had an easy way to startup all your services with the RemotingConfiguration class, but in WCF there's nothing like it so if you have 10 or 20 services, as I have, you have the write two lines of code to create the service and open it to each and everyone of them... not cool! I've been trying to avoid it but I guess I'll have to run create that class myself. For some magical reason when you host your services in IIS, IIS starts them up. What about the rest of us?

It seems to me Microsoft was urged to release WCF and some critical parts are missing and other not well documented or not documented at all (it's real hard to find good info).

Read Full Post

Thursday, July 19, 2007

DeKlarit 4.3 will be released with WCF support!


That's what's been keeping me busy for the last couple of months, Windows Communication Foundation.
Originally started by Andres, the WCF addin is a great tool for quickly implement your own WCF architecture, or if your new to it, is a pretty good way get things working right away and see how it all works.

Basically you will have, as you did in the Remoting or the WSE addin, your own client where you change the data provider from SimpleDataAdapterFactory to WCFDataAdapterFactory and change the DataAdpaters reference in your module project for a reference to the WCFGenerator client dll where all the proxies are hosted. By doing that your app will no longer reach the DataAdapters in order to get to the data, instead it will try to reach some services. But where are these services? At the moment you have only one option, Internet Information Services, but you will have more options in the future. Also, right now only BasicHttpBinding and WSHttpBinding is supported.


So when you run the addin you'll get:
Service Client: the project you have to reference in your client application
Server web application: where the services are hosted
Service Implementation: that's the actual place were the services are implemented, so if you want to host your services in a console application or as a Windows Service the implementation is already done and it will be the same for all three kinds of project.
Service Contracts: that's where all the interfaces used as contracts are.


There's a pre-release version of DeKlarit 4.3 in the forum.


P.S: Windows Presentation Foundation will also be available in future DeKlarit versions, sorry, no 4.3

Read Full Post

Wednesday, January 24, 2007

Windows Presentation Foundation


It's been a while since my last post. I guess I figured out I won't make a living out of this... he he, just kidding. Anyways, you know the holiday season and all, it's hard to sit down and write, so now, as I wait for the "Doble San Antonio" to come. I thought I'd write something.

Since .net Framework 3.0 (formerly winfx) was released I've been reading about it and now I'll post a little Hello World WPF application. There are tons of papers about WPF and XAML (Zamel) so I won't dig into it.

After I installed the .net 3.0 extensions for VS2005 I wanted to create my first Hello World application consisting in a simple form with a button that once clicked a MessageBox would appear with the catchy phrase, "Hello World". Simple right? Not as simple as it sounds, or at least, not as simple as it used to be.

When you start a WPF application you get the main form in the designer. There are a few improvements there like a rule for aligning controls and stuff. Then I went to my toolbox (many new controls) and drag a button into the form.

While doing this you can see what the designer is writing in XAML in a little window below the designer view. You can work either with the designer and the property page or writing the XAML code yourself.

So, once I had my button on the form I did the obvious thing to do, double clicked on it to write the handler for the OnClick event, right? WRONG!!! you can double click, triple click, and do as many clicks as you want and nothing will happen. After a few tries I discovered the Click attribute on the button tag (XAML) so I went and wrote the name of the function I wanted the button to fire up. After doing that I went to the code behind file and implemented that function (you can also write it in the XAML document). Keep in mind that this method uses the ClickEventHandler, sou you'll have to write it with a matching signature (object sender, CleickEventArgs e).
Finally, write the code to execute the MessageBox (like in 2.0) and voila!, your first WPF XAML app is working.

I added some other controls and stuff in my example, so feel free to download it and take a look at it. Any comments about it are welcome.

It's been a few days since I started to write the post, I did well in the "Doble San Antonio", thank you, and I also added some interesting functionality to the example like binding.

Read Full Post